Nando0508

3.84

Nov 16th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. //Settings
  2. var targetMultiplier = 3.84; //recomended 1.17
  3. var initialBet = 100; //in bits
  4. var maxBet = 100000000; //max Bet in Bits
  5. var resetBet = false; //true: if max bet is reached bet will be reset to initial bet, false: continue with maxBet
  6. var stopMaxBet = false; //true: stop if maxBet is reached, false: continue with processing
  7.  
  8. var stopLowBalance = true; //true: stop if balance is not enough for currentBet, false: continue with intial bet if possible
  9.  
  10.  
  11.  
  12. var targetProfit = 100; //in bits; don't be too greedy
  13.  
  14. var enableLossStreakProtection = false; // enable LossStreak Protection
  15. var maxLossStreak = 3; //if Loss Streak Protection is enabled; maximum lose streak before pausing the bot for x games
  16.  
  17. var multiplyBet = false; // if set to true each winning stake is multiplied by betMultiplier
  18. var betMultiplier = 2; //only used when multilyBet is true
  19.  
  20.  
  21.  
  22. //variables --- DO NOT CHANGE SOMETHING BELOW! -----
  23. var SatoshiMultiplier = 100;
  24. var cooledDown = false;
  25. var baseSatoshi = initialBet * SatoshiMultiplier;
  26. var maxBetSatoshi = maxBet * SatoshiMultiplier;
  27. var currLoss = 0;
  28. var currentGameID = -1;
  29. var playedGames = 0;
  30. var profit = 0;
  31. var initialBalance = engine.getBalance();
  32. var currentBet = 0;
  33. var startTime = new Date().getTime();
  34. var timeRunning = 0;
  35. var currentTime;
  36. var highestBalance = 0;
  37.  
  38. //Initialization
  39.  
  40. console.log('[Bot] ====== Peacem4ker\'s BustaBit Script ======[Bot]');
  41. console.log('[Bot] My username is: ' + engine.getUsername());
  42. console.log('[Bot] My starting balance: ' + (engine.getBalance() / SatoshiMultiplier).toFixed(2) + ' bits');
  43.  
  44. currentBet = baseSatoshi;
  45. highestBalance = engine.getBalance();
  46.  
  47. //When game starts we place our bet
  48. engine.on('game_starting', function(info) {
  49.  
  50. //if we already have played a game state our Profit
  51. if ( profit > (targetProfit) ) {
  52. console.log('[Bot] Target Profit reached: ' + profit );
  53. engine.stop();
  54. }
  55.  
  56.  
  57. //We don't have any funds left, therefore it makes no sense to bet... engine will be stopped
  58. if (engine.getBalance() < SatoshiMultiplier) {
  59. console.error('[Bot] Insufficent funds to do anything... stopping');
  60. engine.stop();
  61. }
  62.  
  63. //increase Loss Streak if enabled
  64. if (enableLossStreakProtection) {
  65. if (engine.lastGamePlay() == 'LOST' && playedGames > 0){
  66. currLoss++;
  67. }
  68. }
  69.  
  70. //is Bot currently cooled down due to a loss streak?
  71. if (enableLossStreakProtection) {
  72. if (currLoss >= maxLossStreak){
  73. cooledDown = true;
  74. console.log('[Bot] We are on a Loss Streak... Cooling down..');
  75. }
  76. if (cooledDown){
  77. if (currLoss == 0) {
  78. cooledDown = false;
  79. }else {
  80. currLoss--;
  81. console.log('[Bot] Secured your stake for another ' + currLoss + ' games');
  82. return;
  83. }
  84. }
  85. }
  86.  
  87.  
  88. //calculate the new bet
  89. if ( !(engine.lastGamePlay() == 'LOST') && playedGames > 0 )
  90. {
  91. currLoss = 0;
  92. //either multiply or add the basebet
  93. if (multiplyBet){
  94. currentBet *= betMultiplier;
  95. } else{
  96. currentBet += baseSatoshi;
  97. }
  98. if (highestBalance <= engine.getBalance() )
  99. {
  100. //use base bet according to OScars Grind systemLanguage
  101. currentBet = baseSatoshi;
  102. highestBalance = engine.getBalance();
  103. }
  104. }
  105. //check if maxumum betting amount is reached
  106. if (currentBet > maxBetSatoshi) {
  107. console.log('[Bot] Max amount bet bits reached...');
  108. if (stopMaxBet){
  109. console.log('[Bot] stopping Bot');
  110. engine.stop();
  111. }
  112. if (resetBet)
  113. {
  114. currentBet = baseSatoshi;
  115. } else {
  116. currentBet = maxBetSatoshi;
  117. }
  118. }
  119.  
  120. //check if currentBet is affordable
  121. if (currentBet > engine.getBalance() )
  122. {
  123. console.log('[Bot] Cannot afford ' + currentBet / SatoshiMultiplier + ' bits...');
  124. if (stopLowBalance){
  125. console.log('[Bot] Stop betting due to low balance');
  126. engine.stop();
  127. }
  128.  
  129. if ( baseSatoshi > engine.getBalance() ) {
  130. console.error('[Bot] Insufficent funds for intial bet... stopping');
  131. engine.stop();
  132. }
  133.  
  134. currentBet = baseSatoshi;
  135. }
  136.  
  137.  
  138.  
  139. //Place our bet
  140. engine.placeBet(currentBet, Math.round(targetMultiplier * 100), false);
  141. playedGames++;
  142.  
  143. });
  144.  
  145.  
  146. engine.on('game_crash', function(data) {
  147. if (playedGames > 0)
  148. {
  149. currentTime = new Date().getTime();
  150. timeRunning = currentTime - startTime;
  151. console.log('[Bot] Script running: ' + (timeRunning / 60000).toFixed(0) + ' minutes');
  152. profit = (engine.getBalance() - initialBalance) / SatoshiMultiplier;
  153. console.log('[Bot] Our Current Profit in bits: ' + profit );
  154. }
  155. });
Advertisement
Add Comment
Please, Sign In to add comment