// This script will bet your whole balance at 1,02x every random 40-100 games.
//
// There's still a risk of losing when doing it, so be careful.
//
//
// Good luck earning! :)
// ------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------
var Multiplier = 1.02; // At what multiplier should it cash out?
var MinBreakDuration = 40; // Minimum duration of the skip games.
var MaxBreakDuration = 100; // Maximum duration of the skip games.
// ------------------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
// The Code
// ------------------------------------------------------------------------------------------
var Username = engine.getUsername();
var StartBalance = engine.getBalance();
var CurrentGameID = -1;
var CurrentBet = 0;
var CurrentMultiplier = Multiplier;
var d = new Date();
var StartTime = d.getTime();
var randomBreak = randomNumber(MinBreakDuration, MaxBreakDuration);
console.log('Welcome ' + Username);
console.log('Your start ballance is: ' + (StartBalance / 100).toFixed(2) + ' bits');
if (Multiplier < 1) {
console.log('Your multiplier must be 1.0 or higher.');
engine.stop();
}
engine.on('game_starting', function(info) {
CurrentGameID = info.game_id;
console.log('---------------------');
console.log('Game #' + CurrentGameID + ' started.');
CurrentBet = Math.floor(engine.getBalance().toFixed(2) / 100);
//check if current bet is 0 or negative
if (CurrentBet < 1) {
CurrentBet = 1;
}
if (CurrentBet <= engine.getBalance()) { // Check if the balance is high enough to place the bet.
if (randomBreak == 0) {
console.log('Betting ' + (CurrentBet) + ' bits, cashing out at ' + CurrentMultiplier + 'x');
randomBreak = randomNumber(MinBreakDuration, MaxBreakDuration);
engine.placeBet(CurrentBet * 100, Math.round(CurrentMultiplier * 100), false);
} else {
console.log('Bot is taking a break for ' + randomBreak + ' more games.');
randomBreak--;
}
} else { // Not enough balance to place the bet.
console.error('Your account balance is to low to place a bet.... The bot will close now.');
engine.stop();
}
});
engine.on('cashed_out', function(data) {
if (data.username == engine.getUsername()) {
console.log('Successfully cashed out at ' + (data.stopped_at / 100) + 'x');
}
});
engine.on('game_crash', function(data) {
var newdate = new Date();
var timeplaying = ((newdate.getTime() - StartTime) / 1000) / 60;
console.log('Game crashed at ' + (data.game_crash / 100) + 'x');
console.log('Session profit: ' + ((engine.getBalance() - StartBalance) / 100).toFixed(2) + ' bits in ' + Math.round(timeplaying) + ' minutes.');
});
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}