Choice

By Cados on Mar 07, 2010

Short but fun copy of my chance script. It bans no matter what but unbans after 25 seconds. Have fun :).

[01:03:06am] !choice
[01:03:06am] Weasand sets mode: +vho Cados Cados Cados
[01:03:09am] <&Weasand> I just feel like banning you though...
[01:03:11am]
Cados was kicked by Weasand (Felt like it. :))
[01:03:12am] * Cados (~Dark@Fighting.For.Nothing) has joined #Wolverines

on *:TEXT:!choice:#:{
  set %choice $rand(1,2)
  if (%choice == 1) { ban -ku25 # $nick 2 You lose. :P }
  if (%choice == 2) { mode # +vho $str($nick $chr(32),3) | .timer 1 3 msg $chan I just feel like banning you though... | .timer 1 5 ban -ku25 # $nick 2 You lose. :P }
}

Comments

Sign in to comment.
Jethro   -  Mar 07, 2010

You can actually use an else since there are only two chances. If one of them doesn't equal to 1, it has to be the 2nd chance:

on @*:text:$($strip(!choice)):#: {
  var %choice = $rand(1,2)
  if (%choice == 1) { ban -ku25 # $nick 2 You lose. :P }
  else { mode # +vho $str($nick $chr(32),3) | .timerban1 1 3 .msg # I just feel like banning you though... | .timerban2 1 5 ban -ku25 # $nick 2 You lose. :P }
}
 Respond  
Jethro   -  Mar 07, 2010

Here is my version:

on @*:text:$($strip(!choice)):#: {
  if ($left($regsubex($1,/./,$r(1,2)),1) = 1) ban -ku26 # $nick 2 You lose. :P 
  else mode # +vho $str($nick $chr(32),3)) | .timerban1 1 3 .msg # I just $&
    feel like banning you though... | .timerban2 1 5 ban -ku25 # $nick 2 You lose. :P 
}

You should name your timers as napa suggested...in case there is another same timer conflicts with each other. @ prefix should be included next to the text event, making sure the client running the code is opped in channel before kicking and banning.

Note: maybe regsubex is totally unnecessary, but I use it for experimentation purposes.

 Respond  
Cados   -  Mar 07, 2010

Man you know so much...

 Respond  
napa182   -  Mar 07, 2010

you can use the -u switch instead of useing a timer to unset the ban

ban -ku26 # $nick 2 You lose. :P

also

mode # +vho $str($nick $chr(32),3)

you may also want to name ur timers as well as using var instead of set

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.