Win micromatch in < 1 second!
当前为
// ==UserScript==
// @name Quizlet micromatch bot
// @namespace Danielv123
// @version 2.0
// @description Win micromatch in < 1 second!
// @author You
// @match https://quizlet.com/*/micro*
// @grant none
// ==/UserScript==
// this script died when microscatter turned into micromatch, but it still works albeit badly.
// edit: Version 2.0 fixed everything and its now able to get sub 0.5 second times!
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
// Magic for loop instead
// checks if the combination is right before clicking :)
for(i=0;i<document.getElementById("cells").childNodes.length;i++) {
// click it if its unclicked
if(document.getElementById("cells").childNodes[i].className == "cell long touching correct" || document.getElementById("cells").childNodes[i].className == "cell long touching touched"){
console.log("Already clicked " + i);
} else {
// find another word in the same dataset ID and click that as well
for(o=0;o<document.getElementById("cells").childNodes.length;o++) {
console.log("o = " + o );
if(document.getElementById("cells").childNodes[i] && document.getElementById("cells").childNodes[o]){
if(document.getElementById("cells").childNodes[i].dataset.id == document.getElementById("cells").childNodes[o].dataset.id) {
eventFire(document.querySelector("#cells").childNodes[o], "click");
eventFire(document.querySelector("#cells").childNodes[i], "click");
}
}
}
}
}
// brute force, they now penalize faults so this is shit
/*
setInterval(function() {
var dwfg = Math.floor(Math.random() * 16);
// console.log(document.getElementById("cells").childNodes[dwfg].getAttribute("data-type"));
if(document.getElementById("cells").childNodes[dwfg].className == "cell long touching correct" || document.getElementById("cells").childNodes[dwfg].className == "cell long touching touched"){
} else {
eventFire(document.querySelector("#cells").childNodes[dwfg], "click");
}
}, 1);
*/
setInterval(function() {
//eventFire(document.querySelector("body > div:nth-child(4) > div > div.UIModal.is-open > div > div > div.HighscoresMessage > div.UIDiv.HighscoresMessage-button > button"), "click");
}, 2000);