<!-- Thumbnail: http://www.rebolsource.net/assets/img/rebol-3d-160x160.png -->
<!-- Version: 0.0.33 -->
<!-- Tag: chat app  -->
<!-- Excerpt: RebolBot is a helpful little robot that will take natural English commands to do your bidding in chat rooms -->

![The all-seeing eye of the RebolBot! Well, maybe it's just a Rebol block.][1]

##Screenshot / Code Snippet

    @Adrian I respond to these commands:
    (do|do/2|do/red|do/boron) expression "evaluates Rebol/Rebol-like expression in a sandboxed interpreter"
    (hello|goodbye|morning) some-text "returns a greeting to the user who greeted bot"
    delete [ silent ] "in reply to a bot message will delete if in time"
    do/ideone which-lang [word! string! integer!] expression "evaluates a source expression for the specified language"
    help "this help"
    present[?] "prints users currently online"
    private session [ in ] room-number "Starts a private session with the bot in another room."
    save key [string! word!] description [string!] link [url!] "save key with description and link"
    keys "returns known keys"
    remove key "removes key (authorized user)"
    find descript [string! word!] "shows keys with description containing descript"
    save my details url! [ timezone [time!]] "saves your details with url +/- timezone"
    show [all ][ recent ] links by user "shows links posted in messages by user"
    show links [ like url ] "shows saved links"
    show me your youtube videos "shows saved youtube videos"
    version "version of bot"
    what is the (meaning|purpose) of life? "answers the biggest question of all"
    what is the time?
    who do you know "returns a list of all known users"
    who is user "returns user details and page"
    ? key [ for user | @user ] "Returns link and description"

##About

RebolBot is a chat bot written in Rebol. It specifically targets the StackOverflow chat rooms, but could be modified with only a little effort to work with any chat system that provides an API for accessing and posting messages or with those providing nothing more than a web form (of course its functionality would depend on how much of the chat activity is accessible either through the API or by scraping). You might think that this is what you could do in any language, but wait until you've seen Rebol - it makes text (and binary) parsing and data munging child's play. 

A running instance of the bot hangs out in the [Rebol and RED][2] room where it answers questions, executes Rebol (and IDEone supported languages) code in a sandboxed environment for teaching purposes, and does all sorts of other useful things.  It has a natural English language dialected interface, and aims to be on call 24/7.  It runs under its own account.  Help is available in the [Rebol and RED][2] room.

The bot runs as a console process and can interact with a chat systems in various ways with ease. As implemented it is using the REST API that is visible, but not documented, when you use *chat.stackoverflow.com*.

If you'd like to use this bot to evaluate code in an arbitrary programming language, you should have access to a remote service that can accept a string to be evaluated. To see what the RebolBot does with the HTML that is returned from the remote service it is currently using, take a look at the `evaluate-expression` function. In fact the remote service doesn't have to be a service in a formal sense - any of the many REPLs out there could serve as an evaluation target since Rebol makes it very easy to post to and parse results from any site. Make sure you have the OK of the site owner though, before you go and send more traffic his way than s/he's expecting.

And the latest version can now reflect on itself, and will provide its own source code on questioning.

Keep in mind that this bot is quite young so you can still expect some rough edges to show themselves here and there. Again, you are welcome to drop by the Rebol chat room and discuss the script in general, or have us try to help with customizing it for your needs. 

[Rebol][7] (and [Red][8]) - keepin' it simple!

###Changes
v0.0.33 - 
The bot now uses a dynamic, modular approach in providing functionality. Commands are separate modules (a single file) that can be added or removed to change the bot's behavior either before the bot is run or at runtime. There is no configuration needed. The bot will monitor the command modules that are placed in the commands directory and re-configure himself.

###License

[Apache License, Version 2.0][3]

###Download

[Script source on GitHub][4]

[Rebol Binaries][5] - So tiny! Yes, that's all you'll need. No install.

###Platform

The script can be run on any platform supported by Rebol (Linux, OS X, Windows, Android)   



##Contact

[Graham Chiu on GitHub][6]; [Graham Chiu on SO chat][10]

[Adrian Sampaleanu on GitHub][7]; [Adrian Sampaleanu on SO chat][11]

##Code

RebolBot is currently under 400 lines of Rebol for the main bot (not including command modules which can be included or not, as desired). Commands vary from a couple of lines to around 130 for the most complex. If you want to hack on it, feel free to fork the source and submit pull requests for changes you feel are generally useful, as well as for bug fixes.

[Script source on GitHub][4]

##The Goal
[Rebol][7] and [Red][9] are fighting software complexity...

Software systems have become too complex, layers upon layers of complexity, each more brittle and vulnerable to failure. In the end software becomes the problem, not the solution. We rebel against such complexity, fighting back with the most powerful tool available: language itself.


  [1]: http://www.rebolsource.net/assets/img/rebol-3d-160x160.png
  [2]: http://chat.stackoverflow.com/rooms/291/rebol-and-red
  [3]: http://www.apache.org/licenses/LICENSE-2.0.html
  [4]: https://github.com/gchiu/rebolbot
  [5]: http://www.rebolsource.net
  [6]: https://github.com/gchiu
  [7]: https://github.com/asampal
  [8]: http://www.rebol.com
  [9]: http://www.red-lang.org
  [10]: http://chat.stackoverflow.com/users/76852/graham-chiu
  [11]: http://chat.stackoverflow.com/users/1792095/adrian