Code: Select all

`Dim max,min`

If(IsNumeric(clipboard.value)) Then

max=CLng(clipboard.value)

Else

max=1e9

End If

Randomize

clipboard.value = CStr(Int(max*Rnd))

Use: first, prepare an integer in the clipboard you want to act as a "Max" such that 0 <= random integer < Max

For example, if you choose 10 you may get anything 0..9. I am a programmer, so counting from zero and not counting the cardinal is just how I roll. But if you want to count from 1 and include the cardinal (EG 1..10), just tack a +1 onto the end of the final line of code.

Then apply this action to that "max" value and the fresh random integer value will be put into your clipboard.

As a bonus, if you choose a "max" that is not a number then this will just choose a max of one billion instead. That's a Fermi approximation of the the range we're normally working with in SL as channel is a signed 32 bit number, so it's convenient for us to not always have to specify the max value. If you'd like a different default max, just alter line 5.

Happy entropy folks! :9