Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name clanBless SI
- // @namespace https://czogi.usermd.net
- // @version 0.1
- // @description Applies clan blessing if there is no blessing affecting hero
- // @author Czogi
- // @include /https://[a-z]{4,15}.margonem.pl/
- // @run-at document-itle
- // @noframes
- // @icon https://czogi.usermd.net/cBot/icon.png
- // @grant unsafeWindow
- // ==/UserScript==
- "use strict";
- {
- const blessingName = "Czarcie spojrzenie";
- //Nazwa błogosławieństwa
- const blessings = {
- "upiorne wzmocnienie": 1,
- "krwawe widmo": 2,
- "czarcie spojrzenie": 3,
- "krwawa aura": 4,
- "demoniczne zniszczenie": 5,
- "moc z zaświatów": 6,
- "śmiertelne westchnienie": 7
- };
- let blockApplyingBless = false;
- if (typeof unsafeWindow !== "undefined") {
- window = unsafeWindow;
- }
- ((oldPi) => {
- const main = (data) => {
- if (window.g.init < 5) {
- return;
- }
- if (typeof window.hero?.clan !== "object") {
- return;
- }
- if (window.hero.is_blessed !== 0) {
- return;
- }
- if (
- data.hasOwnProperty("alert") &&
- data.alert.includes("Kolejne błogosławieństwo będzie można użyć") &&
- !blockApplyingBless
- ) {
- blockApplyingBless = setTimeout(() => {
- blockApplyingBless = false;
- }, 60e3);
- delete data.alert;
- }
- if (blockApplyingBless) {
- return;
- }
- window._g(
- `clan&a=skills_use&name=blessing&opt=${
- blessings[blessingName.toLowerCase()]
- }&ans=1`
- );
- };
- window.parseInput = function (data) {
- main(data);
- oldPi(...arguments);
- };
- })(window.parseInput);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement