Mega Dice

By dull on Apr 28, 2008

A dice script with a counter inside it, and some extra's...
Only works if another user says -dice-
You can add text behind the command... makes stuff more easy.

on *:TEXT:-dice-*:#:{
  /set %dice $rand(1,6)
  if (%dice == 1) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 1. Better luck next time! }
  if (%dice == 2) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 2. You're on your way! }
  if (%dice == 3) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 3. Mmm... Not too bad. }
  if (%dice == 4) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 4. Good move! }
  if (%dice == 5) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 5. That's quite neat! }
  if (%dice == 6) { describe # 0,1rolls a dice... | msg # 1,0You have thrown a 6. Lucky you! That was a awesome move! }
}

Comments

Sign in to comment.
dull   -  Apr 29, 2008

okay. :)

sounds all coplicated but I\'ll try to figure out how to work with that

 Respond  
guest598594   -  Apr 28, 2008

When you\'re doing something no matter what the if statement is is, don\'t include it in the if\'s. Example:

  describe $chan rolls a dice...
  if (%dice == 1) msg $chan You have thrown a 1.
  if (%dice == 2) msg $chan You have thrown a 2.
  ...

But you don\'t even need the variable, you could just say \"msg $chan You have rolled a $r(1,6) $+ !\"

Also, if you do it the way it is, make it a local variable (/var %var = data) so that it is $null when the script is done.

 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.