Dice Roller

By Zach on Sep 04, 2004

This is my dice roller, it's like AOL's //dice command... Load it into your aliases. You can use $dice(n1,n2) or /dice n1 n2 ****

n1 is how many sides there are on the die. *
n2 is how many times you roll the dice

dice {
  tokenize 32 $iif($1 isnum 1-,$1,6) $iif($2 isnum 1-,$2,3)
  var %i = 1
  while (%i <= $2) { var %o = $instok(%o,$iif($calc($rand(1,$1) % 2),$rand(1,$1),$rand(1,$1)),0,44) | inc %i }
  if ($isid) { return $replace(%o,$chr(44),$chr(44) $+ $chr(32)) }
  else { echo -a You rolled a $1 sided die $2 times and got: $replace(%o,$chr(44),$chr(44) $+ $chr(32)) }
}
; The reason for $iif(($rand(1,$1) % 2)... is to cause a double roll either way to get more random numbers.... 

Comments

Sign in to comment.
CowBoy   -  Dec 24, 2004

Why Are you Getting so complicated with it?

 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.