Skip to content

Instantly share code, notes, and snippets.

View rlittlefield's full-sized avatar

Ryan Littlefield rlittlefield

View GitHub Profile
@rlittlefield
rlittlefield / Roll20TokenSnapshotAndClasses.js
Last active May 29, 2016 17:23
Roll20 - Graphic/Token snapshot saving/loading for building your own macros
/*
Copyright (c) 2013 J. Ryan Littlefield
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@rlittlefield
rlittlefield / gist:5493842
Last active December 16, 2015 20:39
Roll20 API: reveal command by class
var getByClasses = function(classes, criteria) {
var graphics = findObjs({
_pageid: Campaign().get("playerpageid"),
_type: "graphic",
});
var cclasses = {};
for (var i = 0, il = classes.length; i < il; i++) {
cclasses['.'+classes[i]] = true;
}