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 / SimpleInitiative.js
Created July 16, 2023 14:45
SimpleInitiative -- Fixed for pageid issue with turnorder.
// VERSION INFO
var SimpleInitiative_Author = "Sky";
var SimpleInitiative_Version = "1.4.1";
var SimpleInitiative_LastUpdated = 1530594275;
// VARIABLE DECLARATIONS
var SHOW_GREEN_DOT = true;
var ANNOUNCE_NEW_TURN = true;
var PC_COLOR = "#073763";
var NPC_COLOR = "#440000";
@shdwjk
shdwjk / SpeechBalloon.js
Last active March 24, 2023 21:47 — forked from BaldarSilveraxe/SpeechBalloon
Roll20 SpeechBalloon
const SpeechBalloon = (() => { // eslint-disable-line no-unused-vars
const version = 0.1; // eslint-disable-line no-unused-vars
const schemaVersion = 0.4;
const defaultShowLength = 4; // seconds
const msPerSec = 1000; // for conversions.. no magic numbers!
const checkStepRate = 1000; //ms = 1 second
@shdwjk
shdwjk / MonsterManager.js
Created May 11, 2020 11:26
Fixed Chris S. MonsterManager
// Monster Management Script
// Usage: !monster import // This will read the "Monster Import" handout, and import it in to roll20.
// See monster-import.txt for example formatting. The regular expressions that power this system should
// be capable of parsing most monster entries from the SRD, as well as the Monster Manual(s).
// Let me know if you find a monster that fails to parse properly!
// !monster generate (MonsterName) // Select 1 or more monsters, then run this command. All selected tokens
// will be linked to the applicable monster's sheet, and have their health bar (bar1) populated with a randomly
// rolled min/max hitpoint value, derived from the monster's HD. Bar2 will be filled with notes relevant to the monster
// (If using my TokeNotes script), and bar3 will be populated with the monster's AC.
// !monster clear-all // Removes all automatically generated monsters.
@shdwjk
shdwjk / summonWithIds.js
Created March 22, 2020 03:42
King's Summon with Last Created ID/IDs
/*
This is an improved Summoning API that was built upon.
Original author: Brandon W.
Original here: https://app.roll20.net/forum/post/466778/scipt-auto-create-a-token#post-466778
Special thanks to Brian for helping me with some of the script.
I hope this serves others well, do not hesistate to contact me regarding bugs or improvements.
-GM King
@shdwjk
shdwjk / gmnote.js
Last active January 20, 2019 15:00 — forked from keithcurtis1/gmnote.js
This pulls the GM notes from a token on Roll20 and whispers them to the chat
on('ready',()=>{
const blockElements = [
'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'pre', 'address',
'blockquote', 'dl', 'div', 'fieldset', 'form', 'hr', 'noscript', 'table','br'
];
const rStart=new RegExp(`<\\s*(?:${blockElements.join('|')})\\b[^>]*>`,'ig');
const rEnd=new RegExp(`<\\s*\\/\\s*(?:${blockElements.join('|')})\\b[^>]*>`,'ig');
const getLines = (str) =>
@shdwjk
shdwjk / TempHP.js
Created January 11, 2019 01:50
AssureTempHPMarkers
/* global TokenMod, ChatSetAttr */
on('ready', () => {
// Configuration parameters
const HPBarNum = 3;
const TempHPMarker = 'chained-heart';
const DeadMarker = 'dead';
const TempHPAttributeName = 'temp_hp';
/////////////////////////////////////////////
@shdwjk
shdwjk / auraHealth.js
Created March 31, 2018 19:44
DXWarlock's HealthColors Script -- with TokenMod Support
/* global createObj TokenMod spawnFxWithDefinition getObj state playerIsGM sendChat _ findObjs log on*/
/*
My Profile link: https://app.roll20.net/users/262130/dxwarlock
GIT link: https://github.com/dxwarlock/Roll20/blob/master/Public/HeathColors
Roll20Link: https://app.roll20.net/forum/post/4630083/script-aura-slash-tint-healthcolor
*/
/*jshint bitwise: false*/
var HealthColors = HealthColors || (function () {
'use strict';
var version = '1.5.1',
/*
Calendar for Mundana
Created by Kirsty (https://app.roll20.net/users/1165285/kirsty)
and sabotaged to an extreme extent by dancodan, also cramed in some swedish here and there..
Many thanks to Aaron (https://app.roll20.net/users/104025/the-aaron) for his NoteLog script, parts of which I "borrowed"
API Commands:
!cal (as Player) - Shows world, date, time, moon, weather and counted days
!cal (as GM) - Same as player but includes options to advance the date/time, alter the weather, add a note or view the settings menu.
!calSet (GM only) - Allows the GM to change the world, date, time display, show/hide days until full moon, adjust day counter or set the start date
Red Colour: #7E2D40
// Ported from: https://github.com/josephg/noisejs
/*
Perlin.seed(134123);
let v1 = Perlin.perlin2(0.5,0.5);
*/
/*
* A speed-improved perlin and simplex noise algorithms for 2D.
*
* Based on example code by Stefan Gustavson ([email protected]).
@shdwjk
shdwjk / normalizePageScale
Last active November 3, 2017 01:14
Normalize Page Scale. !nps for the current page or !nps-all for all pages.
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,