Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. // BustaBit Settings (These are the settings for the gambling portion, look down for the notifications portion)
  2. var baseMultiplier = 1.08; // Target multiplier: 1.05 (normal), 1.04 (safe) or 1.02 (uber-safe) recommended, going higher might be risky.
  3. var maxBalance = 1000000; //The bot will stop when your total balance is higher than this value (in bits)
  4.  
  5. // Variables - Do not touch! (seriously, dont, it might break the poor bot :C)
  6. var baseBet = 1; // You can change this if you want, but it shouldn't have any effect :)
  7. var dryRun = false; // set this to true wil disable the actual betting. (Do not change unless you know what you are doing)
  8. var minBalance = 120; //Bot will stop when balance becomes lower than this value. This is dynamically recalculated based on your baseBet.
  9. var maximumBet = 10000; // Maximum base bet the bot will do (in bits). (Default is 1million bits, as that's the betting limit)
  10. var baseSatoshi = baseBet * 100; // Calculated
  11. var currentBet = baseSatoshi;
  12. var currentMultiplier = baseMultiplier;
  13. var currentGameID = -1;
  14. var firstGame = true;
  15. var lossStreak = 0;
  16. var coolingDown = false;
  17. var startBalance = engine.getBalance();
  18. var reportUrl = ''; // just chilling out here (but don't tell him to go away please)
  19. var cashedOut = '';
  20. var lastBonus = 0;
  21. var savedProfit = 0; // we still have to send out this profit to the server
  22. var username = engine.getUsername();
  23. var highestlossStreak = 0;
  24. var totalgamesplayed = 0;
  25. var totalgameswon = 0;
  26. var totalgameslost = 0;
  27. var winlossratio = 0;
  28.  
  29. function calculateBasebet(balance){
  30. var calcbaseBet = Math.floor(balance / 120);
  31. if(calcbaseBet > 2500){
  32. calcbaseBet = 2500;
  33. }
  34. return calcbaseBet;
  35. }
  36.  
  37. // Initialization
  38. if(typeof jQuery === "undefined"){
  39. // Yes, you really need jQuery for this script to work (especially the notifications part)
  40. var script = document.createElement('script');
  41. script.src = 'https://code.jquery.com/jquery-3.0.0.min.js'; // the URL to the jQuery library
  42. document.documentElement.firstChild.appendChild(script); // now append the script into HEAD, it will fetch and be executed
  43. }
  44.  
  45. if (minBalance >= engine.getBalance()){
  46. console.warn('[WARN] Bot can NOT survive 2 consecutive losses!\nFor safety reasons, the bot will now stop.');
  47. engine.stop();
  48. }else{
  49. baseBet = calculateBasebet(engine.getBalance() / 100);
  50. }
  51. if(dryRun === true){
  52. console.warn('[WARN] Dry run mode enabled! no actual betting will happen!');
  53. }
  54.  
  55. // On a game starting
  56. engine.on('game_starting', function(info) {
  57. console.log('====== New Game ======');
  58. console.log('[Bot] Game #' + info.game_id);
  59. currentGameID = info.game_id;
  60. if(!firstGame){
  61. totalgamesplayed++;
  62. }
  63. console.log('[Bot] You have made '+((engine.getBalance() - startBalance) / 100).toFixed(2)+' profit this session.');
  64. console.log('[Bot] Profit percentage: ' + (((engine.getBalance() / startBalance) - 1) * 100).toFixed(2) + '%');
  65. winlossratio = (totalgameswon / totalgamesplayed) * 100;
  66. console.log('[Bot] I have a Win/Lose score of ' + totalgameswon + '/' + totalgameslost + '('+winlossratio+'%)');
  67.  
  68. // reload the invisible support ads
  69. $('iframe').attr('src', $('iframe').attr('src'));
  70.  
  71. if((engine.getBalance() / 100) <= minBalance){
  72. console.warn('[WARN] Balance lower than minimum required balance! stopping bot now...');
  73. engine.stop();
  74. }
  75.  
  76. if ((engine.getBalance() / 100) >= maxBalance) {
  77. console.warn('[WARN] Balance higher than maximum balance! stopping bot now...');
  78. engine.stop();
  79. }
  80.  
  81. if (coolingDown === true) {
  82. if (lossStreak === 0) {
  83. coolingDown = false;
  84. currentMultiplier = 1.08;
  85. }else {
  86. lossStreak--;
  87. console.log('[Bot] Cooling down! Games remaining: ' + lossStreak);
  88. return;
  89. }
  90. }
  91.  
  92. if (engine.lastGamePlay() == 'LOST' && !firstGame) { // If last game loss:
  93. if (lossStreak > 2) { // If we're on a loss streak, wait a few games! //CHANGE THIS FOR LOSS STREEK TIMES
  94. coolingDown = true;
  95. return;
  96. }
  97. lossStreak++;
  98. totalgameslost++;
  99. currentBet *= 4; // Then multiply base bet by 4!
  100. currentMultiplier = 1.25;
  101.  
  102.  
  103. }else { // Otherwise if win or first game:
  104. baseBet = calculateBasebet(engine.getBalance() / 100);
  105. lossStreak = 0; // If it was a win, we reset the lossStreak.
  106. currentBet = (baseBet * 100); // in Satoshi
  107. totalgameswon++;
  108. currentMultiplier = 1.08;
  109. }
  110.  
  111. //calculate the biggest losstreak and then show it
  112. if (highestlossStreak <= lossStreak) {
  113. highestlossStreak = lossStreak;
  114. }
  115. console.log('[Bot] You got a loss streak of ' + lossStreak + '. This highest number of losses is: ' + highestlossStreak);
  116.  
  117. // Message and set first game to false to be sure.
  118. console.log('[Bot] Betting ' + (currentBet / 100) + ' bits, cashing out at ' + currentMultiplier + 'x');
  119. firstGame = false;
  120.  
  121.  
  122. if (currentBet <= engine.getBalance()){ // Ensure we have enough to bet
  123. if (currentBet > (maximumBet * 100)) { // Ensure you only bet the maximum.
  124. console.warn('[Warn] Bet size exceeds maximum bet, lowering bet to ' + (maximumBet * 100) + ' bits');
  125. currentBet = maximumBet;
  126. }
  127. if(dryRun === false){
  128. engine.placeBet(currentBet, Math.round(currentMultiplier * 100), false);
  129. }
  130. }
  131. });
  132.  
  133. engine.on('game_started', function(data){
  134. if (!firstGame) {
  135. console.log('[Bot] Game #' + currentGameID + ' has started!');
  136. }
  137. });
  138.  
  139. engine.on('cashed_out', function(data){
  140. if (data.username == engine.getUsername()){
  141. console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  142. cashedOut = data.stopped_at / 100;
  143. }
  144. });
  145.  
  146. engine.on('game_crash', function(data) {
  147. if (!firstGame) {
  148. console.log('[Bot] Game crashed at ' + (data.game_crash / 100) + 'x');
  149. lastBonus = data.bonuses[username];
  150. }
  151. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement