Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1.  
  2. var list = [1,2,2,1]; // an array to be used as our labouchere list
  3. var wager = 0; // will hold our last wager, to be pushed to the list on loss
  4.  
  5. engine.on('GAME_STARTING', onGameStarted);
  6. engine.on('GAME_ENDED', onGameEnded);
  7.  
  8. function onGameStarted() {
  9. // our next wager is the combination of the 1st and last of our labouchere list
  10. wager = list[0]+list[list.length-1];
  11.  
  12. /* this is what lightguidebaka script does */
  13. engine.bet(Math.ceil((wager*config.baseBet.value)/200)*100, config.basePayout.value);
  14.  
  15. /* this factors basebet configuration into the wager equation, no more */
  16. // engine.bet((wager*config.baseBet.value), config.basePayout.value);
  17.  
  18. /* standard, list as wager, *100 from satoshis to bits */
  19. //engine.bet(wager * 100, config.basePayout.value);
  20. }
  21.  
  22. function onGameEnded() {
  23. // if we peaked, force low/base bets, i see lightguide do this
  24. //if (userInfo.balance > balance) {
  25. // balance = userInfo.balance;
  26. // list = [ 1 ];
  27. //} else {
  28. /* if we are down from peak, we apply labouchere
  29. if we cashed, we won, remove first and last from labouchere list */
  30. if (engine.history.first().cashedAt == config.basePayout.value) {
  31. list = list.slice(1, -1);
  32.  
  33. // if we ran out of items, good, restart
  34. if (list.length == 0) { list = [1,2,3]; }
  35. } else {
  36. // if we did not cash out, we lost, add our previous wager to the labouchere list
  37. list.push(wager);
  38. }
  39. //}
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement