This page provides a slightly more detailed guide to running Apbot.
PREREQUISITES: This page on setting up Apbot.
We'll cover a bit of the last article, just to be sure.
1. Edit file apbot.x.x.xx.py
Starting on line 4, there's some options that you need to change for your own server.
- HOST - your server name. ie. "irc.freenode.net".
- HOME_CHANNEL - enter the native channel that the bot will reside on. Channels start with a # sign, like "#help". Ensure that you have permission to set up a bot on this channel from the founder first.
- NICK - This is the nickname of the bot once it joins the channel - can be anything you like. NOTE: Apbot will terminate if the nickname is already in use.
- PORT - Port number to connect on. Default port number for IRC connections is 6667 - you shouldn't need to change this.
- SYMBOL - This is the identifier that you must type to have commands recognized by Apbot. For example, entering "$coke hypno" will execute the 'coke' command.
2. Run on your server
- Upload first, with your favorite FTP program - I use Filezilla. The directory you upload the file to needs to hold other files for Apbot in the future, so you might want to put it in its own folder.
- Connect with shell. PuTTY is a very popular tool for this. We won't be covering SSH and PuTTY here, but it's only fair to let you know: not all web hosts / servers allow SSH connections out of the box - this may be something you have to get your host to enable for you.
- Browse to your upload directory, and run. For me, it was as easy as entering cd py but for you it will probably be different.
- To run the script, type python apbotx.x.xx.py and press enter.
- To run the script in the background, type python apbotx.x.xx.py & and press enter.
- To run the script in the background and keep it running AFTER you close your shell connection, type nohup python apbotx.x.xx.py & and press enter.
- Apbot will then begin producing some debug output in the shell window, and you should see the bot join your IRC channel.
3. Send some commands!
This list is a work in progress, and will change as I figure out more about the bot. For now, here's a basic list of functions that are included in the main file!
- hello <nick> - ?</nick>
- hey <nick> - ?</nick>
- hi <nick> - ?</nick>
- $join < #channel > - Makes bot join < #channel >
- $leave < #channel >- Makes bot leave < #channel >
- $quit - Exits bot program
- $coke < nickname > - Dispenses coke to < nickname >
- $pepsi < nickname > - Dispenses pepsi to < nickname >
- $fish < nickname > - Slaps < nickname > with fish
- $bomb < nickname > - Bombs < nickname > and kicks them. NOTE: From apbot0.1.5B, you must edit the def bomb(user) function around line 52. Specifically, you must change the ##aussiepowder channel to a channel of your liking. This will probably be changed in future revisions.
- $fish - Makes sandwich for user
- $cake - Makes cake for user
- $echo < command > - Echoes < command >
4. Test it out!
There's a test bot running at
irc.newfapchan.org #apbot. Feel free to join, and if you have any questions about that particular channel, contact
Hypno either in there or in #newfapchan.