Ok, so I've moved from mIRC to XChat, got perl loaded. And started modifying XChat a bit..
What I want is a script that when i type /iaway will:
Change my nick on [Banned-URL] to "Alex[Away]"
Send the message ".status away" to the channel #norway on [Banned-URL]
Change my nick on
WyldRyde to "iAlex[Away]"
and when i type /iback will:
Change my nick on [Banned-URL] to "Alex"
Send the message ".status here" to the channel #norway on [Banned-URL]
Change my nick on
WyldRyde to "iAlex"
I currently have this code:
#!/usr/bin/perl
### Xchat registers and hooks.
Xchat::register("Alex's away script", "1.0", "Alex's away script", "");
Xchat::hook_command("iaway", "setaway");
Xchat::hook_command("iback", "setback");
use warnings;
use strict;
### Main routine.
sub setaway {
my $oldcontext = Xchat::get_context();
my $curnet = "[Banned-URL]";
Xchat::set_context("$curnet");
Xchat::command("nick Alex[Away]");
XChat::command("msg #norway .status away");
$curnet = "WyldRyde";
Xchat::set_context("$curnet");
Xchat::command("nick iAlex[Away]");
}
sub setback {
my $oldcontext = Xchat::get_context();
my $curnet = "[Banned-URL]";
Xchat::set_context("$curnet");
Xchat::command("nick Alex");
XChat::command("msg #norway .status here");
$curnet = "WyldRyde";
Xchat::set_context("$curnet");
Xchat::command("nick iAlex");
}
It changes my nick to Alex[Away] and Alex on [Banned-URL], but does not perform any other operations. What am i doing wrong? please respond
