Is there an easy way to make random numbers? I don't think I found anything in the docs, the closest I got was "chance"....
In the end I made my own basic rand function It's a bit rough and ready, but it seems to work, mostly. :)
rand : subroutine {
: set_integer var="rand_result" value="0";
: if (chance(50) == true) {
: add var="rand_result" value="50";
}
: if (chance(50) == true) {
: add var="rand_result" value="25";
}
: if (chance(50) == true) {
: add var="rand_result" value="12";
}
: if (chance(50) == true) {
: add var="rand_result" value="6";
}
: if (chance(50) == true) {
: add var="rand_result" value="3";
}
: if (chance(33) == true) {
: add var="rand_result" value="2";
}
: if (chance(33) == true) {
: add var="rand_result" value="1";
}
}
:)