Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. // ===============Description========================
  2. // Type at wpm speed
  3. // ===============Directions=========================
  4. // copy > (CTRL+SHIFT+J) > Console > paste > (ENTER)
  5. // ===============Credits============================
  6. // kecebongsoft@github
  7. // ===============Configurables======================
  8. var wpm = 50 // words per minute
  9. // @NOTE: this might be off because 10fastfingers
  10. // uses a scaling formula to adjust for word difficulty
  11. // ==================================================
  12.  
  13. var word_idx = 0;
  14. var interval_per_word = 60000/wpm; // in milliseconds
  15. function typefast(){
  16. if(word_idx<words.length){
  17. $('#inputfield').val(words[word_idx] + ' ');
  18. var keyup = jQuery.Event('keyup');
  19. keyup.which = 32;
  20. $('#inputfield').trigger(keyup);
  21. word_idx++;
  22. setTimeout('typefast()', interval_per_word);
  23. }
  24. }
  25. setTimeout('typefast()', interval_per_word);
  26.  
  27.  
  28.  
  29. // ===============Description========================
  30. // The demonstration-proof cheat bot
  31. // Will only respond to pressing spacebar
  32. // Autocompletes when you press spacebar
  33. // ===============Directions=========================
  34. // copy > (CTRL+SHIFT+J) > Console > paste > (ENTER)
  35. // ===============Credits============================
  36. // dahdahm@github, razzyoshi@github
  37. //===================================================
  38. onkeydown = function(e){
  39. if(e.keyCode != 32){
  40. e.preventDefault();
  41. }
  42. }
  43. $("#inputfield").keypress(
  44. function(){
  45. $("#inputfield").val( $(".highlight").text())
  46. }
  47. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement