Skip to content

Instantly share code, notes, and snippets.

@mattkauffman23
mattkauffman23 / inspect.js
Created December 1, 2015 04:15
Roll 20 API script for inspecting tokens
(function() {
'use strict';
var help = '!inspect - Manage player visible descriptions of tokens. ' +
'Requires CommandShell. See script for more options and useful macros.';
/*
Requires the following other scripts to be installed:
- CommandShell (https://wiki.roll20.net/Script:Command_Shell)
@mattkauffman23
mattkauffman23 / randomizer.js
Last active February 17, 2017 06:14
Roll 20 API Script for generating complex random items
(function() {
/*
!randomizer - Allows flexible generation of all sorts of randomizable things
such as NPCs, loot, weather, etc...
Requires the following other scripts to be installed:
- Shell (https://wiki.roll20.net/Script:Command_Shell)
Instructions:
Randomizer relies on special names for rollable tables. It intends to be
@mattkauffman23
mattkauffman23 / parent.js
Created November 11, 2015 16:53
iframe sandboxing
var sandboxDomain = 'https://different-domain.com'
function invokeCustomScript(scriptId) {
var iframe, sandbox;
iframe = document.createElement('iframe');
iframe.src = sandboxDomain + '/custom-scripts/' + scriptId;
sandbox = iframe.contentWindow || iframe;
sandbox.postMessage({ method: 'init', state: gameState }, sandboxDomain);