====== xchat perl ======
Here is a simple Perl script to change your nickname when going away or back.
===== Installation =====
create a file named like "myscript.pl" in your ~/.xchat2 folder and paste the code inside
===== Usage =====
/iway or /iback
===== Script =====
#!/usr/bin/perl
### Xchat registers and hooks.
Xchat::register("Ssm's away script", "1.0", "Ssm's away script", "");
Xchat::hook_command("iaway", "setaway");
Xchat::hook_command("iback", "setback");
use warnings;
use strict;
### Main routine.
sub setaway {
Xchat::set_context("#mychannel", "[Banned-URL]");
Xchat::command("NICK ssm2017[Away]");
Xchat::command("AWAY Zzzz...");
}
sub setback {
Xchat::set_context("#mychannel", "[Banned-URL]");
Xchat::command("NICK ssm2017");
Xchat::command("BACK");
}
===== Sources =====
[[http://www.wyldryde.org/forum/ubbthreads.php/topics/5101/Re_Need_help_with_XChat_away_s.html#Post5101|script]]
[[http://xchatdata.net/Scripting/PerlSnippets|installation procedure and other scripts]]
{{tag>scripts irc perl xchat}}