Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DocentSzachista/f1dad6e7462875ece9c80d75396a189f to your computer and use it in GitHub Desktop.
Save DocentSzachista/f1dad6e7462875ece9c80d75396a189f to your computer and use it in GitHub Desktop.
Klikadło do konkretnej strony
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description kliku kliku
// @author Docent
// @match https://www.sporcle.com/framed/*
// @run-at document-idle
// @grant none
// ==/UserScript==
const markQUiz = async () => {
const min = 1;
const max = 4;
const arr = [1,2,3,4];
for (let i = 0; i<10; i++){
await sleep(2000);
const ran = Math.floor(Math.random() * (max - min) + min);
const str = `box${ran}`;
console.log(str);
document.getElementById(str).click();
await sleep(2000);
}
};
const start = ()=>{
const button = document.getElementById("button-play").click();
//console.log(button.innerHTML);
};
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function flow(){
await sleep(2000);
console.log("Zaczynam");
start();
await sleep(5000);
markQUiz();
}
if(window.top === window.self){
console.log("112");
}
else{
console.log("234");
flow();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment