Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Oddawanie dowództwa
- // @version 0.1
- // @description Oddaje dowództwo po napisaniu na czacie grupowym 'oddaj d'
- // @author You
- // @match http://*.margonem.pl/
- // @match https://*.margonem.pl/
- // @grant none
- // ==/UserScript==
- ((Engine) => {
- const time = () => Date.now() / 1000;
- const filter = ({ k, n, t, ts }) => {
- if(time() - ts > 2 || n === Engine.hero.d.nick || k !== 2 || t.toLowerCase() !== "oddaj d") return;
- if(typeof Engine.party === "object" && Engine.party.getLeaderId() === Engine.hero.d.id){
- window._g("party&a=give&id=" + Object.values(Engine.party.getMembers()).find(p => p.nick === n).id);
- }
- }
- window.API.addCallbackToEvent("newMsg", msg => filter(msg[1]));
- })(window.Engine)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement