links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
squeak IRC bot's Rare and Obscure, but Documented, features
Last updated at 11:58 am UTC on 17 January 2006
I have realized the day where people dig through src code for easter eggs is a myth. So, I shall put them in the help guide.


IRCBot instanceMethod>>fillEscapeSequences: art

art _ art copyReplaceTokens: '%s' with: self nick.
art _ art copyReplaceTokens: '%u' with: incomingMsgChunk sender.
art _ art copyReplaceTokens: '%t' with: Time now printString.
art _ art copyReplaceTokens: '%v' with: Smalltalk systemInformationString.
art _ art copyReplaceTokens: '%c' with: incomingMsgChunk channel.
^ art

Before anything gets sent out to the channel, the bot will try to make these replacements. So, in your rules you can place these shortcuts. This is not so elegant, but whatever.

Example: Someone in the channel might say to the bot,
bot: thisNewFactoid is <reply>I am %s, you are %u, it is %t in the land of %v.
Then when someone queries for 'thisNewFactoid' the bot will respond with the appropriate things inserted.


<elvislives> oi eval: randmorph := World submorphs atRandom
<oi> a SystemWindow>Workspace>(1595)
<elvislives> oi eval: randmorph position
<oi> 293@201
<elvislives> oi eval: randmorph flash
<oi> a SystemWindow>Workspace>(1595)
<elvislives> oi eval: randmorph contents
<oi> #error
<elvislives> oi eval: randmorph model
<oi> a Workspace

This is self-explanatory if you understand that the bot's Compiler is a proper evaluator (assuming that proper has no technical meaning to you as it has none for me, the author of this page ;)

It has a namespace just like a Workspace will have. And look at my great example... atRandom I just happened to grab a Workspace window! I hope this does not confuse things further!

Webb McDonald © 2003