Tablescript is a simple programming language designed to help players and gamemasters generate content for roleplaying games.

Roleplaying games are filled with tables of random things: treasure, monsters, room contents, etc. Sometimes these tables can get complicated. Or hard to keep track of.

Tablescript allows you to turn these tables of random things into small scripts that when run produce a random result as if you had rolled on the tables.

For example, a table like this...

Wandering Monsters
Roll Result
1-3 d6 Goblins
4-7 d3 Orcs
8-9 2d4 Dire Gerbils
10 Ancient Red Dragon

... becomes a script like this...

wandering_monsters = table { 1-3: ${ d6 } Goblins 4-7: ${ d3 } Orcs 8-9: ${ 2d4 } Dire Gerbils 10: Ancient Red Dragon }; print(wandering_monsters()); # >> 3 Dire Gerbils

Try it!

Copyright Jamie Hale 2021