Skip to content

Instantly share code, notes, and snippets.

@PatheticMustan
Created March 5, 2024 23:46
Show Gist options
  • Save PatheticMustan/e45382134b4de1717f911a638c2b8d82 to your computer and use it in GitHub Desktop.
Save PatheticMustan/e45382134b4de1717f911a638c2b8d82 to your computer and use it in GitHub Desktop.
const items = document.getElementsByClassName("mobile-items")[0];
function match(a, b) {
items.children[a].firstChild.click();
items.children[b].firstChild.click();
}
function matchAllTo(a) {
queue = queue.concat(new Array(items.children.length).fill(0).map((v, i) => [a, i]));
}
let queue = [];
let interval = setInterval(() => {
if (queue.length > 0) {
const item = queue.shift();
match(item[0], item[1]);
}
}, 200);
let i=0;
// to do crazy matching, do
matchAllTo(i++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment