mIRC Homepage
Posted By: DaBigBadShow bot asks age on a timer - 13/09/10 11:02 PM
anyone know a script that will ask age and give a certain time befre kicking or auto voicing if thye right age
Posted By: RusselB Re: bot asks age on a timer - 14/09/10 09:50 AM
Example only
Code:
on @*:join:#:{
  .notice $nick Please enter your age as a number.
  .notice $nick You have 1 minute to do so.
  set $+(%,nick,$address) $nick
  $+(.timer,age,$nick) 1 60 ban -ku60 $chan $nick Age required.
}
on @*:text:*:#:{
  if ($($+(%,nick,$address),2) == $nick) {
    if ($1 isnum 18-) {
      .mode $chan +v $nick
      $+(.timer,age,$nick) off
    }
    eiseif $1 isnum {
      .ban -ku60 $chan $nick Come back when you are 18 or older.
      $+(.timer,age,$nick) off
    }
  }
}

Posted By: DaBigBadShow Re: bot asks age on a timer - 14/09/10 06:37 PM
nice script man i just did a few changes work likes a charm and thanks again
Posted By: Thels Re: bot asks age on a timer - 15/09/10 10:35 AM
The only thing you have to keep in mind is people changing their nick before that time.
Posted By: DaBigBadShow Re: bot asks age on a timer - 20/09/10 05:42 PM
anyway to check to see if a user is already voiced cause it tends to boot anyone not in op

this is what i did with it so far

on @*:join:#dabigbadshow:{
/notice $nick Please enter your age like this !18.
/notice $nick You have 1 minute to do so $nick or you will be kicked.
set $+(%,nick,$address) $nick
$+(.timer,age,$nick) 1 60 kick $chan $nick Age required.
}
on $*:text:/^!(\d+)/S:#dabigbadshow: {
tokenize 32 $strip($regml(1))
if ($($+(%,nick,$address),2) == $nick) {
if ($1 isnum 18-) {
.mode $chan +v $nick
$+(.timer,age,$nick) off
}
elseif $1 isnum {
.mode $chan +b $wildsite $nick Come back when you are 18 or older.
.kick $chan $nick Come Back After Your 18th Birthday.
$+(.timer,age,$nick) off
}
}
}
Posted By: Thels Re: bot asks age on a timer - 20/09/10 08:14 PM
Put code /code blocks around it. It makes it much easier to read.

Your solution is to call an alias.

Code:
on @*:join:#dabigbadshow:{
  /notice $nick Please enter your age like this !18.
  /notice $nick You have 1 minute to do so $nick or you will be kicked.
  set $+(%,nick,$address) $nick
  $+(.timer,age,$nick) 1 60 checkkick $chan $nick
}
on $*:text:/^!(\d+)/S:#dabigbadshow: {
  tokenize 32 $strip($regml(1))
  if ($($+(%,nick,$address),2) == $nick) {
    if ($1 isnum 18-) {
      .mode $chan +v $nick
      $+(.timer,age,$nick) off
    }
    elseif $1 isnum {
      .mode $chan +b $wildsite $nick Come back when you are 18 or older.
      .kick $chan $nick Come Back After Your 18th Birthday.
      $+(.timer,age,$nick) off
    }
  }
}

alias -l checkkick {
  if $2 isreg $1 {
    kick $1 $2 Age required.
  }
}
© mIRC Discussion Forums