Skip to main content

Spin Calculate

This node updates the player's session state based on spin results.

The Spin Calculate node manages the wallet, statistics, and counters.

The Spin Calculate node takes the results of a spin (winnings, hits, etc.) and updates the running totals for the session. It calculates the new capital (balance), total bets, total winnings, and spin counts.

Inputs

Inputs

DataDescription
CapitalCurrent player balance.
Bet AmountAmount bet on this spin.
Spin WinningsAmount won in this spin.
Total BetsRunning total of all bets.
Total WinningsRunning total of all winnings.
Current Free SpinsNumber of free spins remaining.
Spin CountTotal spins played.
HitsTotal number of winning spins.

Actions

SignalDescription
DoTriggers the calculation.

Outputs

Results

DataDescription
CapitalUpdated balance.
Total BetsUpdated total bets.
Total WinningsUpdated total winnings.
Spin CountUpdated spin count.
HitsUpdated hit count.

Events

SignalDescription
DoneTriggered when calculation is complete.

Usage

Session Management

  1. Store Capital, TotalBets, etc., in Variables.
  2. After a spin, pass the current variable values and the new Spin Winnings to Spin Calculate.
  3. Trigger Do.
  4. Update the Variables with the new output values.

Detailed Behavior

  • Free Spins: If Current Free Spins > 0, the Bet Amount is not deducted from Capital (free spins are free).
  • Stats: It increments Hits only if Spin Winnings > 0.

Troubleshooting

  • Balance Draining: If balance drops during free spins, ensure Current Free Spins is correctly passed as > 0.