#
# insult.pl: insult engine
-# ???: ???
+# TODO: move this code out to a common file like I did with DNS.
+# => use the command hooks system aswell
#
-use strict;
-
package Insult;
+use strict;
+
sub Insult {
my ($insultwho) = @_;
- return unless &loadPerlModule("Net::Telnet");
+ return unless &::loadPerlModule("Net::Telnet");
my $t = new Net::Telnet(Timeout => 3);
$t->Net::Telnet::open(Host => "insulthost.colorado.edu", Port => "1695");
my $line = $t->Net::Telnet::getline(Timeout => 4);
- $line = "No luck, $main::who" unless (defined $line);
+ $line = "No luck, $::who" unless (defined $line);
- if ($insultwho ne $main::who) {
+ if ($insultwho ne $::who) {
$line =~ s/^\s*You are/$insultwho is/i;
}
- &performStrictReply($line);
+ &::pSReply($line);
}
1;