Skip to content

Instantly share code, notes, and snippets.

@BaldarSilveraxe
BaldarSilveraxe / E Spell Management System
Last active August 29, 2015 14:06
E Spell Management System
var roll20API = roll20API || {};
roll20API.AbjurationURL = "https://s3.amazonaws.com/files.d20.io/images/5586844/rcLDFgVjvGTtePvJ-681pg/thumb.png?1410738695";
roll20API.ConjurationURL = "https://s3.amazonaws.com/files.d20.io/images/5586847/n156karksxGXY0nzUEyk9w/thumb.png?1410738696";
roll20API.DivinationURL = "https://s3.amazonaws.com/files.d20.io/images/5586852/qSdZ682ZbKyjNxN2LjkSOw/thumb.png?1410738699";
roll20API.EnchantmentURL = "https://s3.amazonaws.com/files.d20.io/images/5586853/JddRZXofOfQcliHENYbO4w/thumb.png?1410738699";
roll20API.EvocationURL = "https://s3.amazonaws.com/files.d20.io/images/5586855/FWcn_55a8FUI5PL0uwyzDg/thumb.png?1410738700";
roll20API.IllusionURL = "https://s3.amazonaws.com/files.d20.io/images/5586836/hPFiw2NZd_NBus7dp3gTNQ/thumb.png?1410738691";
roll20API.NecromancyURL = "https://s3.amazonaws.com/files.d20.io/images/5586835/1ybbxZinU7bItV07K5nWUA/thumb.png?1410738691";
roll20API.TransmutationURL = "https://s3.amazonaws.com/files.d20.io/images
on("ready", function() {
on("chat:message", function (msg) {
if (msg.type != "api") return;
msg.who = msg.who.replace(" (GM)", "");
msg.content = msg.content.replace("(GM) ", "");
var command = msg.content.split(" ", 1);
if(command == "!createMap") {createMap();};
});
});
@BaldarSilveraxe
BaldarSilveraxe / DungeonReadyImageSetup.js
Last active August 29, 2015 14:10
DungeonReadyImageSetup
function dungeonreadytiles(action) {
var dungeonReadyTiles = [
{name: "Geo_B_0001", shortName: "0001", edge: false, corner: false, entrance: false, connections: 0, side: 0, sample: "6394851/qTICq2-wIRiPAQLPKJPZxA/med.jpg?1416264499"},
{name: "Geo_B_0002", shortName: "0002", edge: false, corner: false, entrance: false, connections: 2, side: 1, sample: "6394853/g4WzTQB7_Vi2ESuBHRo2Fw/med.jpg?1416264511"},
{name: "Geo_B_0003", shortName: "0003", edge: false, corner: false, entrance: false, connections: 2, side: 2, sample: "6394855/1FZhOFWMOa3ytVsRvP9sWQ/med.jpg?1416264522"},
{name: "Geo_B_0004", shortName: "0004", edge: false, corner: false, entrance: false, connections: 2, side: 3, sample: "6394858/NMiQBhwXAGqJxf0DwXhNHQ/med.jpg?1416264533"},
{name: "Geo_B_0005", shortName: "0005", edge: false, corner: false, entrance: false, connections: 2, side: 4, sample: "6394860/K5gQosh6CK8FYlbpwWso0w/med.jpg?1416264542"},
{name: "Geo_B_0006", shortName: "0006", edge
@BaldarSilveraxe
BaldarSilveraxe / GeoTableChecker
Last active August 29, 2015 14:11
Roll20 Script
on("ready", function() {
on("chat:message", function(msg) {if(msg.type == "api"){processMessage(msg)};});
});
processMessage = function(msg) {
if(msg.type !== "api"){return};
if(msg.content == "!gettable"){gettable();}
};
gettable = function(msg) {
var tableName = "GeomorphicTiles";
var geomorphicTilesCheck = [
@BaldarSilveraxe
BaldarSilveraxe / DungeonReadyDoors
Last active August 29, 2015 14:11
Roll20 API to be used with Dungeon Ready Tiles and scripts
// GIST: https://gist.github.com/BaldarSilveraxe/3b09ede4260a39ab491c
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~
!readydoors
~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
var DungeonReadyDoors = DungeonReadyDoors || (function(){
'use strict';
var version = 0.1,
@BaldarSilveraxe
BaldarSilveraxe / NoSelectControl
Created December 20, 2014 16:19
Roll20 API to control tokens you can not select.
var NoSelectControl = NoSelectControl || (function() {
'use strict';
var version = 0.1,
handleMessages = function(msg)
{
if('api' !== msg.type ) {
return;
}
@BaldarSilveraxe
BaldarSilveraxe / featurePath
Last active August 29, 2015 14:20
Roll20 API feature script based on polygon path on the GM layer
var featurePath = featurePath || (function(){
'use strict';
var version = '0.1.1',
lastUpdate = 1430550687,
schemaVersion = '0.1.1',
objExtractKeysGraphic = ['id','pageid','layer','width','height','top','left'],
objExtractKeysPath = ['id','pageid','layer','width','height','top','left','path','stroke'],
var activeMap = activeMap || (function(){
'use strict';
var version = '0.2.0',
lastUpdate = 1430550687,
schemaVersion = 0.3,
objExtractKeys = ['id','pageid','stroke','rotation','layer','width','height','top','left','controlledby',
'imgsrc', 'flipv', 'fliph'],
@BaldarSilveraxe
BaldarSilveraxe / DungeonDrawUpdateTest
Created June 17, 2015 15:41
Dungeon Draw Update Test
var DungeonDraw = DungeonDraw || (function(){
'use strict';
//settings
var defaultTexture = 'Old School|#18769c',
cssButtonAnchor = ' style="border: 1px solid AliceBlue; background-color: SteelBlue; color: white;" ',
cssButtonSpan = ' style="color: white; font-weight: normal; display: block; width: 150px;" ',
cssButtonAnchorImg = ' style="border: 1px solid Black; background-color: White; color: white;" ',
cssButtonImg = ' style="padding: 0px 0px 0px 0px; outline: none; border: none;" ',
deferred={
@BaldarSilveraxe
BaldarSilveraxe / DungeonDrawDoorUpdate
Created June 17, 2015 18:35
Dungeon Draw Door Update Test
var DungeonDrawDoors = DungeonDrawDoors || (function(){
'use strict';
//version = 2.9
//lastUpdate = 1430236079 //Unix timestamp
//schemaVersion = 2.9
var defaultTexture = 'Old School|#18769c',
//light settings
light_radius_setting = 30,