Random number generator with probabilities.
on *:text:!prize:#:{
set %table $rand(1,3831)
if (%table == 1-2500) { describe $chan YOU WIN$1 }
if (%table == 2501-3000) { describe $chan YOU WIN$5 }
if (%table == 3001-3250) { describe $chan YOU WIN$10 }
if (%table == 3251-3417) { describe $chan YOU WIN$15 }
if (%table == 3418-3543) { describe $chan YOU WIN$20 }
if (%table == 3544-3644) { describe $chan YOU WIN$25 }
if (%table == 3645-3695) { describe $chan YOU WIN$50 }
if (%table == 3696-3729) { describe $chan YOU WIN$75 }
if (%table == 3730-3755) { describe $chan YOU WIN$100 }
if (%table == 3756-3772) { describe $chan YOU WIN$150 }
if (%table == 3773-3785) { describe $chan YOU WIN$200 }
if (%table == 3786-3796) { describe $chan YOU WIN$250 }
if (%table == 3797-3805) { describe $chan YOU WIN$300 }
if (%table == 3806-3813) { describe $chan YOU WIN$350 }
if (%table == 3814-3820) { describe $chan YOU WIN$400 }
if (%table == 3821-3826) { describe $chan YOU WIN$450 }
if (%table == 3827-3831) { describe $chan YOU WIN_$500 }
}
I am attempting to do probabilities but I am not sure if '-' is the right range indicator. I want it to pick a random number from 1-3831, then return the correct entry for the desired range.
Help?
/help isnum