Reply to Re: Randomization scripting help
If you don't have an account, just leave the password field blank.
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);
}
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);
}