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 / 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 / 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 / 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 / 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 = {
@shdwjk
shdwjk / TableExport.js
Last active January 26, 2021 01:16
Roll20 API: TableExport -- A script for exporting Rollable Tables between accounts.
Use this version instead:
https://github.com/shdwjk/Roll20API/blob/master/TableExport/TableExport.js
@shdwjk
shdwjk / EoERangeBands.js
Last active August 29, 2015 14:06
Roll20 API: EoERangeBands -- A reorganization of Dylan C. and Trent F.'s Edge of the Empire Range Bands script.
// GIST: https://gist.github.com/shdwjk/437a80205ab5b7947466
var EoERangeBands = EoERangeBands || (function() {
'use strict';
var version = 0.2,
shortRange = 10,
mediumRange = 50,
shortBand = {
@shdwjk
shdwjk / LokiTrapMan.js
Created September 5, 2014 14:49
Roll20 API: LokiTrapMan -- reoganization of Loki's trap script.
// GIST: https://gist.github.com/shdwjk/054574d39c166d50865c
var LokiTrapMan = LokiTrapMan || ( function() {
'use strict';
// Here is the bulk of where you define a trap and cusomize the events. This is an array of all traps on your campaign (I only have 1 defined).
// Trap coordinates are defined in squares, not pixals. A trap location is defined as a rectange having two points (x1,y1 to x2,y2)
// Set the pageID and region of the trap and when a token enters this area the defined callback in the array will be triggered.
var traps = [
// In this example when a charater lands next to (or on) a placed npc he (and his campfire) disappears in a firey explosion.