Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save savg110/7c7f5381c22997cb87d48c6e9e89c654 to your computer and use it in GitHub Desktop.
Save savg110/7c7f5381c22997cb87d48c6e9e89c654 to your computer and use it in GitHub Desktop.
Bustabit Chaser Strategy
/*CONFIGURABLE*/
var baseBet = 2;//This is your base bet, you can change it.
var crashOnNormalMode = 1.75;//This is what the bets will crash on in normal mode
var normalModeLostMultiply = 2;//Bet on normal mode will multiply by this when lost
var normalModeWinMultiply = 0.75;//Bet on normal mode will mutliply by this when wins
var chaserMultiplyOnLose = 1.3;//Bet will multiply by this in chaser mode on loss
var chasingCashOut = 7;//This is the cashout goal
var chaserAfterXGames = 7;//Chaser mode will occur after x amount of games that crash below chasingAmount
var returnToBaseBetOnWinOverX = 100;//If the script bets over x and wins, it will reset to the baseBet rather than multiply by 0.75
var lostAmountChasing = 1400;//If you lose this much balance chasing, it will try and chase something else
var losingChasingCash = 5;
var betInNormalMode = true;
//Reserve Feature
var reserveFeature = true;
var reserveAmountSatoshi = 400000;//Once your balance hits this in profit, it will reset. It will never use reserve money either
//---------------
/*DON'T CHANGE ANYTHING BELOW*/
var current_mode = 'normal';
var lastBet = baseBet*5;
var lostLast = false;
var gamesWaitedForChaser = 0;
var waitingCrash = 0.0;
var inReserve = 0;
var reserveStartBalanceSatoshi = engine.getBalance();//In satoshi
var startedChasingAmountSatoshi = 0;//In Satoshi
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('The game crashed at ' + actualCrash + ' while we were betting ' + lastBet + ' hoping for ' + waitingCrash);
if(waitingCrash < actualCrash){
console.log('We won');
lostLast = false;
}else{
lostLast = true;
console.log('We did not win');
}
//Reserve feature check
var currentProfit = engine.getBalance()-reserveStartBalanceSatoshi;
if(reserveFeature){
if(currentProfit >= reserveAmountSatoshi){
inReserve = inReserve+currentProfit;
console.log('Put current profit in reserve');
console.log('Reserve now has: ' + inReserve);
resetPlaying();
}
}
if(lostLast == false){
if(lastBet > returnToBaseBetOnWinOverX){
console.log('Restored bet due to winning over ' + returnToBaseBetOnWinOverX);
lastBet = baseBet;
}
}
if(actualCrash > chasingCashOut){
gamesWaitedForChaser = 0;
if(current_mode == 'chaser'){
console.log("Reverting from chaser to normal");
current_mode = 'normal';
lastBet = baseBet;
}
}else{
if(current_mode == 'normal'){
if(gamesWaitedForChaser == chaserAfterXGames){
console.log("Switching to chaser");
startedChasingAmountSatoshi = engine.getBalance();
//switch to chaser
current_mode = 'chaser';
gamesWaitedForChaser = 0;
}else{
gamesWaitedForChaser++;
}
}
}
console.log("So far it has been " + gamesWaitedForChaser + " games without " + chasingCashOut + "x");
});
function resetPlaying(){
lastBet = baseBet*5;
current_mode = 'normal';
lostLase = false;
gamesWaitedForChaser = 0;
waitingCrash = 0.0;
}
function runStart(){
if(current_mode == 'normal'){
if(betInNormalMode){
if(lostLast){
var newBet = Math.round(fixBet(lastBet*normalModeLostMultiply));
console.log("betting " + newBet);
waitingCrash = crashOnNormalMode;
bet(Math.round(newBet*100), Math.round(waitingCrash*100));
lastBet = newBet;
}else{
var newBet = Math.round(fixBet(lastBet*normalModeWinMultiply));
console.log("betting " + newBet);
waitingCrash = crashOnNormalMode;
bet(Math.round(newBet*100), Math.round(waitingCrash*100));
lastBet = newBet;
}
}
}else if(current_mode == 'chaser'){
var newBet = Math.round(fixBet(lastBet*chaserMultiplyOnLose));
console.log("chaser betting " + newBet);
var lostChasingSatoshi = startedChasingAmountSatoshi-engine.getBalance();
if(lostChasingSatoshi >= Math.round(lostAmountChasing*100)){
waitingCrash = losingChasingCash;//Safety
}else{
waitingCrash = chasingCashOut;
}
bet(Math.round(newBet*100), Math.round(waitingCrash*100));
lastBet = newBet;
}
console.log('Cash out: ' + chasingCashOut);
}
function bet(bet, crash){
if(reserveFeature){
var currentBalanceSatoshi = engine.getBalance();
var balanceAfterBet = (currentBalanceSatoshi-bet);
if(balanceAfterBet < inReserve){
throw new Error("We lost the money");
return;
}
}
engine.placeBet(bet, crash, false);
}
function fixBet(bet){
return (Math.round(bet * 100) / 100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment