Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. // Feross Aboukhadijeh - Apr 12 2010
  2. //
  3. // Script I hacked together to cheat on TypeRacer.com. You use it by waiting for the typing game
  4. // to start. Once it starts, open up Firebug, paste in this code, and run it. Now, just press
  5. // space to auto-type each word. I made the user push space, as opposed to advancing the words
  6. // automatically because I believe the site looks for a keypress event before evaluating the contents
  7. // of the input box. I could not figure out how to fake a user keypress event. Perhaps this is
  8. // disallowed for browser security reasons?
  9. //
  10. // Next todo: Site detects the unbelievable WPM and asks you to do a captcha test.
  11.  
  12. wordNumber = 0;
  13. function PrintNextWord() {
  14. word = answerArr[wordNumber];
  15. inputs[0].value = word;
  16. wordNumber++;
  17. }
  18.  
  19. // setup - run once
  20.  
  21. document.onkeypress = PrintNextWord;
  22.  
  23. firstWord = null;
  24. for (i=0; i<99; ++i) {
  25. firstWord = document.getElementById("nhwMiddlegwt-uid-" + i);
  26. if (firstWord != null) {
  27. break;
  28. }
  29. }
  30.  
  31. answer = null;
  32. for (i=0; i<99; ++i) {
  33. answer = document.getElementById("nhwRightgwt-uid-" + i);
  34. if (answer != null) {
  35. break;
  36. }
  37. }
  38.  
  39. answer = firstWord.innerHTML + answer.innerHTML;
  40. // alert(answer);
  41. answerArr = answer.split(" ");
  42.  
  43. inputs = document.getElementsByTagName("input");
  44.  
  45. PrintNextWord();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement