Guest User

op bustabit script

a guest
Oct 31st, 2019
1,969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.47 KB | None | 0 0
  1. var config = {};
  2. var initialized = false;
  3.  
  4. function patchFunctions(debugging = false) {
  5. if (!initialized) {
  6. engine.placeBet = function (bet, multiplier, callback) {
  7. engine.bet(bet, parseFloat(multiplier / 100));
  8. }
  9. engine.getMaxBet = function () {
  10. return userInfo.balance;
  11. }
  12. engine.getCurrentPayout = function () {
  13. return (engine.gameState != 'IN_PROGRESS' ? null : (engine.bust * 100));
  14. }
  15. engine.getBalance = function () {
  16. return userInfo.balance;
  17. }
  18. engine.getUsername = function () {
  19. return userInfo.uname;
  20. }
  21. engine.getEngine = function () {
  22. return engine;
  23. }
  24. engine.lastGamePlayed = function () {
  25. return (engine.lastGamePlay() != 'NOT_PLAYED' ? true : false);
  26. }
  27. engine.lastGamePlay = function () {
  28. let lastGame = engine.history.first();
  29. if (lastGame.wager) {
  30. if (lastGame.cashedAt) {
  31. return 'WON';
  32. }
  33. return 'LOST';
  34. }
  35. return 'NOT_PLAYED';
  36. }
  37. engine.stop = function (reason) {
  38. stop(reason);
  39. }
  40. engine.on('GAME_STARTING', function () {
  41. if (this._events['game_starting']) {
  42. if (debugging) { console.log(`[debug] Remit 'GAME_STARTING'->'game_starting' {game_id: ${engine.gameId}, time_till_start: 5000}`); }
  43. engine.emit('game_starting', { game_id: engine.gameId, time_till_start: 5000 });
  44. }
  45. });
  46. engine.on('GAME_STARTED', function () {
  47. if (this._events['game_started']) {
  48. if (debugging) { console.log(`[debug] Remit 'GAME_STARTED'->'game_started' {${engine.playing}}`); }
  49. engine.emit('game_started', engine.playing);
  50. }
  51. });
  52. engine.on('GAME_ENDED', function () {
  53. if (this._events['game_crash']) {
  54. let lastGame = engine.history.first();
  55. let elapsed = parseInt(lastGame.lastGameTick - lastGame.startTime);
  56. if (debugging) { console.log(`[debug] Remit 'GAME_ENDED'->'game_crash' {elapsed: ${elapsed}, game_crash: ${lastGame.bust}, bonuses: 0, hash: ${lastGame.hash}}`); }
  57. engine.emit('game_crash', { elapsed: elapsed, game_crash: (lastGame.bust * 100), bonuses: 0, hash: lastGame.hash });
  58. }
  59. });
  60. engine.on('CASHED_OUT', function (bet) {
  61. if (this._events['cashed_out']) {
  62. if (debugging) { console.log(`[debug] Remit 'CASHED_OUT'->'cashed_out' {username: ${bet.uname}, amount: ${bet.wager}, stopped_at: ${bet.cashedAt}}`); }
  63. engine.emit('cashed_out', { username: bet.uname, amount: bet.wager, stopped_at: (bet.cashedAt * 100) });
  64. }
  65. });
  66. engine.on('BET_PLACED', function (bet) {
  67. if (this._events['player_bet']) {
  68. if (debugging) { console.log(`[debug] Remit 'BET_PLACED'->'player_bet' {username: ${bet.uname}, bet: ${bet.wager}`); }
  69. engine.emit('player_bet', { username: bet.uname, bet: bet.wager });
  70. }
  71. });
  72. initialized = true;
  73. }
  74. }
  75. patchFunctions();
  76.  
  77.  
  78. var baseBet = 1; // bet size awal (bits)
  79. var baseMultiplier = 2; // base cashout
  80. var stopAtProfit = 50;
  81. var maxbalance = 5000;
  82. // ===================== MARTINGALE SYSTEM ========================
  83. var inc_on_lost = 30; // increase bet (%) tiap kalah
  84. var inc_on_win = -70; // increase bet (%) tiap menang
  85. var inc_every_lost = 1; // increase bet tiap kalah x strake
  86. var inc_every_win = 2; // increase bet tiap kalah x strake
  87.  
  88. // ===================== END LINE MARTINGALE SYSTEM ========================
  89.  
  90. var currentGameID = -1;
  91. var firstgame = true;
  92. var cashout_multipler = baseMultiplier;
  93. var baseSatoshi = baseBet * 100;
  94. var currentBet = baseSatoshi;
  95. var currentMultiplier = baseMultiplier;
  96. var realCurrentBet = baseSatoshi;
  97. var lastBet = 0;
  98. var stopAtProfit = 50;
  99. var winStrake = 5;
  100. var loseStrake = 0;
  101.  
  102. engine.on('game_starting', function(info) {
  103. currentGameID = info.game_id;
  104. cashout_multipler = baseMultiplier;
  105.  
  106. if(!firstgame){
  107. console.log("=============== New Game #"+currentGameID+" ===============");
  108. }
  109.  
  110. if (engine.lastGamePlay() == 'LOST' && !firstgame) { // If last game loss:
  111. winStrake = 0;
  112. loseStrake++;
  113.  
  114. if(inc_on_lost == 0){
  115. currentBet = baseSatoshi;
  116. currentMultiplier = baseMultiplier;
  117. realCurrentBet = baseSatoshi;
  118. }else if(loseStrake > 0 && loseStrake % inc_every_lost == 0){
  119. realCurrentBet = (realCurrentBet * (inc_on_lost/100))+realCurrentBet;
  120. currentBet = (Math.floor((realCurrentBet) / 100)) * 100;
  121.  
  122. if(currentBet < baseSatoshi){
  123. currentBet = baseSatoshi;
  124. }
  125.  
  126. currentMultiplier = baseMultiplier;
  127. }
  128.  
  129. }else if(!firstgame){
  130. loseStrake = 0;
  131. winStrake++;
  132.  
  133. if(winStrake > 0 && winStrake % inc_every_win == 0){
  134. realCurrentBet = (realCurrentBet * (inc_on_win/100))+realCurrentBet;
  135. currentBet = (Math.floor((realCurrentBet) / 100)) * 100;
  136.  
  137. if(currentBet < baseSatoshi){
  138. currentBet = baseSatoshi;
  139. realCurrentBet = currentBet;
  140. }
  141.  
  142. currentMultiplier = baseMultiplier;
  143. }
  144. }
  145.  
  146. console.log(winStrake,loseStrake,currentBet, realCurrentBet);
  147.  
  148. if(currentBet > (engine.getBalance() / 2)){
  149. console.log("[Stop] Strategy stop out of balance");
  150. engine.stop();
  151. return;
  152. }
  153.  
  154. engine.placeBet(currentBet, Math.round(currentMultiplier * 100), function(){
  155. console.log("[Bot] Betting "+(currentBet/100)+" bits on x"+currentMultiplier);
  156. lastBet = currentBet;
  157. });
  158. });
  159.  
  160. engine.on('game_started', function(data) {
  161.  
  162. });
  163.  
  164. var already_cashed_out = false;
  165. engine.on('cashed_out', function(data) {
  166. if(data.username==engine.getUsername()){
  167. cashout_multipler = data.stopped_at/100;
  168. already_cashed_out = true;
  169. }
  170. });
  171.  
  172. engine.on('game_crash', function(data) {
  173.  
  174. already_cashed_out = false;
  175. if(firstgame) firstgame = false;
  176. });
Advertisement
Add Comment
Please, Sign In to add comment