Bustabit but by Sviatoslav

Hii Guys,

So I’ve been playing on Bustabit a lot, and Sviatoslav asked me to create a bot for him to use on CS:GO-Crash.
I didn’t want to just make it for him, but I told him I would teach him how to make one.
He agreed, and so we build a bot together πŸ™‚

It has some english and russian combined, so don’t worry if you don’t know how to edit it πŸ™‚ (or use google translate)

Anyways, here is the bot:

/*
CS:GO-Crash Bot by Sviatoslav Polyakov, sorry for the Russian stuff, I'm to lazy to translate all the comments πŸ™‚
Parameter name are done by FinlayDaG33k, that's they are English.
Do not sell script! (it's against rules :C ) 

Simple rules apply:
- Do not sell script
- Give me beer when see me (I prefer good Stout)
- Give FinlayDaG33k hug when see him (he thought me the basics of making a script)
- If want donate to me (1LjASKhJfRWV5ia43MUKd1JnGczpz5KhtS), donate to FinlayDaG33k first (17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j)
- Don't claim script as your own
- If you improve script, make commit
- If I die, script is FinlayDaG33k's property (and pain in butt).
*/

//Pol'zovatel'skiye nastroyki
var baseBet = 2;//Eto vasha bazovaya stavka, vy mozhete izmenit' yego. - po umolchaniyu: 1
var crashOnNormalMode = 1.75;//Eto to, chto luchshe vsego budet vrezat'sya dal'she v normal'nom rezhime.  - po umolchaniyu: 1.75
var normalModeLostMultiply = 2;//Stavka na normal'nyy rezhim budet umnozhit' na eto, kogda poteryano.  - po umolchaniyu: 2
var normalModeWinMultiply = 0.75;//Stavka na normal'nyy rezhim budet umnozhit' na eto, kogda pobezhdayet.  - po umolchaniyu: 0.75
var chaserMultiplyOnLose = 1.1;//Stavka budet umnozhayem na eto v rezhime cheyzera na poteri.  - po umolchaniyu: 1.1
var chasingCashOut = 10;//Eto obnalichit' tsel'.  - po umolchaniyu: 10
var chaserAfterXGames = 13;//Rezhim Chase budet proiskhodit' posle togo, kak kh kolichestvo igr, chto avarii nizhe chekanka summa.  - po umolchaniyu: 13
var returnToBaseBetOnWinOverX = 199;//Yesli stsenariy stavok po kh i vyigryvayet, on budet sbroshen v baseBet, a ne umnozhit' na 0.75  - po umolchaniyu: 199


//Izmeneniye nizhe parametrov rekomenduyetsya tol'ko, yesli vy znayete, chto vy delayete...
var current_mode = 'normal';
var lastBet = baseBet*5;//My delayem eto tak, my ne imeyem medlenno nachat'.
var lostLast = false;
var gamesWaitedForChaser = 0;
var waitingCrash = 0.0;

engine.on('game_starting', function(info) {
    if(info.time_till_start == 5000){
      runStart();
    }
});

engine.on('game_crash', function(data) {
    var crash = data.game_crash;
    var actualCrash = parseFloat(crash/100);
    console.log('Igra razbilsya na ' + actualCrash + ' v to vremya kak my delali stavku ' + lastBet + ' nadeyas' na ' + waitingCrash);
    if(waitingCrash < actualCrash){
      console.log('We won');
      lostLast = false;
    }else{
      lostLast = true;
      console.log('My ne vyigrali');
    }
	
    if(lostLast == false){ // Yesli poslednyaya igra ne teryayetsya
      if(lastBet > returnToBaseBetOnWinOverX){
        console.log('Vosstanovlennaya stavku iz-za pobedy nad ' + returnToBaseBetOnWinOverX);
        lastBet = baseBet;
      }
    }
    if(actualCrash > chasingCashOut){
      gamesWaitedForChaser = 0;
      if(current_mode == 'chaser'){
        console.log("Otkat ot presledovatelya k normal'noy zhizni");
        current_mode = 'normal';
        lastBet = baseBet;
      }
    }else{
      if(current_mode == 'normal'){
        if(gamesWaitedForChaser == chaserAfterXGames){
          console.log("Switching to chaser");
          //switch to chaser
          current_mode = 'chaser';
          gamesWaitedForChaser = 0;
        }else{
          gamesWaitedForChaser++;
        }
      }
    }
    console.log("Do sikh por eto bylo " + gamesWaitedForChaser + " igry bez " + chasingCashOut + "x");
});

function runStart(){
  if(current_mode == 'normal'){
    if(lostLast){
      var newBet = Math.round(fixBet(lastBet*normalModeLostMultiply));
      console.log("betting " + newBet);
      waitingCrash = crashOnNormalMode;
      engine.placeBet(Math.round(newBet*100), Math.round(waitingCrash*100), false);
      lastBet = newBet;
    }else{
      var newBet = Math.round(fixBet(lastBet*normalModeWinMultiply));
      console.log("betting " + newBet);
      waitingCrash = crashOnNormalMode;
      engine.placeBet(Math.round(newBet*100), Math.round(waitingCrash*100), false);
      lastBet = newBet;
    }
  }else if(current_mode == 'chaser'){
    var newBet = Math.round(fixBet(lastBet*chaserMultiplyOnLose));
    console.log("Chaser stavki " + newBet);
    waitingCrash = chasingCashOut;
    engine.placeBet(Math.round(newBet*100), Math.round(waitingCrash*100), false);
    lastBet = newBet;
  }
  console.log('Obnalichit': ' + cashingCashOut);
}

function fixBet(bet){
  return (Math.round(bet * 100) / 100);
}

Please be nice and atleast follow the rules.

G33k Out

Leave a reply