Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bets = [1, 3];
- var cashOut = 1.50;
- var maxLosses = 1000;
- //-----------------------------------------------------------
- var x = 0;
- for (x=2;x<40;x+=2){
- bets[x] = bets[x-2]*2;
- bets[x+1] = bets[x-1]*2;
- }
- x = 0
- var currentBet = bets[x];
- var betting = true;
- var wins = 0;
- var cl = 1;
- var startBR = engine.getBalance();
- var currentBR = startBR;
- var sessionBR = startBR;
- //-----------------------------------------------------------
- engine.on('game_starting', function(info) {
- currentBR = engine.getBalance()
- if (engine.lastGamePlay() == "LOST") {
- if (x % 2 != 0) {
- betting = false;
- wins = 0;
- console.log('Paused betting');
- console.log('Moving to the next betting level.');
- console.log('Waiting for', cashOut+'x game.');
- }
- x++;
- }
- else{
- if (engine.lastGamePlay() == "WON") {
- wins++;
- if (x % 2 != 0 && wins < 4){
- x--;
- }else{
- if (wins >= 4){
- if (x % 2 == 0) {
- x-=2;
- }else{
- x-=3;
- }
- wins = 0;
- }
- }
- if (x <= 0){x=0; wins=1;}
- if (currentBR >= startBR){startBR=currentBR;}
- }
- }
- if (x == 0 || x == 1){
- cl = 1;
- }else{
- if (x % 2 == 0 ){
- cl = (x/2)+1;
- }else{
- cl = Math.round(x/2);
- }
- }
- console.log('Wins in betting level',cl+' =', wins);
- currentBet = bets[x];
- if (betting) {
- engine.placeBet(Math.round(currentBet)*100, Math.round(cashOut*100));
- console.log('Placing bet of', Math.round(currentBet), 'at', Math.round(cashOut*100)/100+"x");
- }
- });
- engine.on('game_crash', function(data) {
- currentBR = engine.getBalance();
- if (!betting && data.game_crash/100 >= cashOut){
- betting = true;
- }
- console.clear();
- console.log(' ');
- console.log('Current profit/losses =', Math.round(currentBR-startBR)/100);
- console.log('Session Profit/Losses =', Math.round(currentBR - sessionBR)/100);
- if ((startBR-currentBR)/100 >= maxLosses){
- console.log('We have lost too much. Stopping script.');
- engine.stop();
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement