Advertisement
leathan

BUSTABIT RED TO MARGINTALE STRAT

Oct 28th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var crashes = 0;
  2. var winnings = 0;
  3. var myBet = 0;
  4. const MULTIPLIER = 2; // increase bet on loss by 2
  5. const CASH_OUT = 250; // PERCENTAGE
  6. const CRASHES_UNTILL_START = 2;
  7. const BASE_BET = 1000 // Base bet IN SATOSHIES!!! (100 sats = 1 bit)
  8.  
  9. engine.on('game_starting', function(info) {
  10.     if(crashes > CRASHES_UNTILL_START - 2) {
  11.       console.log('Game in '
  12.       + info.time_till_start/1000 + ' sec. [ PLAYING ]');
  13.     } else {
  14.       console.log('NOT playing game in '
  15.       + info.time_till_start/1000 + ' secs. [ NOT PLAYING ]');
  16.     }
  17.     console.log('Last game ' + engine.lastGamePlay());
  18. });
  19. engine.on('game_crash', function(data) {
  20.     console.log('Game crashed at ', data.game_crash);
  21.     if(data.game_crash < 250) {
  22.       crashes++;
  23.        if(crashes > CRASHES_UNTILL_START - 1) winnings -= myBet / 100;
  24.       console.log("RED DETECTED: " + crashes)
  25.     } else {
  26.       crashes = 0;
  27.       multiplier = 1;
  28.     }
  29.     if(crashes > CRASHES_UNTILL_START - 2) {
  30.       // OLD CODE - THIS WAS MAKING ME MONEY!!!!
  31.       // myBet = (crashes - CRASHES_UNTILL_START - 1) * 2 * 500;
  32.       // BUT CHANGED IT TO BE RIGHT ANYWAY
  33.       if(crashes - CRASHES_UNTILL_START === 1)  { myBet = BASE_BET }
  34.       else { myBet = myBet * MULTIPLIER }
  35.       engine.placeBet(myBet, CASH_OUT, function(){
  36.         console.log("Betting " + myBet / 100 + " bits.");
  37.       });
  38.     }
  39. });
  40. engine.on('cashed_out', function(resp) {
  41.   if(resp.username === engine.getUsername()) {
  42.     console.log('Cashed out ' + (myBet * MULTIPLIER / 100) / 100 + ' bits!');
  43.     winnings +=  (myBet * (MULTIPLER-100) / 100 ) / 100;
  44.     console.log("Total winnings: " + winnings)
  45.  }
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement