Skip to content

Instantly share code, notes, and snippets.

@Bastlifa
Bastlifa / FireTrapScript
Last active November 7, 2017 01:43
Fire Trap Script for Roll20. Time update help from Aaron
//A little trap
on("ready", function() {
"use strict";
var i = 0;
const millisecondsPerSecond = 1000; // handy conversion
let timeForFullSpin = 15 * millisecondsPerSecond; // rotate fully in 15 seconds
@Bastlifa
Bastlifa / gist:8a8ae5eae5696b4452e0af36a171bce3
Last active August 18, 2017 17:39
Roll20 API Script for Stress Levels
/****Stress Level Script for Matt C.****
Select a token. Click stress macro. The
macro will automatically roll some dice
and add the result to bar 3, up to 200.
If the threshold 100 is reached, a sound
will play. It will also post to chat for
any stress increase. Finally, there's a
stress reset.
You'll need to mod it to play sound.
@Bastlifa
Bastlifa / DruidShift
Last active August 19, 2020 04:08
Druid Shift Script for Roll20 D&D 5E OGL Sheet
/**************************************** Druid Shift ****************************************
This is for the 5E OGL sheet in Roll20. It will probably not work with any others without
some modification. Also, I didn't do much in the way of error checking.
The GM must make character named Druid X, where X is the creature being shifted into.
It is suggested that the GM duplicate existing creatures, rename them, and assign to the druid
player. The images for the characters must be uploaded and assigned to the avatar of the druid
form characters. The easiest way I've found it to open the character sheet, edit, right click
the picture in the avatar, copy, paste into your image program, save, upload and put it back in.
Maybe you could just upload it back into the avatar directly. Anyways, this won't work if you
@Bastlifa
Bastlifa / gist:291d456123179b335b408827a7fe24d4
Last active March 3, 2022 21:47
Threat and Momentum Report and Adjustment for Star Trek Adventures on Roll20. Simplified by Aaron.
/************************************************************************************************************
You will need to create a character named TMChar. Leave him empty, but in the attributes and abilities tab,
add two attributes: PoolThreat, and PoolMomentum. Set appropriate caps. Momentum caps at 6, I believe.
I chose 20 for a threat cap, but I'm not sure there is one. You can edit to remove the cap on threat,
or just set it very high on the sheet.
You will then need to make 5 macros, with the following bodies:
!TMReport
!TMThreatInc
!TMThreatDec
!TMMomentumInc
@Bastlifa
Bastlifa / TurnClock
Created June 3, 2017 16:08
Turnclock for roll20, with help (rewrite really) from Aaron
on("ready", function() {
"use strict";
on("chat:message", function (msg) {
var args;
if (msg.type === "api"){
args = msg.content.split(/\s+/);
if (args[0].match(/^!Clock/i)){
let time = parseInt(args[1],10)||0;
if(time){
let due = _.now()+time*1000,