oreilly.comSafari Books Online.Conferences.
Articles Radar Books  

The Command Line of the Future Part 2: Expanding ChatBot's Repertoire
Pages: 1, 2, 3

Step 3: Start up ChatBot

Now we have our new plug-in script, let's start up ChatBot in the normal way:

  [dj@cicero chatbot]$ ./chatbot

This time, Chatbot's been configured to join the room "test" on my local server, and go by the name "chatbot". To try out the currency-conversion service, don't forget to toggle the feature on, first, like this:

  !toggle_flag flags currency

Now you can have ChatBot convert currencies for you ad nauseam. Figure 1 shows a typical interaction.

Testing room

Figure 1. ChatBot providing currency-conversion services in the "test" room

Wrapping It Up

Through the power of Perl, we've now given ChatBot the facility to perform currency conversions for us. Wonderful. And what's more, we've not at all been slack in our pursuit of the three key values: we were impatient enough to want a currency-conversion function without having to write one from scratch, we were lazy enough to do as little as possible with the exchange.pl script once we found it, as well as being lazy enough to want a bot to perform the conversions for us in the first place, and we had enough hubris to combine code from infobot and ChatBot (after all, "hubris" has the same etymological root as "hybrid," and implies an "insult" to both parties being combined) to get the job done.

It's clear to see that ChatBot has a great framework for adding new features; I hope I've shown you how straightforward it is.

Go on--make a new acquaintance today, and get ChatBot working for you!


DJ Adams is the author of O'Reilly's Programming Jabber book.

O'Reilly & Associates published (June 2001) Programming Jabber.

P2P Weblogs

Richard Koman Richard Koman's Weblog
Supreme Court Decides Unanimously Against Grokster
Updating as we go. Supremes have ruled 9-0 in favor of the studios in MGM v Grokster. But does the decision have wider import? Is it a death knell for tech? It's starting to look like the answer is no. (Jun 27, 2005)

> More from O'Reilly Developer Weblogs

More Weblogs
FolderShare remote computer search: better privacy than Google Desktop? [Sid Steward]

Data Condoms: Solutions for Private, Remote Search Indexes [Sid Steward]

Behold! Google the darknet/p2p search engine! [Sid Steward]

Open Source & The Fallacy Of Composition [Spencer Critchley]