Skip to content
eboyjr edited this page Dec 29, 2012 · 4 revisions

Guide to oftn-bot

oftn-bot is a bot used in #oftn on irc.freenode.net which was created as a utility for The ΩF:∅ Foundation. In addition to executing JavaScript snippets, it can store factoids for later retrieval.

Code execution

ecmabot comes with Haskell, V8, and Spidermonkey JavaScript interpreters. You can give it some code, and it will return with the result of evaluating it.

To use the interpreter:

>> console.log("Hello, world.");
<ecmabot> eboy: undefined; Console: 'Hello, world.'
SpiderMonkey V8 Haskell
>> >>> hs>
sm> v8>  
s> v>  
js>    
j>    

Commands

!commands

Retrieves a list of current commands.
Usage: !commands

<eboyjr> !commands
<oftn-bot> eboyjr: Valid commands are: !commands, !countdown, !find, !forget, !g, !gh, !learn, !topic, !tweet

!countdown

Starts a quick 3-second timer. Usage: !countdown

12:00pm :00 <eboyjr> !countdown
12:00pm :01 <oftn-bot> 3...
12:00pm :02 <oftn-bot> 2...
12:00pm :03 <oftn-bot> 1...
12:00pm :04 <oftn-bot> Go!

!find

Performs a search of a factoid in the database.
Usage: !find <factoid>

<eboyjr> !find project
<oftn-bot> eboyjr: Found: projects, github, and suit-canvas-toolkit

!forget

Removes a factoid from the database.
Usage: !forget <factoid>

!g

Returns the first Google result for the query.
Usage: !g <query>

<eboyjr> !g v8 javascript engine
<oftn-bot> eboyjr: v8 - V8 JavaScript Engine - Google Project Hosting <http://code.google.com/p/v8/>

!gh

Outputs information for a GitHub account.
Usage: !gh <username>

<eboyjr> !gh eboyjr
<oftn-bot> eboyjr: Devin Samarin <eboyjr14@gmail.com> | https://github.com/eboyjr | (United States) - Member since: Jul 32, 2009 - 5 public repos

!learn

Adds a factoid to the bot.
Usage: !learn <factoid> = <text>
Usage: !learn alias <factoid> = <factoid>
Usage: !learn <factoid> =~ s/<expression>/<replace>/<flags>

!projects

Displays information about projects of the ΩF:∅ Foundation.
Usage: !projects
Usage: !projects <repo>

<eboyjr> !projects oftn-bot
<oftn-bot> eboyjr: oftn-bot: State-of-the-art IRC bot library & bot for Node.js [JavaScript] <http://oftn.org/projects/oftn-bot> (updated 14 days ago)

!tweet

Posts a message to the ΩF:∅ Foundation Twitter account. This is only available to board members.

<eboyjr> !tweet Attention board members: Our next meeting is on Friday, February 24, 2012 at 8:00 PM PST.
<oftn-bot> Tweet successful: https://twitter.com/oftn_foundation/status/172155414610329600

!unicode

Provides basic information about Unicode characters. (name, symbol, and character code)
Usage: !unicode U+<hex>
Usage: !unicode <decimal>
Usage: !unicode <char>
Usage: !unicode <name>

<eboyjr> !unicode snowman
<oftn-bot> eboyjr: SNOWMAN | ☃ (U+2603)

Factoids

The factoid system in ecmabot is designed to store simple key/value pairs. Accessing a factoid from the database is as simple as:

<eboyjr> !help
<oftn-bot> eboyjr: In order to get help, paste the relevant portions JavaScript in a pastebin (see !paste), and tell us 1) what you want to happen, 2) what is actually happening, and 3) any error messages you find (see !debug).

You can direct the responses of your command with the @ character, followed by a nick.

<phpman3000> HAI GUYS ... uh havin a bit of trubble with this script... i get TypeError: document.crateElenemt is not a function how do i fixx this??
<eboyjr> !spelling @ phpman3000
<oftn-bot> phpman3000: Spelling and capitalization are important in programming, unless you are using PHP.