Tob - experimental JCSP IRC Bot
Tob is an interesting experiment into doing a Markov-chains like bot in a new and different way. Internally, he stores each word as a seperate process and builds up a graph of words. Creating a new phrase from this graph is essentially just traversing it.
Tob has a couple of other functions as well, for example DNS and RDNS lookup.
- $feed - Pass Tob a URL and he will consume its contents into his puny brain
- $stats - Tells you some stats about Tob's brain. Will block for a long time with large amounts of words... be warned!
- $dns - Do a DNS lookup
- $rdns - Do an RDNS lookup
Expanding Tob is relatively simple. All Tob's channels to commands live in a map in the CommandsHandlerProcess and this map is initially created by the IRCBotDriverProcess. You need to define a new CSProcess (Take a look at DNSProcess for a short example of one) to which this channel end can link with.
Tob's code is available here in a tarball. You can do whatever you want with his code, but if you do expand him I'd quite like to know about it! :-)
Here are two images showing the overall network and the Markov side of his process network.
Finally, a warning. On a 32-bit machine Tob's brain will explode at around 20,000 processes, which is approximately 19,000 words, so please do be careful with him. I'm told that on a 64-bit linux machine he can get up to about 50,000 processes before the scheduler starts getting a bit angry and there are kernel limits you run into before then anyway. On a 64-bit kernel, 32-bit userland Solaris 9 machine he seems to survive for around 20k processes. Under Solaris, he will use Lightweight processes. I don't even want to think about what would happen if you ran him under windows...
Thanks to ErNci for tidying Tob's directory structure and for the quick and dirty build scripts