Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var list = [1,2,2,1]; // an array to be used as our labouchere list
- var wager = 0; // will hold our last wager, to be pushed to the list on loss
- engine.on('GAME_STARTING', onGameStarted);
- engine.on('GAME_ENDED', onGameEnded);
- function onGameStarted() {
- // our next wager is the combination of the 1st and last of our labouchere list
- wager = list[0]+list[list.length-1];
- /* this is what lightguidebaka script does */
- engine.bet(Math.ceil((wager*config.baseBet.value)/200)*100, config.basePayout.value);
- /* this factors basebet configuration into the wager equation, no more */
- // engine.bet((wager*config.baseBet.value), config.basePayout.value);
- /* standard, list as wager, *100 from satoshis to bits */
- //engine.bet(wager * 100, config.basePayout.value);
- }
- function onGameEnded() {
- // if we peaked, force low/base bets, i see lightguide do this
- //if (userInfo.balance > balance) {
- // balance = userInfo.balance;
- // list = [ 1 ];
- //} else {
- /* if we are down from peak, we apply labouchere
- if we cashed, we won, remove first and last from labouchere list */
- if (engine.history.first().cashedAt == config.basePayout.value) {
- list = list.slice(1, -1);
- // if we ran out of items, good, restart
- if (list.length == 0) { list = [1,2,3]; }
- } else {
- // if we did not cash out, we lost, add our previous wager to the labouchere list
- list.push(wager);
- }
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement