Advertisement
dev_codeSet

TypeRacer-Hack

Oct 8th, 2020 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. Made by dev_codeSet:
  2.  
  3.  
  4.  
  5. function triggerKeyboardEvent(el, keyCode, type)
  6. {
  7. var eventObj = document.createEventObject ?
  8. document.createEventObject() : document.createEvent("Events");
  9.  
  10. if(eventObj.initEvent){
  11. eventObj.initEvent(type, true, true);
  12. }
  13.  
  14. eventObj.keyCode = keyCode;
  15. eventObj.which = keyCode;
  16.  
  17. el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj);
  18.  
  19. }
  20. $=$$
  21.  
  22. content = $('table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td > div > div')[3].textContent.split('');
  23. i = 0;
  24. function a () {
  25. if (i == content.length - 1) return;
  26. input = $('table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input')[0]
  27. input.focus()
  28. input.value += content[i++];
  29. triggerKeyboardEvent(input, input.value.charCodeAt(0), "keydown")
  30. input.click()
  31. triggerKeyboardEvent(input, input.value.charCodeAt(0), "keypress")
  32. triggerKeyboardEvent(input, input.value.charCodeAt(0), "keyup")
  33. setTimeout(a, 50 * Math.random())
  34. }
  35. a();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement