Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Better QG
- // @version 2.12
- // @description dfsa
- // @author nie znam typa
- // @match *.margonem.pl/
- // @grant none
- // ==/UserScript==
- var qgStorage = localStorage;
- if (qgStorage.getItem('adiQGacceptGrp') == null) qgStorage.setItem('adiQGacceptGrp', 'false');
- g.loadQueue.push({
- fun: function () {
- $('<div id="adiQGcheckbox">Automatyczne przyjmowanie zaproszeń do grupy</div>').appendTo('#cfg_options').click(function () {
- if ($('#adiQGcheckbox').attr('style') == 'background-position: 0px -22px') {
- $('#adiQGcheckbox').attr('style', 'background-position: 0px 0px');
- qgStorage.setItem('adiQGacceptGrp', 'false')
- } else {
- $('#adiQGcheckbox').attr('style', 'background-position: 0px -22px');
- qgStorage.setItem('adiQGacceptGrp', 'true')
- }
- });
- if (qgStorage.getItem('adiQGacceptGrp') == 'true') $('#adiQGcheckbox').attr('style', 'background-position: 0px -22px');
- else $('#adiQGcheckbox').attr('style', 'background-position: 0px 0px');
- },
- data: ''
- });
- ! function (oldAlert) {
- mAlert = function (e, a, o, t) {
- if (typeof (e) == "string") {
- if (-1 != e.search(/Ten gracz należy|Ten gracz aktualnie|Ten gracz nie życzy sobie drużyn|Wysłano zaproszenie teleportacji|Ta postać jest teraz w trakcie/)) {
- message(e)
- } else if (-1 != e.search(/Czy chcesz dołączyć do drużyny/) && qgStorage.getItem('adiQGacceptGrp') == 'true') {
- message(e)
- } else oldAlert(e, a, o, t)
- } else oldAlert(e, a, o, t)
- }
- }(mAlert);
- ! function (oldAjax) {
- $.ajax = function (o) {
- if (o.url.indexOf("engine") > -1 && qgStorage.getItem("adiQGacceptGrp") == "true") {
- var oldsucc = o.success;
- o.success = function (res) {
- var msh = oldsucc.apply(this, arguments);
- if (res.ask !== undefined) {
- if (res.ask.q.indexOf("Czy chcesz dołączyć do drużyny") > -1) {
- _g("party&a=accept&answer=1");
- }
- }
- return msh;
- };
- }
- return oldAjax.apply(this, arguments);
- };
- }($.ajax);
- document.addEventListener("keyup", async function (e) {
- if (e.target.tagName != "INPUT" && e.target.tagName != "TEXTAREA" && e.which == 82 && !g.battle) {
- if (!g.engineStopped) {
- await inviteToParty();
- }
- };
- });
- async function inviteToParty() {
- await fetch(`/engine?t=friends&a=show&ev=${g.ev + 0.01}&browser_token=${g.browser_token}&aid=${g.aid}`).then(body => body.json()).then(jsonFriends => {
- g.ev = jsonFriends.ev;
- const friends = [];
- for (let i = 0; i < jsonFriends.friends.length; i += 10) {
- if (jsonFriends.friends[i + 8] !== 'online' || jsonFriends.friends[i + 5] !== map.name) {
- continue;
- }
- friends.push(jsonFriends.friends[i]);
- }
- friends.forEach(friendId => friendInviteParty(friendId));
- });
- await fetch(`/engine?t=clan&a=members&ev=${g.ev + 0.01}&browser_token=${g.browser_token}&aid=${g.aid}`).then(body => body.json()).then(clan => {
- g.ev = clan.ev;
- const onlineMembers = [];
- for (let i = 0; i < clan.members.length; i += 9) {
- if (clan.members[i + 8] !== 'online' || clan.members[i + 4] !== map.name) {
- continue;
- }
- onlineMembers.push(clan.members[i]);
- }
- onlineMembers.forEach(memberId => friendInviteParty(memberId));
- });
- }// ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://*/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Your code here...
- })();// ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://*/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Your code here...
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement