This is a random slap script that I made, when you type /slap (nick) it slaps the nick with random stuff. :D
Command: /slap nick
Post your suggestions and comments.
alias slap {
var %r $r(1,6)
if ( %r == 1 ) { describe $chan slaps $1 around a bit with a large trout. }
if ( %r == 2 ) { describe $chan slaps $1 with a television. }
if ( %r == 3 ) { describe $chan slaps $1 with a fish. }
if ( %r == 4 ) { describe $chan slaps $1 with a pair of sunglasses. }
if ( %r == 5 ) { describe $chan bitch slaps $1 $+ . }
if ( %r == 6 ) { describe $chan slaps $1 with a birthday cake. }
}
You can even shorten the script further by placing those slap messages, including the $1 identifier line by line vertically, in a txt file called, say, 'slap.txt' and then play them to the targeted person on the channel.
alias slap { describe # $read(slap.txt) }
This way a random line from slap.txt will be played upon the trigger of slap alias. Of course, more messages can be added in the future.
Only one /describe command is needed to randomize the %randmsg
alias slap {
var %randmsg = slaps $1 around a bit with a large trout.:slaps $1 with a fish.:slaps $1 with a pair of sunglasses.:bitch slaps $1 $+ .:slaps $1 with a birthday cake.
describe $chan $gettok(%randmsg,$rand(1,$numtok(%randmsg,58)),58)
}
No need for a global set variable here.
Use a local variable to avoid harddrive writes and reads.
ANYWHERE $chan works the short form # will work.
The main reason $chan exist is for doing more elaborate
things like $chan(0) $chan(#).topic etc etc
$r(1,6) is short for $rand(1,6)
This should be in a nicklist popup because of $1
menu nicklist {
Random Slap $$1:slap $1
}
alias slap {
var %r $r(1,6)
if %r == 1 { describe # slaps $1 around a bit with a large trout. }
if %r == 2 { describe # slaps $1 with a television. }
if %r == 3 { describe # slaps $1 with a fish. }
if %r == 4 { describe # slaps $1 with a pair of sunglasses. }
if %r == 5 { describe # bitch slaps $1 $+ . }
if %r == 6 { describe # slaps $1 with a birthday cake. }
}