If you want to use the Online Dice Roller capabilities in your app, you can use the official API to do that. Here's how it works!

Dice Room Data

A JSON feed of your dice room log is available at
^ you can replace "lobby" with your room name. The data will typically look like this:
  "room": {
    "key": "4261",
    "name": "lobby",
    "created": "1289487891",
    "data": {
      "motd": "This is the lobby where you can meet up and/or try out the dice rooms.",
      "motd_from": "udo"
  "items": [
      "type": "txtmsg",
      "from": "Nanana",
      "text": "test",
      "key": "716707",
      "h_time": "2015-03-23 21:14 UTC",
      "time": "1427145274",
      "room_id": "4261"
There are several kinds of messages, as indicated by the "type" field: txtmsg, dicemsg, timeinfo, and srvmsg. Numerical timestamps are given in Unix time, all times are UTC.

Dice Room Client API

Tools like Greasemonkey and Tampermonkey allow people to customize the functionality of their websites. The dice rooms have JavaScript hooks you can use for that purpose:
  • document.onMessage: by setting this variable to your own handler function you can listen in on all room messages that are coming from the server.
    Example: document.onMessage = function(msg) { console.log(msg) }
  • document.onMessageRender: If you define this you can modify the message HTML before it's put into the document. This is the place where you would insert link or image HTML. document.onMessageRender(html, msg) expects that you return the HTML should be rendered on the screen.
    Example: document.onMessageRender = function(html, msg) { return('!'+html); }
  • document.isActive: this is a variable you can read from your script to determine if the window or tab containing Rolz is currently active or in the background.

Posting Text to a Dice Room

As the owner of a room, you can allow text to be posted through an API. To enable this, enter your room and use the command
/room api=on
Then use the command
/room info
to show your room's ID number. Make note of that number. After that, you will be able to post text to your room by issuing requests like this:
As the ID parameter, use the room's ID number. TEXT can be any text up to 1kb in length.

Dice Rolling API

Access to the REST API is available via the base URL
To get back a roll result, just append the die code to the URL:
This example gets you the result of 6D6 in an extended stringlist text format like this:
details= [ 1+1+2+3+1+3 ] 
illustration=<span class="dc_dice_a">6</span><span class="dc_dice_d">D6</span>
You can also choose from the available result formats explicitly:
^ returns a JSON array containing the result (you probably want this one).
^ delivers in the extended text list format.
^ gets you just the result number.
^ returns an XML document containing the result.


C# Dice Code Parser

A long time ago, I wrote a rudimentary C# Dice Code Parser class. You can download it here.