Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.3 kB
0
Indexable
Never
javascript:(function() {
    // Fonksiyonlar
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    async function clickBuilding() {
        const buildingLink = document.querySelector('.village.buildingView');
        if (buildingLink) {
            buildingLink.click();
            await sleep(2000);
            clickMilitaryBase();
        }
    }

    async function clickMilitaryBase() {
        const militaryBaseLink = document.querySelector('.buildingSlot.a39.g16.aid39.hun a.level.colorLayer.notNow.aid39.hun');
        if (militaryBaseLink) {
            militaryBaseLink.click();
            await sleep(2000);
            clickButton();
        } else {
            console.error("Military base link not found!");
        }
    }

    async function clickButton() {
        const button = document.querySelector('.textButtonV2.buttonFramed.startFarmList.rectangle.withText.green');
        if (button) {
            button.click();
        } else {
            console.error("Button not found!");
        }
    }

    // Ana işlem
    async function main() {
        await clickBuilding();
    }

    // Ana işlemi belirtilen süre aralıklarıyla tekrar et
    setInterval(main, 240000); // 4 dakika (4 dakikada bir)
})();
Leave a Comment