The script
Xchat::register ("CWN", "0.1.0", "Displays notices in current window");
Xchat::hook_print ("Notice", cw_notice, "");
sub cw_notice
{
Xchat::set_context Xchat::find_context
Xchat::command ("ECHO Received a notice from $_[0][0]: $_[0][1]");
return Xchat::EAT_ALL;
}
As you can see in the Xchat::hook_print command, the subroutine cw_notice will be executed when a notice is sent to you. You can find these events like Notice, Channel Message, Channel Action etc in the Settings -> Advanced -> Text Events... menu in XChat.
The cw_notice subroutine will set the context to your current window and will echo in it the nick and the notice received.
No comments:
Post a Comment