IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: Weirdguy on April 15, 2007, 07:04:37 PM

Title: Random numbers and more
Post by: Weirdguy on April 15, 2007, 07:04:37 PM
I think there is a way to do this, how can I get random numbers. Like I could say 10-10,000,000 and it would pick out a number in that range.

Also I would like to have a counter, so everytime it say, noticed someone from ontext, it would say "I have exploded *counted number* of times"

Thanks
Title: Re: Random numbers and more
Post by: Snerf on April 15, 2007, 07:29:36 PM
Well, I am not sure what version of scripting you want.

$rnd(10,10000)  will give you a random number in that range.

As for adding a counter, just declare a variable outside of all your sub, and it will keep it counting. But, that number will reset each time the script is re-loaded, so you could just save the number to an INI file, and read it on script load.