Dice and Coins - Try your luck

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

Not very useful if it can't be controlled or effected by events.

Updated. First post updated to match.

Quote from: Changelog
  • Added new support for bonuses (1d20+5) and comparisons (1d20>10). Bonuses can be used with comparisons (1d20+5>10).
  • Added variable events integration - rollDice output event on bricks. Enter the same format as the /roll command. The second input is sub data - see regular VCE use. If a comparison is present it will automatically process onVariableTrue/onVariableFalse the same way VCE does.
« Last Edit: March 28, 2012, 01:06:18 AM by M »

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.

 "A gambling vagabond who finds freedom from society's narrow views of morality aboard his airship, the Blackjack..."
-Setzer Gabbiani

Now i can be a gambler, if only someone made card projectile's and dart projectile's.... and oh, yeah a giant Blimp witha  cassino inside. Yeah life is great!

Make it so that we can flip multiple coins so we don't have to spam chat with /flip.

Example: /flip 2 flips 2 coins.

This would be very cool for some RPG's. Maybe I will DL.