Instead of just using rand to choose wether something is executed or not im looking for a way to give it say a 1 in 20 chance of being executed rather that a 1 in 2 chance. I did a search for probability but came up empty.
Any help would be greatly appreciated.
Thanks again.
Jon.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
thanks demond please dont hesitate to laugh at my stupidity
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19.
Once the game is over, the king and the pawn go back in the same box.
caesar wrote:The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19.
All i needed was a small easy way to make my bot kick someone with a 1 in 20 chance of them triggering the proc kinda a russian roulette thing so 0 - 19 or 1 - 20 would do exactly the same thing at the end of the day thanks again for your replys hope you all had a good xmas.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
caesar wrote:The result of [rand 20] will allways be a number betwen 0 and 19 (0 and 19 included), while the result of [expr [rand 20] +1] will be from 1 to 20 (1 and 20 included). And if you read again he did said 1 to 20 not 0 to 19.
that's exactly what i meant
however, he didn't say "1 to 20", he said "1 in 20" (chance), so if you take 0-19 or 1-20 doesn't matter
All i needed was a small easy way to make my bot kick someone with a 1 in 20 chance of them triggering the proc kinda a russian roulette thing so 0 - 19 or 1 - 20 would do exactly the same thing at the end of the day thanks again for your replys hope you all had a good xmas.
aye your way is great if i wanted to execute something different on a number returned but all i wanted was something to be executed with a 1 in 20 chance which [!rand 20] did perfectly cheers
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
sorry right i missed the ! which in this case is verry important .. hehe also if that is the case i have to say u can't use the +1 method cause it will never return 0 = > if the value is 1-20 the if statement will never be true ..