Skip to content

Instantly share code, notes, and snippets.

@senechaux
Last active June 22, 2022 13:40
Show Gist options
  • Save senechaux/6e55f0957b2b50e80e3df6e9b1da4cb5 to your computer and use it in GitHub Desktop.
Save senechaux/6e55f0957b2b50e80e3df6e9b1da4cb5 to your computer and use it in GitHub Desktop.
Script wordle para adivinar palabras
let numberOfWordsToGuess = 10;
let guessedWords = new Array();
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const guessWords = async () => {
const intentos = [1, 2, 3, 4, 5, 6];
const word = 'reino';
for (const intento of intentos) {
const letters = Array.from(word);
for (const letter of letters) {
$(".chakra-button[aria-label="+letter+"]").click();
await sleep(10);
}
$(".chakra-button[aria-label^=procesar]").click();
await sleep(10);
}
await sleep(1300);
setTimeout(() => {
guessedWords.push($(".Toastify").textContent);
console.log(`${guessedWords.length} words guessed`);
console.log('const words=["'+guessedWords.join('","')+'"];')
}, 2000);
numberOfWordsToGuess--;
(numberOfWordsToGuess > 0) && guessWords();
};
guessWords();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment