Skip to content

Instantly share code, notes, and snippets.

@BaldarSilveraxe
BaldarSilveraxe / SpaceTest.js
Last active August 29, 2015 14:23
SpaceTest
var SpaceIndustryTiles = (function () {
'use strict';
var textures = [];
textures['space'] = [
{key: '001', url: 'https://s3.amazonaws.com/files.d20.io/images/10242180/lfUyZAeGDrxAhNxZvyShXw/thumb.jpg?1434626840', w: 840, h: 840},
{key: '002', url: 'https://s3.amazonaws.com/files.d20.io/images/10242168/Y-M1W0io3XRhVNY_9cG2Kw/thumb.jpg?1434626836', w: 840, h: 840},
{key: '003', url: 'https://s3.amazonaws.com/files.d20.io/images/10242175/7VTy7MQPF0utcQFsq_76zA/thumb.jpg?1434626838', w: 840, h: 840},
{key: '004', url: 'https://s3.amazonaws.com/files.d20.io/images/10242164/PUjMZwsFbYRnBC01lilM7A/thumb.jpg?1434626834', w: 840, h: 840},
{key: '005', url: 'https://s3.amazonaws.com/files.d20.io/images/10242167/UjwTYXjE1dC4XDx3AC7ekg/thumb.jpg?1434626836', w: 840, h: 840},
/*global sendChat, createObj, getObj, toFront, state, _, log, on*/ /*jslint white: true */
var tokenSlider = tokenSlider || (function(){
'use strict';
var version = 0.1,
lastUpdate = 1439553559,
schemaVersion = 0.1,
sliderURL = 'https://s3.amazonaws.com/files.d20.io/images/11533373/FMkZYp0p7Si1FIEPe-94mg/thumb.png?1439570208',
sliderAction = function(represents) {
sendChat('tokenSlider','For Token: ' + represents);
//Do something
/*global sendChat, createObj, getObj, toFront, state, _, log, on*/
/*jslint white: true */
var stopTalkingYouTwo = stopTalkingYouTwo || (function(){
'use strict';
var version = '0.1.0',
whisperUrl = 'https://s3.amazonaws.com/files.d20.io/images/11583165/eABhjOsunqhKHto2aRQ96A/thumb.png?1439727668',
whisperPing = function(currentPageGraphics) {
_.each(currentPageGraphics, function(obj) {whisperPingeer(obj); });
},
@BaldarSilveraxe
BaldarSilveraxe / AOEDrawer
Last active September 6, 2015 01:44
AOEDrawer Roll20 API
/*global sendChat, createObj, getObj, toFront, toBack, state, _, log, on, filterObjs, setTimeout, playerIsGM*/
/*jslint white: true */
var AOEDrawer = AOEDrawer || (function(){
'use strict';
//breakcode = breakcode
var version = 0.81,
lastUpdate = 1440326236,
schemaVersion = 0.81,
//Default Settings
@BaldarSilveraxe
BaldarSilveraxe / SpellArray
Last active October 10, 2015 19:29
Public DnD 5E Spells
roll20API.spelllist = [
{
Call:"acid_splash",
Name:"Acid Splash",
Class:"Sorcerer,Wizard",
SubClass:"",
Ritual:"N",
Concentration:"N",
Level:"0",
School:"Conjuration",
@BaldarSilveraxe
BaldarSilveraxe / SpellManager
Last active November 11, 2015 00:11
Roll20 API for Spell Management of public DnD 5E Spells
//SpellArray Gist: https://gist.github.com/BaldarSilveraxe/b870375736cce7a7bee0
///Googl File: https://docs.google.com/spreadsheets/d/1U0zeNzWa5ntISV8ILpldk6VsH0UtwIinuTx0NFjbAh0/edit?usp=sharing
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);
@BaldarSilveraxe
BaldarSilveraxe / Process_Critical
Created November 27, 2013 10:48
Roll20 API code for critical hits and misses. Creates two handouts for the GM and updates them when called.
//API:Events:ChatMessage:processAPIswitch:common:critical**********************************************
roll20API.processAPIcritical = function() {
var MeleeArmed = new Array();
MeleeArmed[0] = {Code: "FGM", Text: "Lost Footing"};
MeleeArmed[1] = {Code: "DPM", Text: "Drop Weapon"};
MeleeArmed[2] = {Code: "SIM", Text: "Self Injury"};
MeleeArmed[3] = {Code: "EGA", Text: "Entangle With Foe"};
MeleeArmed[4] = {Code: "TWM", Text: "Twist Muscle"};
MeleeArmed[5] = {Code: "SDM", Text: "Scenery Disadvantage"};
MeleeArmed[6] = {Code: "WMM", Text: "Wardrobe Malfunction"};
var roll20API = roll20API || {};
//NOTES:
//
//***Display Names***
//Display Names should be one word, nospaces or special characters and distinct.
//
//***roll20API.Owner = "135636"***
//Campaign Owner. You can find your own personal user id by visiting the wiki and clicking on your name in the
//left-hand sidebar. On your wiki page you will see "Home » User:#" below your name on your userpage, where #
//is your user id.
@BaldarSilveraxe
BaldarSilveraxe / Chronos_Tables
Last active December 30, 2015 05:09
Roll20 Calendar and weather script tables...
//Chronos Record Sheet Attributes Array
roll20API.attribs = [];
roll20API.attribs["Year"] = {name: "Year", current: "00000", max: null};
roll20API.attribs["Month"] = {name: "Month", current: "08", max: null};
roll20API.attribs["Day"] = {name: "Day", current: "01", max: null};
roll20API.attribs["Hour"] = {name: "Hour", current: "00", max: null};
roll20API.attribs["Minute"] = {name: "Minute", current: "00", max: null};
roll20API.attribs["Region"] = {name: "Region", current: "Temperate", max: null};
roll20API.attribs["Terrain"] = {name: "Terrain", current: "Forest", max: null};
roll20API.attribs["Temp High"] = {name: "TempHigh", current: "+085", max: null};
@BaldarSilveraxe
BaldarSilveraxe / Process_Chronos_Main
Last active December 30, 2015 05:09
Roll20 Calendar and weather scpits
//API:Events:ChatMessage:processAPIswitch:Chronos:add**********************************************
roll20API.processAPIaddChronos = function() {
//Add Chronos sheet if needed
if(findObjs({ _type: "character", name: "GM_Chronos" }).length == 0){
createObj("character", {
name: "GM_Chronos",
bio: "Text Here"
});
GM_ChronosObject = findObjs({ _type: "character", name: "GM_Chronos" })