einy meiny mieny mo (spelt wrong probably)

By Basillisk on Nov 29, 2008

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
}

Comments

Sign in to comment.
Basillisk   -  Dec 01, 2008

rofl
/me laughs

 Respond  
Jonesy44   -  Dec 01, 2008

Fuck sake Napa! beating me :L ignore that ^

 Respond  
Jonesy44   -  Dec 01, 2008
alias emmm { return $gettok($1-,$r(1,$0),32) }

Call it with

$emmm(text text2 text 3)

Sorry if someone's already done it. cba to check :P

 Respond  
NIGathan   -  Dec 01, 2008

on :TEXT:!emmm :#:{ msg $chan emmm answer: $ [ $+ [ $rand(2,$0) ] ] }

This eliminates the need for $2 to be a number, and will allow infinite params.

 Respond  
F*U*R*B*Y*   -  Nov 30, 2008

i'd check to see if $2 is a number......

 Respond  
Basillisk   -  Nov 30, 2008

i was mainly copying and pasting the lines and changing the numbers napa ;P
but blitz is right, i didnt think I'd need more than 10 options

Thanks for the comments btw :D
I suppose I'll try :D

I'm just using napa's version now :P

 Respond  
Blitzjager   -  Nov 29, 2008

That and would you really need even 10 options?

 Respond  
napa182   -  Nov 29, 2008

vSkyzv ur version of it returns numbers

i think they only had it go up to 10 cuz they got sick of typing lol jk

 Respond  
vSkyzv   -  Nov 29, 2008

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.

 Respond  
Blitzjager   -  Nov 29, 2008

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

 Respond  
Basillisk   -  Nov 29, 2008

jesus o_O

 Respond  
napa182   -  Nov 29, 2008

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)
 Respond  
Basillisk   -  Nov 29, 2008

feel free to say how it could be improved or something :D

 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.