The parameter file, usually in files/infobot.config
,
is the most direct way to customize the settings on your infobot.
The user file, usually in files/infobot.users
,
is the most direct way to customize the settings on your infobot.
There are certain items you may need to fiddle with in the main script of the infobot, but normally you shouldn't have to. The usual reasons are
If you get
infobot: Command not found.
or something like it, you need to edit the infobot script at the top level directory (the script named 'infobot') and set the path to you perl interpreter in the very first line of the script to
#!/path/to/perl
with, of course, the full path to your perl binary.
If you don't have . in your path, you will probably need to set some variables explicitly that are normally determined relative to the infobot script. This is done in the 'infobot' script.
This should be as simple as entering the infobot parent directory and executing
infobot
This starts up the script and generates a whole lot of text.
It's useful and interesting to see what's going on "in the
infobot's head". You can control the amount of verbage
that comes out with the VERBOSITY
parameter,
of you can dump all the output to the bitbucket and background
the process at the same time with
nohup infobot > /dev/null &
Should you choose to look at the stream if consciousness in the bot, and you haven't reduced the output to nothing or consigned it to the void, you will be presented with the console.
The first thing you should see, assuming all goes well with making a connection, is the motd (message-of-the-day) of the server the bot has been configured to connect to.
Next, you should see the result of the channel joins specified in the parameter files, and you may see the bot recognizing hostmasks of people in the userfile, if any have been put in there.
If you have the ansi_control
paramter set,
and your terminal supports it, the output will be in color.
NOTE that the 'console' is NOT interactive. You can't type anything into it; it's just for viewing what's going on.
cron
ning the infobot
You can set the infobot to automatically start up using
cron
. See the included example crontab
file, in files/infobot.crontab
infobot.users
, unless you changed the default),
you can just say or message 'die' to the bot.
Otherwise, kill the process or hit control-c in the console.
nslookup irc.cs.cmu.edu
performs DNS lookup or reverse-lookup on the hostname or IP.
internic yahoo.com
gets the internic WHOIS record
outputs a well-formed url for a search of IMDB (the Internet Movie DataBase) or the Webster's 1913 dictionary
imdb for clerks
webster for lucre
<reply>
factoid tag.
Normally, when the infobot replies to "What is X", it says "X is Y". This form makes it just reply "Y".
X is <reply> Y
die
If the bot owner says this or messages it to the bot, it will kill itself.
$who
variable
Contains the nickname person currently addressing the bot. It can be used effectively in replies.
nice day is <reply> you betcha, $who.
|
You can set a list from which to pick a random reply by
using |
/
x is a|b|c|d
When x is asked about, the infobot will randomly choose from
the |
-spearated list.
also
One can extend an existing factoid using the
keyword also
poink is also a silly word
forget
A factoid can easily be deleted by using
infobot, forget poink
no, ...
You can change the entry for a factoid completely using
no, infobot, x is wugga wugga.
which deletes the prior entry (if possible) and replaces it with the new one.
join #infobot
On IRC, you can tell the infobot to join a channel that it's allowed to join with
infobot, join #infobot
If it is allowed to (in its paramter settings), it will try to join the channel.
part #infobot
This causes the bot to leave the given channel
infobot, part #infobot
leave
is a synonym for part
.
karma for a concept may be incremented or decremeted using
++
and --
. You can get the
current karma 'score' for something by asking for it.
oznoid++
oznoid--
karma for oznoid
tell
A user can ask an infobot to tell someone else something.
infobot, tell fimmtiu about no web
Use \
to protect items from evaluation.
x is y is y
will normally set x =is=> y is y
, but
x is y is y
will set x is y =is=> y
. the forget
and no
(update) operators apply before checking
for this. This is also useful for getting around the dereferencing
if "i" and "me" and so on.
make_db
This takes a flat ascii file and inserts it into a DBM file. It creates a new DBM if it didn't exist.
scripts/make_db factpacks/code_to_country.txt infobot-is
will add the factoids in code_to_country.txt
to the infobot-is
DBM.
dump_db
The converse. It dumps out the DBM file to a flat ascii file. Note there is no extension on the DBM name, even though the system may use one.
scripts/dump_db infobot-is
Note there is no extension on the DBM name, even though the
system may use one (like .pag
and
.dir
or .db
).
op me
The 'p' (oP on channel) flag in the userfile allows this to work. You'll need to set a hostmask. Not recommended.