Skip to content

Instantly share code, notes, and snippets.

@DarokinB
DarokinB / gist:8426111
Created January 14, 2014 21:29
[Roll20 API] Last move culcanater
var LastMoved = LastMoved || {};
LastMoved.allowNonTurnMovement = false; //If players can move when it is not
// their turn, set to true
on("change:graphic", function(obj, prev) {
//checks to see if initiative page is up
if (Campaign().get("initiativepage") !== true) return;
@DarokinB
DarokinB / gist:5961100
Created July 9, 2013 20:43
[Script] Automatic Traps / Advanced pathing system
//Settings
var TrapTracker = TrapTracker || {};
TrapTracker.GMOnly = false; //Only sends notifications to the GM
TrapTracker.Disable = false; //Defaults to enable/disable the system. Chat commands to turn on and off exist.
TrapTracker.TrapPrefix = "xTrap"; //The prefix for traps for the system to search for
TrapTracker.GMName = "DM (GM)";
TrapTracker.accuracy = 5; //The points of intersection that need to be hit to set it off. With 5, about half the square needs to be hit. Min 1;
TrapTracker.convertHTML = function(obj) {
@DarokinB
DarokinB / gist:5952022
Created July 8, 2013 20:02
[Script] Roll20: Roll Format Changer
//Global Identifier
var rollFormat = rollFormat || {};
rollFormat.CSSBGColor = "#66CCFF"; //Color of background
rollFormat.CSSbrdrColor = "blue"; //color of border
rollFormat.CSSfontColor = "black"; // color of text
rollFormat.CSSfumbleColor = "red"; //color of lowest rolls (1 on 1dX)
rollFormat.CSScriticalColor = "white"; //color of highest rolls (X on 1dX)
rollFormat.modCSS = "font-size: 1.1em;"; //Modifer size
@DarokinB
DarokinB / gist:5864579
Last active December 28, 2015 00:42
Assistance in Equipping Script
on("chat:message", function(msg) {
var equipCmd = "!Equip ";
if(msg.content.indexOf("!Equip") !== -1) {
log("Equipping: ");
// removes !equip from the string
var cleanedMsg = msg.content.replace(equipCmd, "").split(" ");
//Pulls name of the person being equipped with the weapon set in question
@DarokinB
DarokinB / gist:5826648
Last active November 9, 2020 00:09
[Roll 20 Script] Auto initiative
var Combat_Begins = Combat_Begins || {};
Combat_Begins.statName = new Array ("Dex"); //Stats to be added to roll, commas between values
Combat_Begins.rollValue = 20; //rolling 1d20, change if you roll 1dXX
Combat_Begins.sendChat = true; //True if you want the chat log to show their results
Combat_Begins.includeChars = true; //set false if you want to roll for players
//If you want players to roll, make this a global macro (add other stats as needed):
// @{selected|token_name} rolls a [[ 1d20 + @{selected|Dex} &{tracker} ]] for initiative!
@DarokinB
DarokinB / gist:5806230
Created June 18, 2013 15:16
Teleporter Without Movement Tracker
/* ************ TELEPORTING SCRIPT **************************
* The intention of this script is to allow the DM to teleport
* one or all characters to a location based on a token placed
* on the DM layer of the map.
* To activate the script, type "!Teleport " and add the name
* of the teleport location (must not contrain spaces) and then
* the name of the party member to teleport there. They must be
* seperated by commas. If you want all to teleport, type all.
* ie. !Teleport teleport01, all - teleports all players to teleport01
*
@DarokinB
DarokinB / gist:5776368
Last active April 30, 2020 16:13
Roll20 Status Tracker
/* *********** STATUS TRACKER *********************************************
* The purpose of this script is to track character and token status
* as well as durations of the status, with a reminder given on each turn.
* It allows the GM to manimpulate the controls, while players can only test
* their characters current status, if the GM allows it. It will use basic
* API commands.
* Please Note: This script will lock up one of the indicators on a token
* to show a character is under a specific effect. You can change which
* indicator to your preference.
*
@DarokinB
DarokinB / gist:5750390
Last active February 15, 2019 23:43
Roll20 Auto and Chat Teleporting
/* ************ TELEPORTING SCRIPT **************************
* The intention of this script is to allow the DM to teleport
* one or all characters to a location based on a token placed
* on the DM layer of the map.
* To activate the script, type "!Teleport " and add the name
* of the teleport location (must not contrain spaces) and then
* the name of the party member to teleport there. They must be
* seperated by commas. If you want all to teleport, type all.
* ie. !Teleport teleport01, all - teleports all players to teleport01
*
@DarokinB
DarokinB / gist:5715738
Last active January 29, 2016 13:19
Roll20 Script Movement Tracker
//Settings
var MovementTracker = MovementTracker || {};
MovementTracker.TOTALPINS = 20; //The number of pins you have on your map
MovementTracker.SQUARE_AURA = false; //Change to true if you want it to be square auras
MovementTracker.Aura1_Color = "#4a86e8"; //The double move color
MovementTracker.Aura2_Color = "#FFFFFF"; //The single move color
MovementTracker.GMName = "DM (GM)"; //The display name of the GM to override controls
MovementTracker.DISPLAY_MESSAGES = false; //Set true if you want the system to make announcements
@DarokinB
DarokinB / HP Change Log
Last active December 18, 2015 02:08
This script logs changes in your Hp (attribute) and announces them!
on("change:attribute", function(obj, prev) {
if(obj.get("name") !== "HP") return;
var damageTaken = 0;
var currentHp =0;
var oldHp = 0;
var max = 0;
var charName = getObj("character", obj.get("_characterid"));
currentHp = obj.get("current");
oldHp = prev["current"];