plugin.id = "thanks-mode";
plugin.init =
function _init( glob ) {
plugin.major = 1;
plugin.minor = 2;
plugin.version = plugin.major + "." + plugin.minor;
plugin.description = "Thanks for mode. " +
"By MakOke <gboxlan@gmail.com>";
return "OK";
}
plugin.enable =
function _enable() {
client.eventPump.addHook( [{set:"channel", type:"chanmode"}], modoHook, "modoHook" );
return true;
}
plugin.disable =
function _disable() {
client.eventPump.removeHookByName( "modoHook" );
return true;
}
function modoHook( e ) {
if( e.modeStr[0] == '+' ) {
var str = '';
for( var i = 1; i < e.modeStr.length; i++ )
if( e.server.me.encodedName == e.usersAffected[i-1].encodedName ) {
switch( e.modeStr[i] ) {
case 'q':
str += '~';
break;
case 'a':
str += '&';
break;
case 'o':
str += '@';
break;
case 'h':
str += '%';
break;
case 'v':
str += '+';
break;
}
}
if( str )
setTimeout( function() {
e.channel.dispatch( 'me Thanks for ' + str + ' ' + e.user.encodedName + ' !!' );
}, 5 * 1000 );
}
}
Download File thanks-mode.js 1.2 KB