Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Wpłacanie złota do klanu
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Dodatek automatycznie wpłaca złoto do klanu postaci NI SI
- // @author Czogi
- // @match https://*.margonem.pl/
- // @icon https://www.google.com/s2/favicons?domain=margonem.pl
- // @grant none
- // ==/UserScript==
- "use strict";
- {
- const config = {
- doNotSend: 5_000_000 /* Tyle ma zostawić */,
- minAmount: 1_000_000 /* Minimum wysyłaj tyle złota */
- };
- (async (sleep) => {
- if (typeof unsafeWindow !== "undefined") {
- window = unsafeWindow;
- }
- const isSi = window.getCookie("interface") === "si";
- do {
- await sleep(1e3);
- } while (
- !Object.keys(isSi ? window?.hero || {} : window?.Engine?.hero || {})
- .length
- );
- {
- }
- if (isSi ? !("clan" in window.hero) : !("clan" in window.Engine.hero.d)) {
- return;
- }
- while (true) {
- await sleep(1e3);
- const currGold = isSi ? window.hero.gold : window.Engine.hero.d.gold;
- const toSend = currGold - config.doNotSend;
- if (toSend < config.minAmount) {
- continue;
- }
- window._g(`clan&a=save&f=gold&v=${toSend}`);
- }
- })((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement