Advertisement
Nolifeq

sell poty

Sep 30th, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. // ==UserScript==
  2. // @name spierdalacpotiony
  3. // @version 1.3.1
  4. // @author dolphin
  5. // @match http://*.margonem.pl/
  6. // ==/UserScript==
  7.  
  8. const sklepNode = document.getElementById('shop');
  9. const configPotki = { attributeFilter: ['style'] };
  10. let potkiSold = false;
  11.  
  12. const tuniaChecker = () => {
  13. if (!(map.name == 'Dom Tunii')) {
  14. potkiSold = false;
  15. }
  16. }
  17.  
  18. const tylonite = () => {
  19. if (sklepNode.style.cssText.includes("block") && !potkiSold) {
  20. const toSell = [];
  21. const zostawPls = [];
  22. const potkiJebane = [
  23. "Język maddoka",
  24. "Źródlana woda Maddoków",
  25. "Odtrutka maddoków"
  26. ];
  27. const zostawJedno = [
  28. "Latająca miotła"
  29. ];
  30.  
  31. for (const [itemId, {name, own}] of Object.entries(g.item)) {
  32. for (const pot of potkiJebane) {
  33. if (name.includes(pot)) {
  34. if (hero.id == own) {
  35. toSell.push(itemId);
  36. break;
  37. }
  38. }
  39. }
  40. for (const zostaw of zostawJedno) {
  41. if (name.includes(zostaw)) {
  42. if (zostawPls.some(item => item[0] == name)) {
  43. toSell.push(itemId);
  44. break;
  45. }
  46. else {
  47. zostawPls.push([name, itemId]);
  48. break;
  49. }
  50. }
  51. }
  52. }
  53.  
  54. while (toSell.length > 0) {
  55. _g(`shop&sell=${toSell.splice(0, Math.min(20, toSell.length)).toString()}`);
  56. }
  57.  
  58. potkiSold = true;
  59. };
  60. };
  61.  
  62. const observer = new MutationObserver(tylonite);
  63. observer.observe(sklepNode, configPotki);
  64. setInterval(tuniaChecker, 10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement