Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.2 kB
3
Indexable
Never
const findButton = () => Array.from(document.querySelectorAll("span")).find(span => span.innerText === "Bet" || span.innerText === "Cashout");

const clickWithDelay = async (selector, delay) => {
    await new Promise(resolve => setTimeout(resolve, delay));
    document.querySelector(selector)?.click();
};

const simulateClicksWithDelay = async (draw, delay) => {
    const generatedNumbers = new Set();
    for (let i = 0; i < draw; ++i) {
        let randomNumber;
        do {
            randomNumber = Math.floor(Math.random() * 25) + 1;
        } while (generatedNumbers.has(randomNumber));
        generatedNumbers.add(randomNumber);
        await clickWithDelay(`.wrap button[data-test="mines-tile"]:nth-child(${randomNumber})`, delay);
        // Reduce delay after each click
        delay = Math.max(100, delay - 50);
    }
};

const mainLoop = async () => {
    while (true) {
        let btn = findButton();

        if (btn && btn.innerText === "Bet") {
            btn.click();
        }

        await simulateClicksWithDelay(10, 1000);

        btn = findButton();
        if (btn && btn.innerText === "Cashout") {
            btn.click();
        }
    }
};

mainLoop();
Leave a Comment