Facebook
From Idiotic Mosquito, 4 Years ago, written in Plain Text.
This paste is a reply to Untitled from Cute Mosquito - view diff
Embed
Download Paste or View Raw
Hits: 232
  1. // ==UserScript==
  2. // @name         Anty-Duszek
  3. // @namespace    https://discord.gg/53dqXch
  4. // @version      0.5
  5. // @description  Wychodzenie z trybu nieaktywności na SI oraz NI;
  6. // @author       xxxx
  7. // @match        http://*.margonem.pl
  8. // ==/UserScript==
  9.  
  10. // Jeśli coś się buguje, pisać - poprawię.
  11. (() => {
  12.     setInterval(() => {
  13.         const isSi = getCookie("interface") == "si" ? true : false;
  14.         const afk = isSi ? hero.stasis:Engine.hero.d.stasis;
  15.         const dead = isSi ? g.dead:Engine.dead;
  16.         const battle = isSi ? g.battle:Engine.pvp;
  17.         if (!afk) return;
  18.         const url = isSi
  19.             ? `http://${g.worldname}.margonem.pl/engine?t=_&ml=${hero.x},${hero.y + 1}&mts=${unix_time() + 0.2}&ev=${unix_time()}&browser_token=${g.browser_token}&aid=${getCookie("user_id")}`
  20.             : `http://${Engine.worldName}.margonem.pl/engine?t=_&ml=${Engine.hero.d.x},${Engine.hero.d.y - 1}&mts=${unix_time() + 0.2}&aid=${getCookie("user_id")}&ev=${unix_time()}&browser_token=${Engine.browserToken}`;
  21.         fetch(url)
  22.             .then(response => response.json())
  23.             .then(x => {
  24.                 if (!dead && !battle) location.reload();
  25.             });
  26.     }, 400);
  27. })();