Created
June 30, 2021 18:22
-
-
Save zundra/b6dd2b620cbc23803fc744de2ddf0aa5 to your computer and use it in GitHub Desktop.
Bust below threshold watch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
bust_threshold: { value: 2, type: "multiplier", label: "Count busts below this value and bet after <n> busts" }, | |
bust_threshold_limit: { value: 5, type: "multiplier", label: "How many busts to track below threshold before betting" }, | |
}; | |
var stateVars = { | |
bustCountBelowThreshold: 0 | |
}; | |
log("Script is running.."); | |
engine.on("GAME_STARTING", onGameStarted); | |
engine.once("GAME_STARTING", () => engine.on("GAME_ENDED", onGameEnded)); | |
function onGameStarted() { | |
log("The current bust count is ", stateVars.bustCountBelowThreshold); | |
log("The current bust limit is ", config.bust_threshold_limit.value); | |
if (stateVars.bustCountBelowThreshold >= config.bust_threshold_limit.value) | |
{ | |
log("Detected a loss above threshold [", stateVars.bustCountBelowThreshold, "]") | |
} | |
} | |
function onGameEnded() { | |
var lastGame = engine.history.first(); | |
if (lastGame.bust <= config.bust_threshold.value) | |
{ | |
stateVars.bustCountBelowThreshold++; | |
} | |
else | |
{ | |
stateVars.bustCountBelowThreshold = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment