A simple bomb script to be used in channels, has three wires.
!bomb
!cut
Enjoy.
on *:text:!bomb *:#: {
set %bombtime $r(20,60)
if ($2 ison #) { msg $chan 14OH NO! $nick has decided to bomb $2 $+ ! Quickly $2 Defuse that bomb! Type 4!cut red 12!cut blue 14or 9!cut green 14to defuse the bomb. You have %bombtime seconds!
set %color $r(1,3)
if (%color == 1) { set %color red }
if (%color == 2) { set %color blue }
if (%color == 3) { set %color green }
set %bombnick $nick
timerBomb 1 %bombtime kick $chan $nick -^~^-^~^-!BOOM!-^~^-^~^- Times up :)
timer 1 %bombtime unset %bombnick
}
}
on *:text:!cut *:#: {
if (($nick == %bombnick) && ($2 == %color)) { msg $chan Congratulation you have defused the bomb! | unset %bombnick | timerBomb off }
if (($nick == %bombnick) && ($2 != %color)) { kick $chan $nick -^~^-^~^-!BOOM!-^~^-^~^- you cut the wrong wire -_- | unset %bombnick | timerBomb off }
}
You can combine these two text events into one. There are a couple of shortcomings to consider:
If someone else triggers the command !bomb while the other person's bomb is being defused, it'll overwrite that person's session. You should make a check or disable the script until that person has finished defusing the bomb. (or you can make your variables dynamic so mirc will distinguish who is to defuse the bomb)
same