# Infobot Guide 0.43

The canonical source for the infobot source and documentation is http://www.cs.cmu.edu/~infobot.

## setting up

### configuration

- editing the parameter file

  The parameter file, usually in `files/infobot.config`, is the most direct way to customize the settings on your infobot.

- editing the user file

  The user file, usually in `files/infobot.users`, is the most direct way to customize the settings on your infobot.

- editing the main script

  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

  - changing the bang path to perl

    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.

  - explicitly setting normally relative paths

    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.

### running the infobot

- starting it up

  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 &`

- the console

  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`

### shutting it down

If you have set yourself as the bot's master in the user file (`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.

## built-in functions and variables

- `nslookup irc.cs.cmu.edu`

  performs DNS lookup or reverse-lookup on the hostname or IP.

- `internic yahoo.com`

  gets the internic WHOIS record

- imdb, websters

  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

  `

- The `<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`

- The `<action>` factoid tag (as of 0.43.5)

  This causes the bot to respond as with except as an ACTION.

  `X is <action> Y`

- `die`

  If the bot owner says this or messages it to the bot, it will kill itself.

- the `$who` variable

  Contains the nickname person currently addressing the bot. It can be used effectively in replies.

  `nice day is <reply> you betcha, $who.`

- random replies with `|`

  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.

- appending to existing entries: `also`

  One can extend an existing factoid using the keyword `also`

  `poink is also a silly word`

- erasing a factoid: `forget`

  A factoid can easily be deleted by using

  `infobot, forget poink`

- changing a factoid: `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.

- joining an allowed channel: `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.

- leaving a channel: `part #infobot`

  This causes the bot to leave the given channel

  `infobot, part #infobot`

  `leave` is a synonym for `part`.

- karma / plusplus

  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

  `

- having the bot tell someone else something: `tell`

  A user can ask an infobot to tell someone else something.

  `infobot, tell fimmtiu about no web`

- Backwacking

  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.

## scripts/utilities

The infobot comes with some scripts for working with the DBM files.

- `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.

## the FAQ

The FAQ is available at http://www.cs.cmu.edu/~infobot/faq/. It is growing.

Last modified: Sat Aug 15 22:00:56 EDT 1998