Dice and Coins - Try your luck

Author Topic: Dice and Coins - Try your luck  (Read 5751 times)

This is a simple mod. So simple that I literally cannot be forgeted to upload it to RTB and wait thirty to fifty times the length of time it took to make for it to be made available.

Script_Dice.zip

This adds three commands:
/roll AdB[±bonus] [comparison] - Roll A B-sided dice, such as '2d6' for two six-sided dice. Up to 1-15 dice of 3-100 sides by default. Samples:
  • /roll 1d6 - One six-sided dice.
  • /roll 1d6+2 - One six-sided dice with 2 added onto the result.
  • /roll 1d6-1 - One six-sided dice with 1 subtracted from the result.
  • /roll 1d6+2>5 - One six-sided dice with 2 added onto the result, with a success message if the result is over 5.
/proll AdB[±bonus] [comparison] - As with /roll except only you will see the result.
/flip - Flip a coin for heads or tails.

This now also adds an event:
Brick -> rollDice [ Input, Sub Data ] - Input is the same format as /roll and /proll. Sub Data is the same format as VCE sub data for ifValue/ifVariable - If a comparison is present in the input, it will process onVariableTrue/onVariableFalse the same way VCE does. If no comparison is present, this value is ignored.
The input supports variable replacers, though if the result is erroneous a message will be printed to the client who activated it.

There's some prefs (not added to RTB's pref manager) at the top of server.cs if you want to change them.
A note: With $Dice::HardErrors set to 0, if someone tries to roll more dice than $Dice::MaxCount or with more sides than $Dice::MaxSides, the values will be modified and no error will be thrown.
« Last Edit: March 28, 2012, 01:06:04 AM by M »





Saving us 10 seconds of time to go find that old board game, get out the dice, and roll it.

Or getting a coin from your pocket, whichevers the case.

You sir, have my eternal gratefulness. I was searching for something like this for years, even toyed with learning Torque only for that and now you released this awesome thing. Many thanks!

Saving us 10 seconds of time to go find that old board game, get out the dice, and roll it.

Or getting a coin from your pocket, whichevers the case.

An actual mod stops people saying "u jus sed heads", or cheating, as this shows the result to everyone.

Thank you kind sir for this amazing add-on. May you live a great, fulfilling life.


An actual mod stops people saying "u jus sed heads", or cheating, as this shows the result to everyone.
not bashing the addon, just remarking on it

its certainly useful, though, as some people don't have 3-sided or 99-sided dice.

good addon, especially for mini empires

protip: don't try this


good addon, especially for mini empires

protip: don't try this

/snip


Roll 1d20 for skill
I should add support for /roll 1d20+2 > 14 or something so you can do skill tests easily without having to think

Gonna try that later