User Tools

Site Tools


change_nickname_on_going_away_with_xchat_and_perl

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

change_nickname_on_going_away_with_xchat_and_perl.txt · Last modified: by 127.0.0.1