Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var crashes = 0;
- var winnings = 0;
- var myBet = 0;
- const MULTIPLIER = 2; // increase bet on loss by 2
- const CASH_OUT = 250; // PERCENTAGE
- const CRASHES_UNTILL_START = 2;
- const BASE_BET = 1000 // Base bet IN SATOSHIES!!! (100 sats = 1 bit)
- engine.on('game_starting', function(info) {
- if(crashes > CRASHES_UNTILL_START - 2) {
- console.log('Game in '
- + info.time_till_start/1000 + ' sec. [ PLAYING ]');
- } else {
- console.log('NOT playing game in '
- + info.time_till_start/1000 + ' secs. [ NOT PLAYING ]');
- }
- console.log('Last game ' + engine.lastGamePlay());
- });
- engine.on('game_crash', function(data) {
- console.log('Game crashed at ', data.game_crash);
- if(data.game_crash < 250) {
- crashes++;
- if(crashes > CRASHES_UNTILL_START - 1) winnings -= myBet / 100;
- console.log("RED DETECTED: " + crashes)
- } else {
- crashes = 0;
- multiplier = 1;
- }
- if(crashes > CRASHES_UNTILL_START - 2) {
- // OLD CODE - THIS WAS MAKING ME MONEY!!!!
- // myBet = (crashes - CRASHES_UNTILL_START - 1) * 2 * 500;
- // BUT CHANGED IT TO BE RIGHT ANYWAY
- if(crashes - CRASHES_UNTILL_START === 1) { myBet = BASE_BET }
- else { myBet = myBet * MULTIPLIER }
- engine.placeBet(myBet, CASH_OUT, function(){
- console.log("Betting " + myBet / 100 + " bits.");
- });
- }
- });
- engine.on('cashed_out', function(resp) {
- if(resp.username === engine.getUsername()) {
- console.log('Cashed out ' + (myBet * MULTIPLIER / 100) / 100 + ' bits!');
- winnings += (myBet * (MULTIPLER-100) / 100 ) / 100;
- console.log("Total winnings: " + winnings)
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement