plugin.id = "invites-devolution";
plugin.init =
function _init( glob ) {
this.major = 1;
this.minor = 2;
this.version = this.major + "." + this.minor + " ( 31 Dic 2009)";
this.description = "A devolution invites for your Network Channel. " +
"By MakOke <gboxlan@gmail.com>";
// Set: Network and Channel for invite devolution. ( Max. One Channel by Network )
plugin.devChan = [ [ 'mindforge', '#TxuriBeltz' ],
[ 'arrakis', '#Nunca_Jamas' ]
];
return "OK";
}
plugin.enable =
function _enable() {
client.eventPump.addHook( [{set:"server", type:"invite"}], inviteHook, "inviteHook" );
return true;
}
plugin.disable =
function _disable() {
client.eventPump.removeHookByName( "inviteHook" );
return true;
}
function inviteHook ( e ) {
var text = ' I thank you very much for your invitation to ' + e.decodeParam( 2 ) + ', but I am sorry, my list is full of channels, but do not worry, your message will be stored, thank you!';
setTimeout( function() {
e.server.parent.dispatch( 'notice ' + e.user.encodedName + ' Hello :) ' + e.user.encodedName + ':' );
e.server.parent.dispatch( 'notice ' + e.user.encodedName + text );
for( var i = 0; i < plugin.devChan.length; i++ )
if( e.server.parent.unicodeName == plugin.devChan[i][0] ) {
e.server.parent.dispatch( 'notice ' + e.user.encodedName + ' You can find me in...' );
e.server.parent.dispatch( 'invite ' + e.user.encodedName + ' ' + plugin.devChan[i][1] );
break;
}
}, 1000 );
setTimeout( function() {
e.server.parent.dispatch( 'notice ' + e.user.encodedName + ' Have a nice day!! B) ' );
}, 9000 );
}