Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.4 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) => {
    let clickedTiles = [];
    for (let i = 0; i < draw;) {
        let randomIndex = Math.floor(Math.random() * 25) + 1;
        if (!clickedTiles.includes(randomIndex)) {
            clickedTiles.push(randomIndex);
            await clickWithDelay(`.wrap button[data-test="mines-tile"]:nth-child(${randomIndex})`, delay);
            i++;
        }
    }
};

const main = async () => {
    while (true) {
        let btn = findButton();
        if (btn && btn.innerText === "Bet") {
            btn.click();
        } else {
            btn.click();
            await new Promise(resolve => setTimeout(resolve, 2000)); // Adding delay before retrying
            continue;
        }

        await simulateClicksWithDelay(3, 1000);

        btn = findButton();
        if (btn && btn.innerText === "Cashout") {
            btn.click();
        } else {
            await new Promise(resolve => setTimeout(resolve, 2000)); // Adding delay before retrying
            continue;
        }
    }
};

main();
Leave a Comment