Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Kupowanie strzał u tunii.
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author Patix0331
- // @match http://*.margonem.pl/
- // @grant none
- // ==/UserScript==
- const config = {
- // Dokładna nazwa itemku, który ma kupować.
- itemName: "Strzały Tunii",
- // Do ilu stacków ma kupować danego itemku? (Pamietaj, ze strzały potrzebuja 3 stacki zeby zajac 1 slot w eq)
- itemStacks: 18,
- // profesje na którcyh ma kupowac
- prof: ["h", "t"],
- }
- const old = _g;
- let isBought = 0;
- _g = x => {
- if (!x.includes("talk&id=16366&c="
- && !hero.prof.includes(config.prof)
- || isBought) {
- return old(x);
- }
- old(x);
- setTimeout(() => {
- const toBuy = Object.values(g.item).find(item => {
- return item.name == config.itemName
- && item.own == 16366
- });
- if (!toBuy) {
- return;
- }
- const inBagItemsCount = Object.values(g.item).filter(item => {
- return item.name == config.itemName
- && item.loc == "g";
- }).length;
- isBought ^= 1;
- if (inBagItemsCount == config.itemStacks) {
- return;
- }
- old(`shop&buy=${toBuy.id},${config.itemStacks - inBagItemsCount}&sell=`);
- }, 150);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement