[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rev It Up #3



Hello there, it's been a while since I've done a 'Rev It Up' so here it
is.  In this one I added a 'new' insult.pl and excuse.pl, both part of
infobot..except these ones use IO::Socket (which COMES with most perl
distributions) instead of Net::Telnet (which DOESN'T come with most
distributions, [if any at all.])  The main reason I did this was because
many people ask why their infobot starts up with that Net-Telnet.pm
error, usually these people are unfamiliar with perl so it's better to
make it easier on everyone, eh?  I am also including my Freshmeat Search
Util, the Server Jump addition, and the Current OS Versions which I have
already posted, but rather put it in here also.  And I'm including a
simple Locate from IP/Hostname thing that really goes trough a CGI and
'attempts' to find the location of the specified IP/Hostname (of course
this isn't always accurate, if it can find out at all.)  The Current
OS Versions finds out the...current versions of a few UNIX based OS's
such as FreeBSD++ and Red Hat.  The Server Jump just allows the owner to
message the bot with his/her pass and make the bot 'jump' to a different
IRC server if needed.  And the Freshmeat Search Utility is
self-explanitory, it will return the full name, a one line description
and exact download address of whatever you searched for, and if more
than one matches appear it will go to the first match and do what it has
to from there.

Using Current OS Versions:
Take the attachment 'osvers.pl' and put it in your infobot/src dir.  In
Extras.pl, add this:
#################################
    if ($message =~ /^\s*(cur|current|)( |)(os|unix|operating(
|)system(s|))( |)ver/) {
        my $os = &vers();
        return $os;
    }
#################################
By default, it will go through a CGI on a different computer and find
the OS versions from there, to save bandwidth.  If you wish to use the
CGI yourself and do such things as adding OS's or changing them, then
put 'unix.pl' in your cgi-bin/ dir and chmod 755 it, of course.  Then
you're all set and you can modify unix.pl in anyway you wish.


Using the Freshmeat Search Util:
Take the attachment 'fsapps.pl' and put it in your infobot/src dir.  In
Extras.pl, add this:
#################################
    if ($message =~ /^\s*freshmeat(?:\s*for\s*|\s*)(.*?)$/) {
        my $app = &fnd($1);
        return $app;
    }
#################################

Using that Location Util:
Take the attachment 'locat.pl' and put it in your infobot/src dir.  In
Extras.pl, add this:
#################################
    if ($message =~ /^\s*locate\s*(.*?)$/) {
        my $host = &locate($1);
        return $host;
    }
#################################

Adding the new excuse and insult programs:
Make sure you make a backup of infobot/src/excuse.pl and
infobot/src/insult.pl somewhere.  Then take the excuse.pl and insult.pl
from the attachments and replace them in your infobot/src dir.

Adding the Server Jump addition:
Open your infobot/src/User.pl and add this IN BETWEEN
[ if (IsFlag("o")) { # this is around line 300 ] and [  } return
'NOREPLY';  }  } # which is around the late 300's or early 400 lines
which takes up about 4 lines]
This is what to add:
####################################
                if ($message =~ /^\s*jump\s+(.*)\s*$/) {
                    if (!exists $verified{$VerifWho}) {
                        &status("unverified <$who> $message");
                        &msg($who, $unverified_message);
                        return 'NOREPLY';
                    }
                    &rawout("QUIT :Reconnection requested by $who");
                    status("Connecting to $servr by $who\'s request");
                    &irc($1);
                }
###################################


That is all.  I hope this stuff helps someone or another
sometime...please return to your IRC clients.
-Sam (CommPort5 on #perl / #infobot on EFnet)

fsapps.pl

locat.pl

osvers.pl

insult.pl

unix.pl

excuse.pl