Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.27 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. //var checkjayhunter = false;
  29.  
  30. function calculateBasebet(balance){
  31. var calcbaseBet = Math.floor(balance / 120);
  32. if(calcbaseBet > 2500){
  33. calcbaseBet = 2500;
  34. }
  35. return calcbaseBet;
  36. }
  37.  
  38. // Initialization
  39. if(typeof jQuery === "undefined"){
  40. // Yes, you really need jQuery for this script to work (especially the notifications part)
  41. var script = document.createElement('script');
  42. script.src = 'https://code.jquery.com/jquery-3.0.0.min.js'; // the URL to the jQuery library
  43. document.documentElement.firstChild.appendChild(script) // now append the script into HEAD, it will fetch and be executed
  44. }
  45.  
  46. if (minBalance >= engine.getBalance()){
  47. console.warn('[WARN] Bot can NOT survive 2 consecutive losses!\nFor safety reasons, the bot will now stop.');
  48. engine.stop();
  49. }else{
  50. baseBet = calculateBasebet(engine.getBalance() / 100);
  51. }
  52. if(dryRun === true){
  53. console.warn('[WARN] Dry run mode enabled! no actual betting will happen!');
  54. }
  55.  
  56. // On a game starting
  57. engine.on('game_starting', function(info) {
  58. console.log('====== New Game ======');
  59. console.log('[Bot] Game #' + info.game_id);
  60. currentGameID = info.game_id;
  61. if(!firstGame){
  62. totalgamesplayed++;
  63. }
  64. console.log('[Bot] You have made '+((engine.getBalance() - startBalance) / 100).toFixed(2)+' profit this session.');
  65. console.log('[Bot] Profit percentage: ' + (((engine.getBalance() / startBalance) - 1) * 100).toFixed(2) + '%');
  66. winlossratio = (totalgameswon / totalgamesplayed) * 100;
  67. console.log('[Bot] I have a Win/Lose score of ' + totalgameswon + '/' + totalgameslost + '('+winlossratio+'%)');
  68.  
  69. // reload the invisible support ads
  70. $('iframe').attr('src', $('iframe').attr('src'));
  71.  
  72. if((engine.getBalance() / 100) <= minBalance){
  73. console.warn('[WARN] Balance lower than minimum required balance! stopping bot now...');
  74. engine.stop();
  75. }
  76.  
  77. if ((engine.getBalance() / 100) >= maxBalance) {
  78. console.warn('[WARN] Balance higher than maximum balance! stopping bot now...');
  79. engine.stop();
  80. }
  81.  
  82. if (coolingDown === true) {
  83. if (lossStreak === 0) {
  84. coolingDown = false;
  85. currentMultiplier = 1.08;
  86. }else {
  87. lossStreak--;
  88. console.log('[Bot] Cooling down! Games remaining: ' + lossStreak);
  89. return;
  90. }
  91. }
  92.  
  93. if (engine.lastGamePlay() === 'LOST' && !firstGame) { // If last game loss:
  94. if (lossStreak > 1) { // If we're on a loss streak, wait a few games! //CHANGE THIS FOR LOSS STREEK TIMES
  95. coolingDown = true;
  96. return;
  97. }
  98. currentBet *= 4; // Then multiply base bet by 4!
  99. lossStreak++;
  100. totalgameslost++;
  101. currentMultiplier = 1.25;
  102. if (lossStreak > 0) { // If we're on a loss streak, wait a few games! //CHANGE THIS FOR LOSS STREEK TIMES
  103. currentBet *= 1.25;
  104. }
  105. }else { // Otherwise if win or first game:
  106. baseBet = calculateBasebet(engine.getBalance() / 100);
  107. lossStreak = 0; // If it was a win, we reset the lossStreak.
  108. currentBet = (baseBet * 100); // in Satoshi
  109. totalgameswon++;
  110. currentMultiplier = 1.08;
  111.  
  112. }
  113.  
  114. //calculate the biggest losstreak and then show it
  115. if (highestlossStreak <= lossStreak) {
  116. highestlossStreak = lossStreak;
  117. }
  118. console.log('[Bot] You got a loss streak of ' + lossStreak + '. This highest number of losses is: ' + highestlossStreak);
  119.  
  120. // Message and set first game to false to be sure.
  121. console.log('[Bot] Betting ' + (currentBet / 100) + ' bits, cashing out at ' + currentMultiplier + 'x');
  122. firstGame = false;
  123.  
  124.  
  125. if (currentBet <= engine.getBalance()){ // Ensure we have enough to bet
  126. if (currentBet > (maximumBet * 100)) { // Ensure you only bet the maximum.
  127. console.warn('[Warn] Bet size exceeds maximum bet, lowering bet to ' + (maximumBet * 100) + ' bits');
  128. currentBet = maximumBet;
  129. }
  130. if(dryRun === false){
  131. engine.placeBet(currentBet, Math.round(currentMultiplier * 100), false);
  132. }
  133. }
  134. });
  135.  
  136. engine.on('game_started', function(data){
  137. if (!firstGame) {
  138. console.log('[Bot] Game #' + currentGameID + ' has started!');
  139. }
  140. });
  141.  
  142. engine.on('cashed_out', function(data){
  143. if (data.username == engine.getUsername()){
  144. console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  145. cashedOut = data.stopped_at / 100;
  146. }
  147. });
  148.  
  149. engine.on('game_crash', function(data) {
  150. if (!firstGame) {
  151. console.log('[Bot] Game crashed at ' + (data.game_crash / 100) + 'x');
  152. lastBonus = data.bonuses[username];
  153. }
  154. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement