Skip to content

Instantly share code, notes, and snippets.

@Lyken17
Created June 21, 2024 01:04
Show Gist options
  • Save Lyken17/0be5223b01030c2828579c20b973916b to your computer and use it in GitHub Desktop.
Save Lyken17/0be5223b01030c2828579c20b973916b to your computer and use it in GitHub Desktop.
color plate cheatcode
// https://www.shj.work/tools/secha/
// cheat code for the small color testing game
function processPlates() {
const d = {};
const plates = document.querySelectorAll("#box span");
plates.forEach(p => {
if (!(p.style.backgroundColor in d)) {
d[p.style.backgroundColor] = [];
}
d[p.style.backgroundColor].push(p);
});
for (const [key, value] of Object.entries(d)) {
if (value.length === 1) {
console.log("debug", value[0]);
value[0].style.backgroundColor = "red";
value[0].click();
}
}
}
for (let i = 1; i <= 100; i++) {
processPlates();
await new Promise(resolve => setTimeout(resolve, 500));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment