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 / Hidden.js
Created September 20, 2016 02:12
Manveti's HiddenRolls script with a -q or --quiet option to suppress output to the player
var HiddenRolls = HiddenRolls || {
COMMANDS: ["!hideroll", "!hiderolls", "!hidetotal", "!hidetotals", "!hideall", "!help"],
write: function(s, who, style, from){
if (who){
who = "/w " + who.split(" ", 1)[0] + " ";
}
sendChat(from, who + s.replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br>"));
},
@shdwjk
shdwjk / NormalizePageSize.js
Created August 27, 2016 21:22
NormalizePageSize -- !nps by gm to adjust scale of all tactical maps to 5ft.
on('ready',function(){
"use strict";
var scgm=(msg)=>{
sendChat('NPS',`/w gm <div style=" margin-left: -40px; border: 1px solid #ccc; border-radius: .5em; padding: .1em .5em; background-color: #eee; font-size: 10px; font-weight: bold; "> ${msg} </div> `);
},
scaleGraphic = function(scale){
return function(graphic){
graphic.set({
left: graphic.get('left')*scale,
top: graphic.get('top')*scale,
@shdwjk
shdwjk / CreatureGenWithXP.js
Last active August 26, 2016 18:50
CreatureGen with XP field
/**
*
* Copyright (C) 2015 Ken L.
* Licensed under the GPL Version 3 license.
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Andy W.
* Shu Zong C.
* Carlos R. L. Rodrigues
/*Script goal: to simplify moving between maps in Roll20.
Specific Goals:
1. Moving a token to a designated location on a map should move the player(s) to the associated map if GM permission is set to true
2. GM should be able to enter in a specific map to travel to via API command dialog.
3. I think that's it.
*/
var INTERACTIVEMAP = INTERACTIVEMAP || (function(){
'use strict';
var version = '0.0.1',
/*
Easy Experience Script:
This script will create a character called ExperienceThresholds that it uses for most of its functionality. If there is already an
ExperienceThresholds character present, it will not make one; please make sure that you do not have a self-made ExperienceThresholds character
(highly unlikely I would think ;) )
----------------------------------------------------------------------------------------
Use the following chat commands to utilize this script:
!xp challenge @{token_id/character_id}: Adds a character's npc-xp attribute value to the Session XP tally in the ExperienceThresholds character.
!xp miscXP ###: Adds a manually entered XP value to the Session XP tally in ExperienceThresholds.
!xp session: Divides the Session XP by the number of PCs (defined as characters that have a player-name entry), adds that xp to each PC's
on('ready',function(){
"use strict";
var leftOffset = 20,
topOffset = 30,
hpleftOffset = 20,
hptopOffset = 24,
spleftOffset = 23,
sptopOffset = 34,
@shdwjk
shdwjk / AlterBars - With HealthColors Support .js
Last active March 18, 2016 02:24
Modifications to AlterBars and HealthColor (Aura/Tint) to let them work together
// VERSION INFO
var AlterBars_Version = 1.1;
// FUNCTION DECLARATION
var AlterScript = AlterScript || {};
on("chat:message", function (msg) {
// Exit if not an api command...
if (msg.type != "api") return;
@shdwjk
shdwjk / Pic.js
Created June 8, 2015 13:36
Roll20 API: Pic script I got from someone...
on('ready', function() {
on('chat:message', function(msg) {
if (msg.type == "api" && msg.content.indexOf("!pic") !== -1) {
var piclink = msg.content.split(' ')[1];
var fPart = "<div style='box-shadow: 3px 3px 2px #888888; font-family: Verdana; text-shadow: 2px 2px #000; text-align: center; vertical-align: middle; padding: 1px 1px; margin-top: 0.1em; border: 1px solid #000; border-radius: 8px 8px 8px 8px; color: #FFFFFF;"
var tPic = fPart + "background-color:#666666;'>● " + msg.who + " Shared a pic: ●</div>";
var Pic = fPart + "background-color:#AAAAAA;'><img src='" + piclink + "'></div>";
sendChat('', "/direct " + tPic + Pic);
};
});
@shdwjk
shdwjk / SotSA.js
Last active August 29, 2015 14:13
Roll20 API: SotSA -- DEBUG: outputs the state object to chat in a human readable format. (State of the State Address. =D )
// GIST: https://gist.github.com/shdwjk/25923c1cc948f272d8bd
var SotSA = SotSA || (function() {
'use strict';
var version = 0.1,
schemaVersion = 0.1,
showObj = function(obj) {
var s = JSON.stringify(obj,undefined,". "),
@shdwjk
shdwjk / RandomDepth.js
Created January 9, 2015 20:44
Roll20 API: Random Depth -- Randomly adjusts the depth of selected tokens.
//GIST: https://gist.github.com/shdwjk/0a14b06ef4da1cb5e33f
var RandomDepth = RandomDepth || (function() {
'use strict';
var version = 0.2,
randomToFrontList = function (l) {
if( l.length ) {
var i = randomInteger(l.length)-1;