Code: Select all
my $version = "v1.0";
Xchat::register("Login", $version, "Login $version", "");
$hook{"NOTICE"} = Xchat::hook_server("NOTICE", "login");
$hook{"PRIVMSG"} = Xchat::hook_server("PRIVMSG", "login");
sub login {
my $nick = $_[0][0];
my $chanmsg = $_[0][1];
if ($chanmsg =~ m/^(Please enter your nickname.)$/i) {
if ($nick eq 'OpBot') { Xchat::command("say myNICKNAME"); }
elsif ($nick eq 'tradervic') { Xchat::command("say myNICKNAME"); }
else { Xchat::command(""); }
if ($chanmsg =~ m/^(Enter your password.)$/i) { Xchat::command("say myPWD"); }
if ($nick eq 'OpBot') { Xchat::command("say PASSWORD"); }
elsif ($nick eq 'tradervic') { Xchat::command("say PASSWORD"); }
else { Xchat::command(""); }
}
return Xchat::EAT_NONE;
}
Xchat::print("Login $version loaded");