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 / 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 / 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 / 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,
@shdwjk
shdwjk / Ammo.js
Last active August 29, 2015 14:04
Roll20 API: Ammo - provides inventory management for ammunition stored in an attribute of a character.
// GIST: https://gist.github.com/shdwjk/79a60b8d2ee58e87604d
var Ammo = Ammo || (function() {
'use strict';
var version = 0.11,
adjustAmmo = function (playerid,attr,amount) {
var val = parseInt(attr.get('current'),10)||0,
max = parseInt(attr.get('max'),10)||10000,
@shdwjk
shdwjk / EdgeOfTheEmpireDice.js
Last active August 29, 2015 14:04
Roll20 API: Edge Of The Empire Dice -- Fixed version of Konrad J.'s script.
// GIST: https://gist.github.com/shdwjk/4064a6b2e12bcfc46f49
// Aaron's updated version.
// Fixed: character update to only do one findObjs() call, instead of
// (((15*5)+1)*NUM Characters) times (that's 2280 times for 30 characters).
//
// Edge of the Empire RPG Dice Mechanics
//
// copyright pug games 2014
// please feel free to use this script, change it, add to it in any way you feel
// Script created by Roll20 user Konrad J.
@shdwjk
shdwjk / CharUtils.js
Last active August 29, 2015 14:04
Roll20 API: CharUtils -- A Collection of utilities for manipulating Characters.
// GIST: https://gist.github.com/shdwjk/a65bae32d700a00a9c47
var CharUtils = CharUtils || (function() {
'use strict';
var version = 0.51,
fixNewObj= function(obj) {
var p = obj.changed._fbpath,
new_p = p.replace(/([^\/]*\/){4}/, "/");
@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 / UsePower.js
Last active August 29, 2015 14:05
Roll20 API: UsePower -- A script for instrumenting and tracking the use of encounter and daily powers.
// GIST: https://gist.github.com/shdwjk/d11b7f41b204a8444f2f
var UsePower = UsePower || (function() {
'use strict';
var version = 0.31,
schemaVersion = 0.1,
ch = function (c) {
var entities = {