Sunday, April 4, 2010

Why bots are big and how to setup a simple IRC-based supybot (part 2)

In part 1 we showed you how to set-up  a simple IRC-based supybot. Don't forget supybot lives in an IRC channel, so you'll need to boot up an IRC client to talk to him. You will also notice that Supybot is not all that bright off the bat. Depending on which plugins you activated upon installation, you'll probably have a few basic commands and some routines, like being able to google for information in your channel. Sounds a bit like any modified shell doesn't it?

Supybot doesn't have much of a personality, so we'll need to download some extra plugins to make him a bit more intelligent than a vacuum cleaner.

A personality plugin is available from Animus. (It is very basic, but a step in the right direction) [be warned, Personality is still a bit buggy, see my comment below]

Download the personality folder to your /botdir/plugins/ folder.

You will need to load the plugin manually.

First make sure you are the owner by identifying to the bot in a private channel;

1. Open a private conversation

/query <bot-name>

or

/msg <bot-name>

2. Identify with the bot

identify <owner-name> <password>

Supybot will either respond or decline your command.

3. Now enter the following command to show the plugins path

supybot.directories.plugins

In my case: /home/freebot/botdir/plugins

4. Load your plugin

@load <name of plugin>

In my case @load Personality

If you're wondering where the plugin file is, its a folder, usually containing plugin.py and some other files. Leave the files alone, or configure them to your satisfaction.

2 comments:

  1. Anyone out there able to debug python?

    ERROR 2010-04-04T13:53:55 Uncaught exception in ['persona'].
    Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1180, in _callCommand
    self.callCommand(command, irc, msg, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/utils/python.py", line 86, in g
    f(self, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1166, in callCommand
    method(irc, msg, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/commands.py", line 913, in newf
    f(self, irc, msg, args, *state.args, **state.kwargs)
    File "/home/freebot/botdir/plugins/Personality/plugin.py", line 206, in persona
    names = [fname[:-4] for fname in os.listdir(basedir)
    OSError: [Errno 2] No such file or directory: '/home/freebot/botdir/conf/Personality'
    ERROR 2010-04-04T13:53:55 Exception id: 0x474d7
    INFO 2010-04-04T13:55:14 personality learn called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:56:00 unload called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:56:37 learn called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:56:52 learn called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:57:08 learn called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:57:40 forget called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    INFO 2010-04-04T13:59:19 personas called by
    "afrodeity!~afrodeity@41-132-105-146.dsl.mweb.co.za".
    ERROR 2010-04-04T13:59:19 Uncaught exception in ['personas'].
    Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1180, in _callCommand
    self.callCommand(command, irc, msg, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/utils/python.py", line 86, in g
    f(self, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1166, in callCommand
    method(irc, msg, *args, **kwargs)
    File "/usr/lib/pymodules/python2.6/supybot/commands.py", line 913, in newf
    f(self, irc, msg, args, *state.args, **state.kwargs)
    File "/home/freebot/botdir/plugins/Personality/plugin.py", line 223, in personas
    names = [fname[:-4] for fname in os.listdir(basedir)
    OSError: [Errno 2] No such file or directory: '/home/freebot/botdir/conf/Personality'
    ERROR 2010-04-04T13:59:19 Exception id: 0x7052f

    ReplyDelete
  2. Those who do not like the bag less vacuum cleaner also complain that the drain cup that a lot of dirt can be released into the air, a problem often cause allergies. They are also quick to point out that sometimes clog empty bag less with very messy hampered recovery tend to be carried out because of the confusion this creates. Fortunately, the industry knows that empty the vast majority of these problems have been more than adequately solved by the manufacturers. So even if the first bag less systems, technical problems associated with them, so this is no longer the norm.

    ReplyDelete