There are already many scripts which can do that, have a look in the
scripts database.
The only problem I see is that you want a random number in the range of 0..n, whereas most dice roller scripts work in the range of 1..n (with n the upper limit). You could get around this by using a more advanced dice rolling formula, for example to roll between 0 and 12 you could use this command for
Advanced Dice Roller:
code:
/roll 1d13-1
What I did here is increase the amount of sides of the dice by 1 and afterwards substract 1 from the result, resulting in a number between 0 and 12 instead of 1 and 12. This might be a bit complicated and long to type every time you need it, but you can make it a bit easier for you by storing your most used rolls in a Plus! quick text
(Preferences > Conversations > Quick Texts > New), for example:
quote:
Alias: /random12
Text: /dice 1d13-1
Then you can simply type /random12 every time you want a random number between 0 and 12. If that doesn't satisfy you, you could also modify the script itself, but that's not really recommended.