Super Auto Clicker

Dominate the web with your auto clicking powers! Install this script and this power is yours! Click Alt+M on a webpage to enable the autoclicker. Press Alt+M again to turn it off.

目前为 2022-08-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Super Auto Clicker
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.6
  5. // @description Dominate the web with your auto clicking powers! Install this script and this power is yours! Click Alt+M on a webpage to enable the autoclicker. Press Alt+M again to turn it off.
  6. // @author GSRHackZ
  7. // @match *://*/*
  8. // @grant none
  9. // @icon https://image.flaticon.com/icons/svg/99/99188.svg
  10. // @license MIT
  11. // @compatible chrome
  12. // @compatible firefox
  13. // @compatible opera
  14. // @compatible safari
  15. // ==/UserScript==
  16. let x,y,set,cps=10;
  17. document.addEventListener('keyup',function(evt){
  18. if(evt.keyCode==77&&evt.altKey){
  19. if(!set==true){
  20. set=true;
  21. let inp=prompt("Please set your CPS value. Do not include symbols/letters in your response. Recommended Max : 100,000 cps");
  22. if(!isNaN(inp)&&inp.trim().length>0){
  23. if(inp>100000){
  24. let check=confirm(`${inp} CPS may crash your browser! Are you sure you would like to continue?`)
  25. if(check){
  26. alert("The CPS value has been set.");
  27. console.warn("Please note that this may crash your browser.");
  28. cps=inp;
  29. }
  30. else{
  31. set=false;
  32. alert("Click Alt+M to set the CPS setting again.")
  33. }
  34. }
  35. else if(inp<1000){
  36. cps=1000;
  37. }
  38. else{
  39. cps=inp;
  40. }
  41. }
  42. alert("You may now click on any point in this tab to lock the autoclicker to it. Have fun!");
  43. onmousedown = function(e){
  44. x=e.clientX;
  45. y=e.clientY;
  46. };
  47. let autoClick=setInterval(function(){
  48. if(x!==undefined&&y!==undefined&&set==true){
  49. for(let i=0;i<cps/1000;i++){
  50. click(x,y);
  51. }
  52. }
  53. },1)}
  54. else{
  55. set=false
  56. }
  57. }
  58. })
  59. function click(x, y){
  60. let ev = new MouseEvent('click', {
  61. 'view': window,
  62. 'bubbles': true,
  63. 'cancelable': true,
  64. 'screenX': x,
  65. 'screenY': y
  66. });
  67. let el = document.elementFromPoint(x, y);
  68. el.dispatchEvent(ev);
  69. }