Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.7 kB
2
Indexable
Never
// Configuration
var config = {
  baseBet: { value: 1, type: "balance", label: "Base Bet" },
  targetProfit: { value: 50, type: "balance", label: "Target Profit" },
  betAmountToWin: { value: 100, type: "balance", label: "Bet Amount to Win" },
  currentPayout: { value: 2, type: "multiplier", label: "Current Payout" }
};

// Initialize variables
var currentBet = config.baseBet.value;
var currentPayout = config.currentPayout.value;

// Main betting function
function main() {
    log("Betting " + currentBet + " bits with payout " + currentPayout);
    
    // Place bet
    var betId = engine.bet(currentBet, currentPayout);

    // Wait for the bet result
    engine.on('GAME_STARTING', function() {
        log("Game started. Waiting for result...");
    });

    engine.on('GAME_ENDED', function(data) {
        if (data.cashed_at) {
            log("Bet won!");
            var profit = currentBet * (currentPayout - 1);
            if (profit >= config.targetProfit.value || profit >= config.betAmountToWin.value) {
                log("Target profit or bet amount to win reached! Resetting.");
                currentBet = config.baseBet.value;
                currentPayout = config.currentPayout.value;
            } else {
                // Increase payout for the next bet
                currentPayout += 1;
            }
        } else {
            log("Bet lost. Doubling bet amount.");
            currentBet *= 2; // Double the bet amount

            // Reset payout for the next bet
            currentPayout = config.currentPayout.value;
        }

        main(); // Continue betting
    });
}

// Start the betting loop
main();
Leave a Comment