Coin Only High

You might also like

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 3

AI only place at high

var targetMultiplier = 4;

var minBetAmount = 10; // Minimum bet amount in bits

var maxBetAmount = 30; // Maximum bet amount in bits

var currentGameID = -1;

var gameHistory = [];

console.log('=====WIN=====');

console.log('My username is: ' + engine.getUsername());

engine.on('game_starting', function(info) {

console.log('\n====== New Game ======');

console.log('[Bot] Game #' + info.game_id);

currentGameID = info.game_id;

// Analyze game history to find optimal betting and cashout time

var { betTime, cashoutTime } = findOptimalBetAndCashoutTime(targetMultiplier);

if (betTime !== -1 && cashoutTime !== -1) {

var betAmount = getRandomBetAmount();

console.log('[Bot] Placing bet of ' + betAmount + ' bits at game tick ' + betTime + ', autocashout at
game tick ' + cashoutTime);

engine.placeBet(betAmount, Math.round(targetMultiplier * 100), true, cashoutTime);

} else {

console.log('[Bot] No suitable betting and cashout opportunity found.');

}
});

engine.on('game_started', function(data) {

console.log('[Bot] Game #' + currentGameID + ' has started!');

});

engine.on('cashed_out', function(data) {

if (data.username == engine.getUsername()) {

console.log('[Bot] Successfully cashed out at ' + (data.stopped_at / 100) + 'x');

});

engine.on('game_crash', function(data) {

console.log('[Bot] Game crashed at ' + (data.game_crash / 100) + 'x');

gameHistory.push({ multiplier: data.game_crash / 100 });

});

function getRandomBetAmount() {

return Math.floor(Math.random() * (maxBetAmount - minBetAmount + 1)) + minBetAmount;

function findOptimalBetAndCashoutTime(targetMultiplier) {

var bestBetTime = -1;

var bestCashoutTime = -1;


for (var i = 0; i < gameHistory.length; i++) {

if (gameHistory[i].multiplier >= targetMultiplier) {

bestBetTime = i + 1; // Add 1 to account for zero-based index

// Find the optimal cashout time by considering the game history after the bet

for (var j = bestBetTime; j < gameHistory.length; j++) {

if (gameHistory[j].multiplier <= 1.01) {

bestCashoutTime = j + 1; // Add 1 to account for zero-based index

break;

break;

return { betTime: bestBetTime, cashoutTime: bestCashoutTime };

You might also like