Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Zapisywanie Red
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description try to take over the world!
  6. // @author Patix0331
  7. // @match http://*/*
  8. // @match http://*.margonem.pl
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. ((_parseInput) => {
  13. window.parseInput = (data, b, c) => {
  14. if (data.hasOwnProperty("npc") && data.npc !== undefined && window.map.pvp === 2) {
  15. for (const [id, npc] of Object.entries(data.npc)) {
  16. if (window.g.npc[id] !== undefined && npc.hasOwnProperty("del") && npc.del === 1) {
  17. const {x, y} = window.g.npc[id];
  18.  
  19. if(Math.hypot(window.hero.x - x, window.hero.y - y) > 16){
  20. delete data.npc[id];
  21. }
  22. }
  23. }
  24. }
  25.  
  26. _parseInput(data, b, c);
  27. }
  28. })(window.parseInput)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement