Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. var bets = [1, 3];
  2. var cashOut = 1.50;
  3.  
  4. var maxLosses = 1000;
  5. //-----------------------------------------------------------
  6. var x = 0;
  7. for (x=2;x<40;x+=2){
  8. bets[x] = bets[x-2]*2;
  9. bets[x+1] = bets[x-1]*2;
  10. }
  11. x = 0
  12. var currentBet = bets[x];
  13. var betting = true;
  14. var wins = 0;
  15. var cl = 1;
  16. var startBR = engine.getBalance();
  17. var currentBR = startBR;
  18. var sessionBR = startBR;
  19. //-----------------------------------------------------------
  20. engine.on('game_starting', function(info) {
  21. currentBR = engine.getBalance()
  22. if (engine.lastGamePlay() == "LOST") {
  23. if (x % 2 != 0) {
  24. betting = false;
  25. wins = 0;
  26. console.log('Paused betting');
  27. console.log('Moving to the next betting level.');
  28. console.log('Waiting for', cashOut+'x game.');
  29. }
  30. x++;
  31. }
  32. else{
  33. if (engine.lastGamePlay() == "WON") {
  34. wins++;
  35. if (x % 2 != 0 && wins < 4){
  36. x--;
  37. }else{
  38. if (wins >= 4){
  39. if (x % 2 == 0) {
  40. x-=2;
  41. }else{
  42. x-=3;
  43. }
  44. wins = 0;
  45. }
  46. }
  47. if (x <= 0){x=0; wins=1;}
  48. if (currentBR >= startBR){startBR=currentBR;}
  49. }
  50. }
  51. if (x == 0 || x == 1){
  52. cl = 1;
  53. }else{
  54. if (x % 2 == 0 ){
  55. cl = (x/2)+1;
  56. }else{
  57. cl = Math.round(x/2);
  58. }
  59. }
  60. console.log('Wins in betting level',cl+' =', wins);
  61. currentBet = bets[x];
  62. if (betting) {
  63. engine.placeBet(Math.round(currentBet)*100, Math.round(cashOut*100));
  64. console.log('Placing bet of', Math.round(currentBet), 'at', Math.round(cashOut*100)/100+"x");
  65. }
  66. });
  67. engine.on('game_crash', function(data) {
  68. currentBR = engine.getBalance();
  69. if (!betting && data.game_crash/100 >= cashOut){
  70. betting = true;
  71. }
  72. console.clear();
  73. console.log(' ');
  74. console.log('Current profit/losses =', Math.round(currentBR-startBR)/100);
  75. console.log('Session Profit/Losses =', Math.round(currentBR - sessionBR)/100);
  76. if ((startBR-currentBR)/100 >= maxLosses){
  77. console.log('We have lost too much. Stopping script.');
  78. engine.stop();
  79. }
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement