#!/usr/bin/perl -w # simple script in Perl for xchat by Mux # this script automatically add a suffix to your nickname like "[aw]". # you can of course change it to whatever you want. just modify the # $away_suffix variable. it also removes this suffix when coming back. IRC::register("away script", "1.0", "", ""); IRC::add_command_handler("away", "away_handler"); sub away_handler { my $away_suffix = "[aw]"; my $my_nick = IRC::get_info(1); my $reason = shift(@_); if ($reason ne "") { IRC::command("/nick $my_nick$away_suffix"); } elsif ($my_nick =~ s/(\Q$away_suffix\E)+$//i) { IRC::command("/nick $my_nick"); } return 0; }