Skip to content

Instantly share code, notes, and snippets.

@Bastlifa
Created October 30, 2017 20:40
Show Gist options
  • Save Bastlifa/6afdf6fc8370121e5b70e3107bd4f68e to your computer and use it in GitHub Desktop.
Save Bastlifa/6afdf6fc8370121e5b70e3107bd4f68e to your computer and use it in GitHub Desktop.
Silly script to make a table for STA in roll20
//Just type !MakeChallengeDiceTable into chat and hit enter. Then go ahead and delete this script.
on("ready", function() {
"use strict";
on("chat:message", function (msg) {
if (msg.type === "api" && msg.content === "!MakeChallengeDiceTable")
{
var CDtable = findObjs({type: 'rollabletable', name: "Challenge-Dice"})[0];
if (!CDtable)
{
CDtable = createObj('rollabletable', {
name: 'Challenge-Dice',
showplayers: true
});
var aTableItems = ['1', '2', '1 plus Effect', '1 plus Effect', '0', '0'];
for (var i=0; i<aTableItems.length; i++)
{
createObj('tableitem', {
name: aTableItems[i],
rollabletableid: CDtable.id
});
}
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment