Skip to content

Instantly share code, notes, and snippets.

@birdbrainiac
birdbrainiac / turnorder 2.0
Created September 14, 2018 08:35 — forked from fmonaca/turnorder 2.0
Turn Tracker for the HERO system, showing by phase
var iii = iii || {};
var iTurn = iTurn || {};
var combatBegun = combatBegun || {};
var aChars = new Array();
var aSPDchart = new Array();
aSPDchart = ['','12','6,12','4,8,12','3,6,9,12','3,5,8,10,12','2,4,6,8,10,12','2,4,6,7,9,11,12','2,3,5,6,8,9,11,12','2,3,4,6,7,8,10,11,12','2,3,4,5,6,8,9,10,11,12','2,3,4,5,6,7,8,9,10,11,12','1,2,3,4,5,6,7,8,9,10,11,12'];
function recoveryAll(tokens) {
for(var idCounter=0; idCounter<tokens.length; idCounter++){
@birdbrainiac
birdbrainiac / Roll20 Random Encounters
Created September 14, 2018 08:34 — forked from anonymous/Roll20 Random Encounters
A script for the roll20 api to pick a random encounter.
// A shorthand to create new events in the encounters table.
var event = function(freq, msg) {
return {message: msg, frequency: freq};
};
// The encounter table. Create a new section and populate it with events. The
// event text will be displayed in the GM chat window if it is selected.
// Events with a frequency of '3' will happen 3 times as often as events with
@birdbrainiac
birdbrainiac / getLibrary.js
Last active September 14, 2018 13:29 — forked from sturtus/gist:8352577
[Roll20 getCharacterObjects] Script Functions to get character and attribute objects #roll20 #roll20library
/*
This is my collection of useful functions to use in other commands/functions. I will keep this top post updated with the list of included functions as I add more.
Library includes:
- removePlus. Takes string or array of strings and returns the integer after the symbol "+". Useful for getting an integer from a string that represents a bonus like +2. Will also convert any numbers in the string/array of strings to integers.
- getAttributeObjects: takes a character object and an array of attribute names, checks the names against the character for existing attributes, error checks them for empty values or existence at all, and returns an array of the attributes' objects.
- getCharacterObj: takes a graphic, attribute, ability, or character object and returns the associated character object.