Mturk Multi Layer Master Cats

Keys A,S,D,F,G assigned to choices top to bottom, Key E to submit.

目前为 2014-06-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Mturk Multi Layer Master Cats
  3. // @version 0.1
  4. // @description Keys A,S,D,F,G assigned to choices top to bottom, Key E to submit.
  5. // @author Cristo
  6. // @include *
  7. // @copyright 2012+, You
  8. // @namespace https://greasyfork.org/users/1973
  9. // ==/UserScript==
  10.  
  11. var cE = 0;
  12. var page = document.getElementById("wrapper");
  13. var host = page.getElementsByTagName("ul")[cE];
  14. var pick = host.getElementsByTagName("div");
  15.  
  16.  
  17. page.tabIndex = "0";
  18. page.focus();
  19.  
  20. function next() {
  21. cE++;
  22. host = page.getElementsByTagName("ul")[cE];
  23. pick = host.getElementsByTagName("div");
  24. }
  25.  
  26.  
  27. document.addEventListener( "keydown", kas, false);
  28. function kas(i) {
  29. if ( i.keyCode == 65 ) { //A
  30. pick[0].click();
  31. next();
  32. }
  33. if ( i.keyCode == 83 ) { //S
  34. pick[1].click();
  35. next();
  36. }
  37. if ( i.keyCode == 68 ) { //D
  38. pick[2].click();
  39. next();
  40. }
  41. if ( i.keyCode == 70 ) { //F
  42. pick[3].click();
  43. next();
  44. }
  45. if ( i.keyCode == 71 ) { //G
  46. pick[4].click();
  47. next();
  48. }
  49. if ( i.keyCode == 69 ) { //E Key -
  50. document.getElementById( "submit_button" ).click();
  51. }
  52. }