Skip to content

Instantly share code, notes, and snippets.

View Caleth's full-sized avatar

Adam Rowell Caleth

View GitHub Profile
@shdwjk
shdwjk / TokenNameNumber.js
Last active October 17, 2015 14:30
Roll20 API: TokenNameNumber - Automatic Numbering of select tokens
// GIST: https://gist.github.com/shdwjk/6968e757c2bf9a7371fb
var TokenNameNumber = TokenNameNumber || (function() {
'use strict';
var version = 0.21,
schemaVersion = 0.1,
escapeRegExp = function(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
@shdwjk
shdwjk / TokenMod.js
Last active October 17, 2015 14:30
Roll20 API: TokenMod -- An interface to adjusting properties of a token from a macro or the chat area.
// GIST: https://gist.github.com/shdwjk/357e0632a1096375de58
var TokenMod = TokenMod || (function() {
'use strict';
var version = 0.53,
schemaVersion = 0.1,
fields = {
// booleans
@shdwjk
shdwjk / GroupInitiative.js
Last active October 17, 2015 14:31
Roll20 API: GroupInitiative -- adds the selected tokens to the turn order after rolling their initiative + dex mod and taking the lowest number.
// GIST: https://gist.github.com/shdwjk/91a2d2b076f687eb8406
var GroupInitiative = GroupInitiative || (function() {
'use strict';
var version = 0.41,
schemaVersion = 0.5,
bonusCache = {},
statAdjustments = {
'Stat-DnD': {
@shdwjk
shdwjk / Mark.js
Last active August 29, 2015 14:04
Roll20 API: Mark -- Places a numbered Marker under tokens, clears on turn change/close, and page change.
// GIST: https://gist.github.com/shdwjk/5119cf1c5ffdf3088308
var Mark = Mark || (function() {
'use strict';
var version = 0.22,
schemaVersion = 0.2,
markerURL = 'https://s3.amazonaws.com/files.d20.io/images/4994795/7MdfzjgXCkaESbRbxATFSw/thumb.png?1406949835',
@shdwjk
shdwjk / TokenLock.js
Last active October 17, 2015 14:33
Roll20 API: TokenLock -- Allows GMs to selectively lock the movement of Player Tokens.
// GIST:
var TokenLock = TokenLock || (function() {
'use strict';
var version = 0.11,
schemaVersion = 0.1,
performLock = function() {
if( ! state.TokenLock.locked ) {
@shdwjk
shdwjk / TempHPAndStatus.js
Last active August 29, 2015 14:03
Roll20 API: Temp hit point manager and bloodied/dying/dead status markers.
// GIST: https://gist.github.com/shdwjk/baab586565149fe0fca5
var AutoStatusMarker = AutoStatusMarker || (function() {
'use strict';
var HitPointBarNum = 3,
TempHitPointsIn = 'temp_HP',
BloodiedMarker = 'half-heart',
DyingMarker = 'dead',
@shdwjk
shdwjk / IsGMModule
Last active January 26, 2024 21:44
Roll20: IsGM module -- adds a function, isGM(id), which returns true for gms and false for players. GM database is built in the state object automatically as players and gms send chat messages.
// GIST: https://gist.github.com/shdwjk/8d5bb062abab18463625
var IsGMModule = IsGMModule || {
version: 0.6,
active: true,
reset_password: "swordfish",
CheckInstall: function() {
var players = findObjs({_type:"player"});
@shdwjk
shdwjk / TurnMarker.js
Last active April 7, 2022 11:38
Roll20 API: TurnMarker - round counter and a moving marker that shows who's turn it is.
// GIST: https://gist.github.com/shdwjk/ed16764c268129afff22
/* ############################################################### */
/* TurnMarker */
/* ############################################################### */
var TurnMarker = TurnMarker || {
version: 1.24,
schemaVersion: 1.16,
active: false,