FriendCommands *OLD*

Adds commands to add and remove people from your friends list

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name            FriendCommands *OLD*
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.1.0
// @description     Adds commands to add and remove people from your friends list
// @include         http://www.kongregate.com/games/*/*
// @homepage        http://userscripts.org/scripts/show/73396
// ==/UserScript==
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname))
setTimeout(function() {
	window.location.assign("javascript:void(document.observe('holodeck:ready',function(){(function(){var t=ChatRoom.prototype.refreshUsers=function(e){for(var d=0,b,a=e.length;d<a;d++){b=this.user(e[d]);if(!!b){this.userChanged({data:{user:b,force:true}})}};holodeck.chatWindow()._rooms.values().each(function(f){f.refreshUsers=t})}})();function aD(b){return b.activeDialogue()};var eUC=encodeURIComponent,o={n:function(b){return b.username()},e:function(b){aD(b).kongBotMessage('Enter a username between three and sixteen characters long.')},u:function(n,b){var g;b.chatWindow()._rooms.values().each(function(f){ if(!g){g=f.user(n);if(g)g=g.username}});return(g)},a:function(a,b){return(!aD(b)._user_manager._friends[a.toLowerCase()])},aU:function(a,b){new Ajax.Request('http://www.kongregate.com/accounts/'+o.n(b)+'/friends/'+a+'.chat', {asynchronous:true, evalScripts:true, method:o.ar(a,b,0), onSuccess:function(r){aD(b).kongBotMessage(a+' was '+o.ar(a,b,1)+' for '+o.n(b)+'.') }, parameters:'authenticity_token='+eUC(active_user.formAuthenticityToken())} );},ar:function(a,b,c){return(c?this.a(a,b)?'removed':'added':this.a(a,b)?'delete':'put')}},mute=(function(b,d){d=(d.match(/^\\/(?:add|friend)\\s*([a-z0-9_]{3,16})/i)||[0,0])[1];if(d!=0){if(this.a(d,b))b.addFriend(d=this.u(d,b)||d),this.aU(d,b)}else{this.e(b)}return(!1)}).bind(o),umute=(function(b,d){d=(d.match(/^\\/(?:unadd|remove|unfriend)\\s*([a-z0-9_]{3,16})/i)||[0,0])[1];if(d!=0){if(!this.a(d,b))b.removeFriend(d=this.u(d,b)||d),this.aU(d,b)}else{this.e(b)}return !1}).bind(o);holodeck.addChatCommand('add', mute);holodeck.addChatCommand('friend', mute);holodeck.addChatCommand('unadd', umute);holodeck.addChatCommand('remove', umute);holodeck.addChatCommand('unfriend', umute)}))");
}, 1250);