Facebook
From ja, 4 Years ago, written in Plain Text.
This paste is a reply to zapisywanie na red BEZ KEYLOGERA from ja - view diff
Embed
Download Paste or View Raw
Hits: 257
  1. // ==UserScript==
  2. // @name         Zapisywanie na red mapach
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       adi wilk
  7. // @match        *://*/
  8. // @match        *://www.margonem.pl/*
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12.  
  13.  
  14.  
  15. ((_parseInput) => {
  16.     window.parseInput = (data, b, c) => {
  17.         if (data.hasOwnProperty("npc") && data.npc !== undefined && window.map.pvp === 2) {
  18.             for (const [id, npc] of Object.entries(data.npc)) {
  19.                 if (window.g.npc[id] !== undefined && npc.hasOwnProperty("del") && npc.del === 1) {
  20.                     const {x, y} = window.g.npc[id];
  21.  
  22.                     if(Math.hypot(window.hero.x - x, window.hero.y - y) > 16){
  23.                         delete data.npc[id];
  24.                     }
  25.                 }
  26.             }
  27.         }
  28.  
  29.         _parseInput(data, b, c);
  30.     }
  31. })(window.parseInput)