Skip to content

Instantly share code, notes, and snippets.

@keithcurtis1
keithcurtis1 / Hands Up Modified
Created February 3, 2024 22:29
Styles the text notification in the chat
var HandsUp = (() => {
'use strict';
/**
* The hand-raising state for a player.
* @typedef {object} HandState
* @property {number} intervalId
* @property {string} origColor
*/
@keithcurtis1
keithcurtis1 / gist:29d0d608996630d0e49252b950fac390
Created January 31, 2024 22:08
Fix Journal Command Buttons
on('ready',()=>{
const JournalCommandDecoder = (t) => {
const fixStart = t => t.replace(/^"https:\/\/app.roll20.net\/editor\/%60/,'"`');
const percentOut = t => t.replace(/%{/g,'::PERCENT_OPEN_CURLY::');
const percentIn = t => t.replace(/::PERCENT_OPEN_CURLY::/g,'%{');
return percentIn(decodeURIComponent(percentOut(fixStart(t))));
};
var API_Meta = API_Meta || {};
API_Meta.dltool = {
offset: Number.MAX_SAFE_INTEGER,
lineCount: -1
}; {
try {
throw new Error('');
} catch (e) {
API_Meta.dltool.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7));
}
var API_Meta = API_Meta || {}; //eslint-disable-line no-var
API_Meta.Condefinition = {
offset: Number.MAX_SAFE_INTEGER,
lineCount: -1
}; {
try {
throw new Error('');
} catch (e) {
API_Meta.Condefinition.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (7));
}
@keithcurtis1
keithcurtis1 / Supernotes 020b
Last active December 7, 2022 02:32
Supernotes with custom templates
var API_Meta = API_Meta || {};
API_Meta.Supernotes = {
offset: Number.MAX_SAFE_INTEGER,
lineCount: -1
}; {
try {
throw new Error('');
} catch (e) {
API_Meta.Supernotes.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (4));
}
tell application "Adobe InDesign 2022"
--return selection
set tableexport to ""
set theTables to every table of every text frame of front document
--return item 1 of theTables
set theParent to parent of item 2 of theTables
set bob to contents of row 2 of item 2 of theTables
var API_Meta = API_Meta || {};
API_Meta.Pingbuddy = { offset: Number.MAX_SAFE_INTEGER, lineCount: -1 };
{
try { throw new Error(''); } catch (e) { API_Meta.Pingbuddy.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (4)); }
}
/*########################
PingBuddy by Keith Curtis, including code adapted from Nick Olivo
Forum thread: https://app.roll20.net/forum/post/11095028/script-ping-buddy
Script repo: https://gist.github.com/keithcurtis1/536c5e575e4ef6ba40a519eca17b392a
on("ready", function () {
const theGM = findObjs({
type: 'player'
})
.find(o => playerIsGM(o.id));
on("change:campaign:playerpageid", function () {
setTimeout(function () {
pingPlayerToken();
},
@keithcurtis1
keithcurtis1 / Roll20 Minor Forum Tweaks
Created August 4, 2022 18:17
Quick forum tweaks for Roll20
/* categories */
.chosen-choices {
position: absolute !important;
max-height: 27px;
top: -14px;
-webkit-transition: all .25s linear;
}
.chosen-choices:hover, .chosen-choices:active {
max-height: inherit;
-webkit-transition: all .25s linear;
@keithcurtis1
keithcurtis1 / faces.js
Last active October 7, 2022 07:04
Script to change token faces on Roll20
var API_Meta = API_Meta || {};
API_Meta.Faces = {
offset: Number.MAX_SAFE_INTEGER,
lineCount: -1
}; {
try {
throw new Error('');
} catch (e) {
API_Meta.Faces.offset = (parseInt(e.stack.split(/\n/)[1].replace(/^.*:(\d+):.*$/, '$1'), 10) - (4));
}