it just chooses a random word out of the words the person has said i suppose. it is rather simple, i know o_O
syntax: !emmm (etc. max of 10 parametres)
i.e
"!emmm 5 a b c d e" would come up with a, b, c, d or e
I made this cause i couldnt make a decision on a game
rather new at this so please dont laugh :D
on *:TEXT:!emmm*:#:{
var %emmm = $rand(1,$2)
if (%emmm == 1) msg $chan emmm answer : $3
if (%emmm == 2) msg $chan emmm answer : $4
if (%emmm == 3) msg $chan emmm answer : $5
if (%emmm == 4) msg $chan emmm answer : $6
if (%emmm == 5) msg $chan emmm answer : $7
if (%emmm == 6) msg $chan emmm answer : $8
if (%emmm == 7) msg $chan emmm answer : $9
if (%emmm == 8) msg $chan emmm answer : $10
if (%emmm == 9) msg $chan emmm answer : $11
if (%emmm == 10) msg $chan emmm answer : $12
}
You could shorten the code to this:
on *:TEXT:!emmm*:#:{
var %emmm = $rand(1,$2)
if (%emmm != $null) && (%emmm <= 10) msg $chan emmm answer: $calc(%emmm + 2)
}
As I saw in your script, the answer is always "two plus %emmm". This is basically what my revision does. I also saw that %emmm only went up to ten. This revision also makes sure that %emmm only goes up to ten.
I'm horrible at making decisions so this is actually useful for me :P
How I'd do it:
on *:TEXT:!emmm*:#:{
var %emmm = [ $ $+ [ $rand(2,$0) ] ]
msg $chan emmm answer : %emmm
}
Not as small as napa's but it's another way to shorten it.
And unless you're the only one using it you should have flood protection
just to show one of the many ways this can be done.
you could use tokens
look into /help $gettok
and /help $numtok
then just do !emmm a b c d e f g
on *:TEXT:!emmm*:#:{ msg # emmm answer : $gettok($2-,$r(1,$numtok($2-,32)),32) }
you may want to add error checks and flood control to it
or maybe just do
alias emmm echo -a emmm answer : $gettok($1-,$r(1,$0),32)