Skip to content

Instantly share code, notes, and snippets.

@aashutoshrathi
Created January 1, 2018 15:07
Show Gist options
  • Save aashutoshrathi/d14be6f98600beda531bf33c2eee7128 to your computer and use it in GitHub Desktop.
Save aashutoshrathi/d14be6f98600beda531bf33c2eee7128 to your computer and use it in GitHub Desktop.
Hack Typeracer without it even detecting it.
function wait(ms) {
var d = new Date();
var d2 = null;
do { d2 = new Date(); }
while(d2-d < ms);
}
function hackIt() {
speed = 100; // in wpm
inp = document.getElementsByTagName('input');
x = document.getElementsByTagName('span');
text = "";
init = 0;
end = 0;
for (var i = 0; i < x.length; i++) {
if(x[i].className === "lblUsername")
init = i;
if(x[i].className === "gwt-InlineLabel") {
end = i;
}
}
for (var i = init; i < end; i++) {
text += x[i].innerText;
}
words = text.split();
timeDelay = 60000/speed; // for near to <100wpm for safe use, otherwise a warning will popup.
for (var i = 0; i < words.length; i++) {
inp[0].value = words[i] + " ";
wait(timeDelay);
}
}
hackIt();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment