Czogista

Margonem AR

Aug 5th, 2020 (edited)
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         AR
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  autorefresh nie działający na captche
  6. // @author       Czogi
  7. // @match        http://*.margonem.pl/
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (() => {
  12.   const sleep = (time) => {
  13.     return new Promise((resolve) => setTimeout(resolve, time));
  14.   };
  15.  
  16.   const oldParse = parseInput;
  17.   let refresh = false;
  18.   parseInput = (data, a, b) => {
  19.     refresh = false;
  20.     oldParse(data, a, b);
  21.   };
  22.  
  23.   (async () => {
  24.     while (true) {
  25.       await sleep(3000);
  26.       if (
  27.         refresh &&
  28.         document.getElementById("captcha").style.display != "block"
  29.       ) {
  30.         location.reload();
  31.       }
  32.       refresh = true;
  33.     }
  34.   })();
  35. })();
  36.  
Add Comment
Please, Sign In to add comment