-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
20 lines (20 loc) · 787 Bytes
/
test.js
File metadata and controls
20 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
let createGame = document.getElementsByClassName("m_77c9d27d")[1];
let currentGames = document.getElementsByClassName("m_e615b15f");
let playerName = document.getElementsByClassName("m_b6d8b162")[9].innerText;
while (!createGame.disabled) {
await new Promise((r) => setTimeout(r, 650));
createGame.click();
await new Promise((r) => setTimeout(r, 750));
Array.from(currentGames).forEach((game) => {
if (
game.innerText !== undefined &&
game.innerText.includes(playerName) &&
game.childNodes[2]?.childNodes[0]?.childNodes[8]?.childNodes[1]?.childNodes[0]?.hasChildNodes()
) {
console.log(currentGames);
setTimeout(() => {
game.childNodes[2].childNodes[0].childNodes[8].childNodes[1].childNodes[0].click();
}, 500);
}
});
}