Skip to content
DiceSim

Lua scripts

Free Lua dice bot scripts

11 betting systems written as dice bot scripts, each with the full source, a step-by-step explanation and the streak math for its default settings. Every script sets chance and nextbet and defines a dobet() function that runs after each roll, the same shape DiceBot scripts use.

You can run any of them for free in the DiceSim simulator, which rolls provably-fair dice in your browser. Nothing is wagered and you don’t need an account.

The scripts use the global names from Seuntjie’s DiceBot (chance, bethigh, nextbet, previousbet, balance, win), so they read the same in bots built on that API. They also read their settings from params, which only DiceSim provides: replace params.name or value with the value before pasting a script into another bot.

Martingale

Doubles the bet after each loss and goes back to the base bet after a win.

Chance
49.5%
Type
Martingale

Delayed escalation

Bets 3.35% for a 29.55x payout. Flat bets through 50 losses, then 4% more per loss.

Chance
3.35%
Type
Dynamic scaling

Paroli 3-step

Doubles after a win, banks the profit after 3 wins in a row, resets on any loss.

Chance
49.5%
Type
Paroli

Dynamic recovery

Sizes each bet so one win recovers the drawdown plus one base bet, capped at 10% of balance.

Chance
33%
Type
Recovery

D'Alembert

Adds one unit after a loss and removes one after a win, never going below the base bet.

Chance
49.5%
Type
D'Alembert

Labouchere

Bets the first plus the last number of a list. Wins cross numbers off, losses add one.

Chance
49.5%
Type
Labouchere

Fibonacci

Bets follow the Fibonacci sequence: one step up after a loss, two steps back after a win.

Chance
49.5%
Type
Fibonacci

Oscar's Grind

Plays in cycles that aim for +1 unit: same bet after a loss, one unit more after a win.

Chance
49.5%
Type
Oscar's Grind

1-3-2-6

Bets 1, 3, 2 and 6 units on consecutive wins. Any loss, or the 4th win, resets to 1.

Chance
49.5%
Type
Positive progression

Flat betting

Same bet on every roll, with a stop loss and a take profit at 10% of the starting balance.

Chance
49.5%
Type
Flat betting

Martingale + vault

Martingale that moves half of every 1% profit step to the vault with vault().

Chance
49.5%
Type
Martingale

How to use a script

  1. Open a script and press Run it in the simulator. The script loads into the editor with the template’s starting balance.
  2. Set the starting balance and seeds in the config panel and the number of rolls in the control bar, then start the run. You can edit the code too; the draft is kept in this browser.
  3. Read the balance chart, and open the Bets tab to check individual bets. The Stress Test tab runs the same script on five different seed pairs at once.
  4. Try other values for the params settings with the Auto-Tuner, and compare the risk numbers with the dice calculator.
  5. Every global the scripts use is documented in the Lua reference.