Log in

View Full Version : case Random(XX) question



crackawacka
03-09-2012, 12:17 PM
how does


begin
case Random(110) of
10: option1;
40: option2;
60: option3;
110: option4;
end;

work

i mean i know its random but is it percentage or a random number and whatever number it comes closest to it picks that ? does the higher/lower number have more of a chance of getting chosen ? or is it truly random.


also im using a teletab making script but 1) no knowledge of scar 2) the script is made almost noob proof (as in its difficult to find what im going to ask)

basically i want the script to not uncert clay until all 25 have been used.
but everything i modified only kept uncerting straight as soon as 24 were used.

it looked like he was basically waiting 5 seconds for each clay to be used so i added 5 didnt work so i added 10... still no. (referring to the 120,000 ms)


script: http://villavu.com/forum/showthread.php?t=70231 (most recent version)

Zyt3x
03-09-2012, 12:23 PM
Random(100) would generate a random integer between 0 and 99.

I am unsure if it is true random or psuedo-random (most likely psuedo-random?), but it should work fine for whatever you're going to use it for :)

crackawacka
03-09-2012, 12:39 PM
Random(100) would generate a random integer between 0 and 99.

I am unsure if it is true random or psuedo-random (most likely psuedo-random?), but it should work fine for whatever you're going to use it for :)


alright true random so not percentage, so what if it landed on 24

would it choose nothing ? going to assume thats how it works. otherwise it would be doing one of the options constantly. interesting.

thanks for the help. guess that questions answered feel free to lock.

Ashaman88
03-09-2012, 02:09 PM
alright true random so not percentage, so what if it landed on 24

would it choose nothing ? going to assume thats how it works. otherwise it would be doing one of the options constantly. interesting.

thanks for the help. guess that questions answered feel free to lock.

yes thats how it works. If you want it to have to chose one of those options you would need to change those options to like 0-4 and then do RandomRang(0,4)