I'm new to scripting but here goes.. my first shot at something worth posting. This snippet I used in my bot to entetain and have fun with, Only Ops can start it off and stop it. but any user can throw a snowball at another in the room. There's a 50/50 chance of hitting someone but the bot never misses, should you decide to throw a snowball at the bot.
Start it by a !snow on. Stop it by a !snow off
Just typing !snow will throw a snowball in the air and you catch it.
!snow and you stand a chance of hitting them with a splat!
on *:text:*snow*:#: {
if $1 == ! $+ snow {
if ($2 == off) {
if ($nick isop $chan) set %sb 0
if (%sb == 0) { /msg $chan Oh all the snow is gone now | halt }
}
if ($2 == on) {
if ($nick isop $chan) set %sb 1
if (%sb == 1) { /msg $chan Yay it has snowed again. Let's play Snowballs | halt }
}
if (%sb == 0) { /msg $chan There's no snow here! | halt }
if ($2 == $null) { describe $chan $nick throws a snowball in the air and catches it | halt }
if $2 ison $chan {
set %tk $rand(1,2) {
if ($2 == $nick) { /msg $chan Now your just being silly $nick lmao | halt }
if (%tk == 1) {
if ($2 == $me) {
{ /msg $chan Oi ! $nick I'll get you for that! }
./timer 1 10 { describe $chan throws a snowball back and splats $nick }
}
if (%tk == 1) { describe $chan $nick throws a snowball and splat's $2 }
}
if (%tk == 2) { /msg $chan Ohhhhhh bad luck $nick you missed $2 | halt }
}
}
else {
{ describe $chan $nick throws a snowball at $2 and misses }
{ /msg $chan No wonder you missed them $nick lol ... $2 is not here pmsl }
}
}
}