Advertisement
Guest User

Untitled

a guest
May 25th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. // Settings
  2. var usePercentageBalance = true;
  3. var percentageBalance = 0.01;
  4. var baseBet = 1; // In bits
  5. var maximumBet = 10000; // Maximum bet the bot will do (in bits).
  6.  
  7.  
  8. // Variables - Do not touch!
  9. var baseSatoshi = baseBet * 100; // Calculated
  10. var currentBet = baseSatoshi;
  11. var currentGameID = -1;
  12. var currentMult = 4;
  13. var firstGame = true;
  14. var lastStreak = true;
  15. var startBalance;
  16. var lastStreakBet = baseSatoshi;
  17. var dateStart = Date.now()
  18.  
  19. // Initialization
  20. console.log('====== Pacha\'s BustaBit Bot, made for Lautaro "mi pene de excursion en un jardin de infantes" Perea ======');
  21. console.log('User: ' + engine.getUsername());
  22. console.log('Balance: ' + (engine.getBalance() / 100).toFixed(2) + ' bits');
  23.  
  24. var startingBalance = engine.getBalance();
  25.  
  26. // On a game starting, place the bet.
  27. engine.on('game_starting', function(info) {
  28. console.log('====== New Game ======');
  29. console.log('[Bot] Game #' + info.game_id);
  30. currentGameID = info.game_id;
  31.  
  32. if (!firstGame) {
  33. console.log('[Stats] Session profit: ' + ((engine.getBalance() - startingBalance) / 100).toFixed(2) + ' bits');
  34. console.log('[Stats] Profit percentage: ' + (((engine.getBalance() / startingBalance) - 1) * 100).toFixed(2) + '%');
  35. }
  36. else
  37. {
  38. startBalance = engine.getBalance()
  39. }
  40.  
  41. var beforeLastStreak = lastStreak;
  42.  
  43. if (engine.lastGamePlay() == 'LOST') {
  44. lastStreak = false;
  45. currentMult--;
  46. }
  47. else {
  48. lastStreak = true;
  49. currentMult++;
  50. }
  51.  
  52.  
  53. var multiplier = 1.1;
  54. multiplier += currentMult / 10.0
  55.  
  56. currentBet = Math.round(engine.getBalance() * percentageBalance)
  57. if (!usePercentageBalance)
  58. {
  59. currentBet = baseSatoshi
  60. }
  61. currentBet -= currentBet % 100
  62. if (currentBet < 100) currentBet = 100;
  63.  
  64. // Message and set first game to false to be sure.
  65. console.log('[Bot] Betting ' + (currentBet / 100) + ' bits, cashing out at ' + multiplier + 'x');
  66. firstGame = false;
  67.  
  68. if ((engine.getBalance() - startBalance) > startBalance * 0.02)
  69. {
  70. startBalance = engine.getBalance()
  71. dateStart = Date.now();
  72. dateStart.setHours(dateStart.getHours() + 1)
  73. }
  74. if (currentBet <= engine.getBalance()) { // Ensure we have enough to bet
  75. if (currentBet > (maximumBet * 100)) { // Ensure you only bet the maximum.
  76. console.warn('[Warn] Bet size exceeds maximum bet' + maximumBet + ', capping.');//, lowering bet to ' + () + ' bits');
  77. currentBet = maximumBet * 100;
  78. }
  79.  
  80. if (Date.now() >= dateStart)
  81. {
  82. engine.placeBet(currentBet, Math.round(multiplier * 100), false);
  83. }
  84. }
  85. else { // Otherwise insufficent funds...
  86. if (engine.getBalance() < 100) {
  87. console.error('[Bot] Insufficent funds to do anything... stopping');
  88. engine.stop();
  89. }
  90. else {
  91. console.warn('[Bot] Insufficent funds to bet ' + (currentBet / 100) + ' bits. Stopping the bot');
  92. engine.stop();
  93. }
  94. }
  95. });
  96.  
  97. engine.on('game_started', function(data) {
  98. if (!firstGame) { console.log('[Bot] Game #' + currentGameID + ' has started!'); }
  99. });
  100.  
  101. engine.on('cashed_out', function(data) {
  102. if (data.username == engine.getUsername()) {
  103. console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  104. }
  105. });
  106.  
  107. engine.on('game_crash', function(data) {
  108. if (!firstGame) { console.log('[Bot] Game crashed at ' + (data.game_crash / 100) + 'x'); }
  109.  
  110. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement