Created
November 13, 2025 22:35
-
-
Save mstrokin/1a78ee1c0f8d267c920bfecea8577e88 to your computer and use it in GitHub Desktop.
Keys.lol automation script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function automateWallets() { | |
| // Wait for wallet rows to exist with 30s timeout | |
| const walletPromise = new Promise((resolve) => { | |
| const checkWallets = () => { | |
| const wallets = document.querySelectorAll(".wallet"); | |
| if (wallets.length > 0) { | |
| resolve(); | |
| } else { | |
| setTimeout(checkWallets, 500); // Check every 500ms | |
| } | |
| }; | |
| checkWallets(); | |
| }); | |
| const walletTimeout = new Promise((resolve) => | |
| setTimeout(() => { | |
| console.log("Timeout waiting for wallet rows"); | |
| resolve(); | |
| }, 30000) | |
| ); | |
| await Promise.race([walletPromise, walletTimeout]); | |
| // If timed out, stop | |
| if (document.querySelectorAll(".wallet").length === 0) { | |
| console.log("No wallet rows found after timeout. Stopping."); | |
| return; | |
| } | |
| // Wait for no loading wallets with 30s timeout | |
| const loadingPromise = new Promise((resolve) => { | |
| const checkLoading = () => { | |
| const loadingWallets = document.querySelectorAll(".wallet.loading"); | |
| if (loadingWallets.length === 0) { | |
| resolve(); | |
| } else { | |
| setTimeout(checkLoading, 500); // Check every 500ms | |
| } | |
| }; | |
| checkLoading(); | |
| }); | |
| const loadingTimeout = new Promise((resolve) => | |
| setTimeout(() => { | |
| console.log("Timeout waiting for loading to finish"); | |
| resolve(); | |
| }, 30000) | |
| ); | |
| await Promise.race([loadingPromise, loadingTimeout]); | |
| // If timed out, stop | |
| if (document.querySelectorAll(".wallet.loading").length > 0) { | |
| console.log("Loading still in progress after timeout. Stopping."); | |
| return; | |
| } | |
| console.log("Loading complete. Checking empty wallets..."); | |
| // Check empty wallets | |
| const emptyWallets = document.querySelectorAll(".wallet.empty"); | |
| console.log(`Found ${emptyWallets.length} empty wallets.`); | |
| if (emptyWallets.length === 128) { | |
| console.log("Condition met. Navigating to random page."); | |
| const nextPageLink = document.querySelector('a[title="Random page"]'); | |
| if (nextPageLink) { | |
| nextPageLink.click(); | |
| } else { | |
| console.error("Random page link not found."); | |
| } | |
| } else { | |
| console.log("Condition not met. Empty wallets count:", emptyWallets.length); | |
| alert("fafa watafa"); | |
| } | |
| } | |
| // Run the script | |
| automateWallets(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment