Skip to content

Instantly share code, notes, and snippets.

@senechaux
Last active June 22, 2022 13:40
Embed
What would you like to do?
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