Main /

How It Works



How It Works

The basic workings of the bot are as follows:

  • You start the bot by running bstart.php

  • It reads the PHP binary path and configuration from the conf file.

  • bmain.php is then launched as a background process.

  • bmain.php connects to MSN server, and being the main code is always running while the bot is alive.

bmain.php handles what is called the Notification Server (NS) side:

  • It loads all handlers whose filenames end in .ns.php
ie. these .ns.php handlers are specially for the bmain.php NS process

  • When someone starts a conversation with the bot, or vice versa, the bot starts another process via the file bsb.php

bsb.php handles the switchboard (SB) communication:

  • It loads all handlers whose filenames end in .sb.php which handle things related to a client conversation
  • Connects to the MSN server to join/start the conversation
  • Handles any messages received from the user.

Since the NS and SB are separate and discrete processes runnind independently, there is something called a LinkLayer, implemented via a handler that handles messaging between the processes, acting as a simple Inter-Process Communication

You add functionality to the bot framework by using handlers. By writing your own handlers you can do pretty much anything. the blobsy code is a FRAMEWORK, make no mistake about it. it provides a foundation to which you can build a slick bot.

You should not expect the bot to immediately have lots of usable commands, nearly all functionality regarding the bots behaviour needs to be programmed. However some demonstration handlers are included to demonstrate some of the frameworks capabilities.

Any Handlers need to be saved in the handlers directory with a .ns.php or .sb.php extension, as required, and added to the appropriate section in the config file. have a look, it is pretty apparent.

Recent Changes (All) | Edit SideBar Page last modified on November 18, 2008, at 10:45 PM Edit Page | Page History
Powered by PmWiki