Guest User

ifastest.ru clicker

a guest
Mar 28th, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var dispatchMouseEvent = function(target, var_args) {
  2.   var e = document.createEvent("MouseEvents");
  3.   e.initEvent.apply(e, Array.prototype.slice.call(arguments, 1));
  4.   target.dispatchEvent(e);
  5. };
  6. function mouseClick(target) {
  7.   dispatchMouseEvent(target, 'mousedown', true, true);
  8.   target.focus();
  9.   dispatchMouseEvent(target, 'mouseup', true, true);
  10. };
  11. var ex = document.getElementById("example");
  12. var ctx = ex.getContext("2d");
  13. function check() {
  14.     if (ctx.getImageData(0,0,1,1).data[0] === 0) {
  15.         mouseClick(ex);
  16.     }
  17.     setTimeout(function(){
  18.                 check();
  19.             }, 1);
  20. };
  21. check();
Advertisement
Add Comment
Please, Sign In to add comment