The Dink Network

Reply to Re: Randomization scripting help

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 9th 2007, 03:29 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
The command random works like this:
random(range,base);

range: amount of possible outcomes, So if you fill in 3 there are three different possible outcomes. The base is the lowest of those numbers. So filling in:
random(3,70); will return 70, 71 or 72
random(2,0); will return 0 or 1
random(6,1); will return 1, 2, 3, 4, 5 or 6
random(3,-5); will return -5, -4 or -3 (never checked if the base could be negative though... )

So for your script:
int &number = random(3,25); will return 25, 26 or 27.
if (&number == 25)
{
say("Yes, number is in fact 25",1);
}
if (&number == 26)
{
say("Yes, number is in fact 26",1);
}
if (&number == 27)
{
say("Yes, number is in fact 27",1);
}