Advertisement
Nolifeq

sellanie potek

May 9th, 2021
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. // ==UserScript==
  2. // @name spierdalacpotionyzmaddokow
  3. // @version 1.1
  4. // @author podwladny tylonite
  5. // @match http://*.margonem.pl/
  6. // ==/UserScript==
  7.  
  8. const sklepNode = document.getElementById('shop');
  9. const configPotki = { attributes: true };
  10.  
  11. const tylonite = function(mutationsList, observer) {
  12. for(let mutation of mutationsList) {
  13. if (mutation.type === 'attributes' && mutation.attributeName === 'style' && sklepNode.style.cssText.includes("block")) {
  14. let toSell = [];
  15. let potkiJebane = [
  16. "Tarutaned berserkerów",
  17. "Źródlana woda Maddoków",
  18. "Odtrutka maddoków"
  19. ];
  20.  
  21. for (let itemId in g.item) {
  22. for (let pot in potkiJebane) {
  23. if (g.item[itemId].name.includes(potkiJebane[pot])) {
  24. if(hero.id==g.item[itemId].own) toSell.push(itemId);
  25. }
  26. }
  27. }
  28.  
  29. _g(`shop&sell=${toSell.toString()}`);
  30. }
  31. }
  32. };
  33.  
  34. const observer = new MutationObserver(tylonite);
  35. observer.observe(sklepNode, configPotki);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement