Skip to content

Instantly share code, notes, and snippets.

@mstrokin
Created November 13, 2025 22:35
Show Gist options
  • Select an option

  • Save mstrokin/1a78ee1c0f8d267c920bfecea8577e88 to your computer and use it in GitHub Desktop.

Select an option

Save mstrokin/1a78ee1c0f8d267c920bfecea8577e88 to your computer and use it in GitHub Desktop.
Keys.lol automation script
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