Procon's BustaBit


SUBMITTED BY: bakhajan

DATE: Sept. 15, 2016, 9:12 a.m.

FORMAT: Text only

SIZE: 8.0 kB

HITS: 583

  1. * Procon's BustaBit Bot
  2. *
  3. * This version includes some (disabled by default) experiments.
  4. * Enabling 'useCrashAverage' will allow the script to try to determine a trend.
  5. * It will raise the multiplier accordingly.
  6. * The bot will take 4 rounds to generate the average, then, adjust it per game afterwards.
  7. *
  8. * Like the script? Consider donating me a few bits! :)
  9. *
  10. * Disclaimer: All rights are reserved for the original creator of this script.
  11. */
  12. // Settings
  13. var baseBet = 10;
  14. // In bits
  15. var baseMultiplier = 1.25;
  16. // Target multiplier: 1.13 recommended
  17. var variableBase = true;
  18. // Enable variable mode (very experimental), read streakSecurity.
  19. var streakSecurity = 7;
  20. // Number of loss-streak you wanna be safe for. Increasing this massively reduces the variableBase calculated. (1-loss = 20%, 2-loss = 5%, 3-loss = 1.25% of your maximum balance). Recommended: 2+
  21. var maximumBet = 999999;
  22. // Maximum bet the bot will do (in bits).
  23. var percentageOfTotal = 100;
  24. // Percentage of total balance to use when max loss is hit. (100 = 100%)
  25. var useCrashAverage = true;
  26. // Enable editing current multiplier based on past 4 crash average. (Experimental!)
  27. var highAverage = 1.30;
  28. // Average multiplier to use the highAverageMultiplier.
  29. var highAverageMultiplier = 1.20;
  30. // Multiplier to use when crash average is above highAverage.
  31. var BustaBit = true;
  32. // Enable when using BustaBit, disable when using CS:GO Crash. (Changed how the script grabs your username)
  33. // Variables - Do not touch!
  34. var baseSatoshi = baseBet * 100; // Calculated
  35. var currentBet = baseSatoshi;
  36. var currentMultiplier = baseMultiplier;
  37. var currentGameID = -1;
  38. var firstGame = true;
  39. var lossStreak = 0;
  40. var coolingDown = false;
  41. var d = new Date();
  42. var startTime = d.getTime();
  43. var takingBreak = false;
  44. var takeBreaks = false; // Broken, disabled
  45. var lowAverage = 1.45;
  46. var tempCrash;
  47. var gameAverage;
  48. var currentGame = 0;
  49. var game1;
  50. var game2;
  51. var game3;
  52. var game4;
  53. // Initialization
  54. console.log('====== Procon\'s BustaBit Bot ======');
  55. console.log('====== Re-coded by CurtisVL ======');
  56. if(BustaBit == true){
  57. console.log('My username is: ' + engine.getUsername());
  58. }
  59. else{
  60. console.log('My username is: ' + engine.getSteamID());
  61. }
  62. console.log('Starting balance: ' + (engine.getBalance() / 100).toFixed(2) + ' bits');
  63. var startingBalance = engine.getBalance();
  64. if (variableBase) {
  65. console.warn('[WARN] Variable mode is enabled and not fully tested. Bot is resillient to ' + streakSecurity + '-loss streaks.');
  66. }
  67. // On a game starting, place the bet.
  68. engine.on('game_starting', function(info) {
  69. console.log('====== New Game ======');
  70. console.log('[Bot] Game #' + info.game_id);
  71. currentGameID = info.game_id;
  72. if(game4 != null && useCrashAverage == true){
  73. gameAverage = (((game1 + game2) + (game3 + game4)) / 4);
  74. console.log("[Bot] Average crash: " + gameAverage + "x");
  75. }
  76. else{
  77. gameAverage = 0;
  78. }
  79. if (coolingDown) {
  80. if (lossStreak == 0) {
  81. coolingDown = false;
  82. }
  83. else {
  84. lossStreak--;
  85. console.log('[Bot] Cooling down! Games remaining: ' + lossStreak);
  86. return;
  87. }
  88. }
  89. if(gameAverage <= lowAverage && takeBreaks == true && game4 != null){
  90. takingBreak = true;
  91. console.log("Too low average. Taking a break this round!");
  92. }
  93. else{
  94. takingBreak = false;
  95. }
  96. if (!firstGame) { // Display data only after first game played.
  97. console.log('[Stats] Session profit: ' + ((engine.getBalance() - startingBalance) / 100).toFixed(2) + ' bits in '+ Math.round(timeplaying) + ' minutes.');
  98. console.log('[Stats] Profit percentage: ' + (((engine.getBalance() / startingBalance) - 1) * 100).toFixed(2) + '%');
  99. }
  100. if(firstGame == true){
  101. newdate = new Date();
  102. timeplaying = ((newdate.getTime() - startTime) / 1000) / 60;
  103. }
  104. if (engine.lastGamePlay() == 'LOST' && !firstGame && takingBreak == false) { // If last game loss:
  105. lossStreak++;
  106. var totalLosses = 0; // Total satoshi lost.
  107. var lastLoss = currentBet; // Store our last bet.
  108. while (lastLoss >= baseSatoshi) { // Until we get down to base bet, add the previous losses.
  109. totalLosses += lastLoss;
  110. lastLoss /= 4;
  111. }
  112. if (lossStreak > streakSecurity) { // If we're on a loss streak, wait a few games!
  113. coolingDown = true;
  114. return;
  115. }
  116. currentBet *= 4; // Then multiply base bet by 4!
  117. currentMultiplier = 1 + (totalLosses / currentBet);
  118. }
  119. else { // Otherwise if win or first game:
  120. lossStreak = 0; // If it was a win, we reset the lossStreak.
  121. if (variableBase) { // If variable bet enabled.
  122. // Variable mode resists (currently) 1 loss, by making sure you have enough to cover the base and the 4x base bet.
  123. var divider = 100;
  124. for (i = 0; i < streakSecurity; i++) {
  125. divider += (100 * Math.pow(4, (i + 1)));
  126. }
  127. newBaseBet = Math.min(Math.max(1, Math.floor((percentageOfTotal/100) * engine.getBalance() / divider)), maximumBet * 100); // In bits
  128. newBaseSatoshi = newBaseBet * 100;
  129. if ((newBaseBet != baseBet) || (newBaseBet == 1)) {
  130. console.log('[Bot] Variable mode has changed base bet to: ' + newBaseBet + ' bits');
  131. baseBet = newBaseBet;
  132. baseSatoshi = newBaseSatoshi;
  133. }
  134. }
  135. currentMultiplier = baseMultiplier;
  136. if(lossStreak == 0 && useCrashAverage == true && gameAverage != 0){
  137. if(gameAverage < highAverage){
  138. currentMultiplier = baseMultiplier;
  139. }
  140. if(gameAverage >= highAverage){
  141. currentMultiplier = highAverageMultiplier;
  142. }
  143. }
  144. // Update bet.
  145. currentBet = baseSatoshi; // in Satoshi
  146. }
  147. // Message and set first game to false to be sure.
  148. console.log('[Bot] Betting ' + (currentBet / 100) + ' bits, cashing out at ' + currentMultiplier + 'x');
  149. firstGame = false;
  150. if (currentBet <= engine.getBalance() && takingBreak == false) { // Ensure we have enough to bet
  151. if (currentBet > (maximumBet * 100)) { // Ensure you only bet the maximum.
  152. console.warn('[Warn] Bet size exceeds maximum bet, lowering bet to ' + (maximumBet * 100) + ' bits');
  153. currentBet = maximumBet;
  154. }
  155. engine.placeBet(currentBet, Math.round(currentMultiplier * 100), false);
  156. }
  157. else { // Otherwise insufficent funds...
  158. if (engine.getBalance() < 100) {
  159. console.error('[Bot] Insufficent funds to do anything... stopping');
  160. engine.stop();
  161. }
  162. else {
  163. console.warn('[Bot] Insufficent funds to bet ' + (currentBet / 100) + ' bits.');
  164. console.warn('[Bot] Resetting to 1 bit basebet');
  165. baseBet = 1;
  166. baseSatoshi = 100;
  167. }
  168. }
  169. });
  170. //Game Started
  171. engine.on('game_started', function(data) {
  172. if (!firstGame) { console.log('[Bot] Game #' + currentGameID + ' has started!'); }
  173. });
  174. //Cashed Out
  175. engine.on('cashed_out', function(data) {
  176. if(BustaBit == true){
  177. if (data.username == engine.getUsername()) {
  178. console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  179. }
  180. }
  181. });
  182. //Game Crash
  183. engine.on('game_crash', function(data) {
  184. if(BustaBit == false){
  185. if (data.username == engine.getSteamID()) {
  186. console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
  187. }
  188. }
  189. if (!firstGame) { console.log('[Bot] Game crashed at ' + (data.game_crash / 100) + 'x'); }
  190. newdate = new Date();
  191. timeplaying = ((newdate.getTime() - startTime) / 1000) / 60;
  192. currentGame++;
  193. tempCrash = (data.game_crash / 100);
  194. if (tempCrash >= 2.0){
  195. tempCrash = 2.0;
  196. }
  197. if (currentGame == 1){
  198. game1 = tempCrash;
  199. }
  200. else if(currentGame == 2){
  201. game2 = tempCrash;
  202. }
  203. else if(currentGame == 3){
  204. game3 = tempCrash;
  205. }
  206. else if(currentGame == 4){
  207. game4 = tempCrash;
  208. }
  209. else if(currentGame >= 5){
  210. currentGame = 1;
  211. game1 = tempCrash;
  212. }
  213. });

comments powered by Disqus