Skip to content

Instantly share code, notes, and snippets.

View shdwjk's full-sized avatar
🐉
Coding, coding, coding...

Aaron C. Meadows shdwjk

🐉
Coding, coding, coding...
  • Springfield, MO
View GitHub Profile
@shdwjk
shdwjk / Roll20 Mystara Calendar
Last active October 11, 2022 00:07
My first release of a Mystara Calendar API Script for Roll20.
var Calendar = Calendar || {
version: 1.6,
lunarPhaseSize: 15,
lunarPhasesImage: 'https://s3.amazonaws.com/files.d20.io/images/4277527/CJJWBbiHx3jHglPdccPx3A/max.png?1401939451',
clearImage: 'https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/max.png?1401938659',
_Ordinal: function(num) {
var ones=(num%10);
var tens=((num%100)-ones);
switch(ones)
@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,
@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 / MonsterHitDice
Created June 17, 2014 16:13
Roll20 API: Set Monster hit dice on add
// GIST: https://gist.github.com/shdwjk/7377de58100f4e813432
on('ready', function(){
on('add:graphic',function(obj){
if(
'graphic' == obj.get('type')
&& 'token' == obj.get('subtype')
&& '' != obj.get('represents')
)
{
@shdwjk
shdwjk / Walls
Last active August 29, 2015 14:02
Roll20 API: Walls -- building dynamic lighting walls with an exported SVG path file
// GIST: https://gist.github.com/shdwjk/7a9c3ce232961662b69c
var Walls = Walls || {
version: 0.1,
schemaVersion: 0.2,
CheckInstall: function() {
if( ! _.has(state,'Walls') || state.Walls.schemaVersion != Walls.schemaVersion)
{
/* Default Settings stored in the state. */
@shdwjk
shdwjk / WeightedDice
Last active May 17, 2021 23:57
Roll20 API: Weighted-Dice -- automated creation of rollable tables where a minimum value is weighted with values it replaces. (example d6min4 possible values: 4 4 4 4 5 6)
// GIST: https://gist.github.com/shdwjk/7a9c3ce232961662b69c
var WeightedDice = WeightedDice || {
version: 0.2,
schemaVersion: 0.1,
CheckInstall: function() {
if( ! _.has(state,'WeightedDice') || state.WeightedDice.schemaVersion != WeightedDice.schemaVersion)
{
/* Default Settings stored in the state. */
@shdwjk
shdwjk / CarryTokens.js
Last active August 29, 2015 14:03 — forked from Cazra/gist:5792605
// GIST: https://gist.github.com/shdwjk/48370c09788e11263d32/edit
// Fork of Stephen L.'s carry script
// Addition: using isGM() script for checking who is a GM
// Correction: Removed use of for(in) which was causing crashes as it parses the
// object's prototype's properties as well, not just the properties.
//
/**
* A set of chat commands used to set tokens to carry other tokens.
* When a token moves, the any tokens it is carrying move to its new location.
*
@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 / Betrayal.js
Last active October 28, 2020 18:57
Roll20 API: Betrayal at House on the Hill Card Swap Script
// GIST: https://gist.github.com/shdwjk/d97377b90de4bb37195b
var Betrayal = Betrayal || (function(){
var Tiles={
"Basement Landing": {
name: "Basement Landing",
imgsrc: "https://s3.amazonaws.com/files.d20.io/images/3482089/uhxEkm5S_TNzjP7NdCm4hg/thumb.png?1395454546",
where: [ "basement" ],
special: true,
exits: [ "north", "south", "east", "west", "Grand Staircase" ]
@shdwjk
shdwjk / Torch.js
Last active August 29, 2015 14:04
Roll20 API: Torch -- A simple script for giving lights to tokens and turning off and on dynamic lighting.
// GIST: https://gist.github.com/shdwjk/342cb67457936702fd8a
var Torch = Torch || (function() {
'use strict';
var version = 0.7,
schemaVersion = 0.1,
flickerURL = 'https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659',
flickerPeriod = 400,
flickerDeltaLocation = 2,