so would this work?
Code:
sub im_in($aim, $from, $msg) {
$from = lc($from);
$from =~ s/ //g;
if (!$users =~ /$from/) {
$aim->send_im($from, "nice try");
return;
} else {
$msg =~ s/<(.|\n)+?>//g;
if ($warn =~ /!warn/) {
$victim = str_replace("!warn ", "", $msg);
$aim->evil($victim);
$aim->send_im($from, '$victim warned');
return;
}
}
}
because i get nothing when i im the bot with the !warn $victim... I'm probably taking a completely wrong approach to this..
I also tried this, implementing the subroutine you gave me... I think I did this wrong as well...
Code:
sub im_in($aim, $from, $msg) {
$from = lc($from);
$from =~ s/ //g;
$test_user = matchstr($from, $users);
if ($test_user == 0) {
$aim->send_im($from, "nice try");
return;
} else {
$msg =~ s/<(.|\n)+?>//g;
$warn = matchstr($msg, !warn);
if ($warn != 0) {
$victim = str_replace("!warn ", "", $msg);
$aim->evil($victim);
$aim->send_im($from, '$victim warned');
return;
}
}
}
P.S.
i could submit it as OSS, but i doubt it's good enough to be of any use, or would the philosophy behind OSS be to make it better?
Bookmarks