Skip to content

Instantly share code, notes, and snippets.

View Cazra's full-sized avatar

Ada Lindberg Cazra

View GitHub Profile
@Cazra
Cazra / gist:5737453
Last active December 18, 2015 06:08
This is a script for a "heal" chat command for the roll20 virtual tabletop API.
// This is a "heal" chat command for the roll20 virtual tabletop API.
// It can be used to heal all 3 bars for a token by name,
// or you can have it heal the tokens for all the characters in your campaign's journal.
//
// E.g:
// Healing one character named "Dave the Dwarf":
// !heal Dave the Dwarf
//
// Healing all characters
// !heal all
@Cazra
Cazra / gist:5737747
Created June 9, 2013 05:23
roll20 character token locator script
// This is a script for a chat command that can be used to find a character
// token you've misplaced on the map. It can work two ways:
// You can specify a token by name, say "Dave the Dwarf", with
// !find Dave the Dwarf
// or you can find the token for your character with
// !find me
//
// How it works is it generates a very large temporary aura on the token.
// The aura shrinks and you can follow it in.
//
@Cazra
Cazra / gist:5765350
Created June 12, 2013 13:42
Java String utility Converts all decimal integers in a string to hex.
/**
* Converts all decimal numbers in a string to hex.
* @param src The source string, possibly containing decimal numbers.
* @return The source string with all decimal numbers replaced by
* their equivalent hex numbers.
*/
public static String decimalInStringToHex(String src) {
String result = "";
int last = 0;
@Cazra
Cazra / gist:5771375
Last active December 18, 2015 10:49
roll20 Marching Order script.
/**
* A set of chat commands used to specify a marching order.
* When a token moves, the one behind it in the marching order will move to its
* former location recursively.
*
* The following commands are available:
* !follow [myTokName], [leaderName] Tells your token specifed by myTokName
* to follow another token specified by leaderName.
* !unfollow [myTokName] Makes your token stop following other tokens.
* You can also have a token stop following another token just by
@Cazra
Cazra / gist:5792605
Last active December 18, 2015 13:49
roll20 api script for having tokens be able to carry other tokens.
/**
* A set of chat commands used to set tokens to carry other tokens.
* When a token moves, the any tokens it is carrying move to its new location.
*
* The following commands are available:
* !carry [carrierName], [carriedName'] Tells your token specified by carrierName
* to carry another token. The carried token will remain in place
* uder the carrier token.
* !drop [carrierName], [carriedName] Tells your token to drop a carried token.
* !dropAll [carrierName] Tells your token to drop all carried tokens.
@Cazra
Cazra / gist:8059943
Last active December 31, 2015 23:28
Roll20 API script: Checks if a character token moved through a trapped square during its movement.
/**
* A script that checks the interpolation of a token's movement to detect
* whether they have passed through a square containing a trap.
*
* A trap can be any token on the GM layer for which the cobweb status is
* active. Flying tokens (ones with the fluffy-wing status or angel-outfit
* status active) will not set off traps unless the traps are also flying.
*
* This script works best for square traps equal or less than 2x2 squares or
* circular traps of any size.
@Cazra
Cazra / gist:8347581
Created January 10, 2014 05:54
roll20 API familiar summon (broken)
// This script allows the players to summon their familiars.
// When summoned, the familiar appears in their
// master's square.
on("chat:message", function(msg) {
var cmdName = "!familiar";
var msgTxt = msg.content;
var curPageID = Campaign().get("playerpageid");
// map of familiars to images.
var familiarImages = {};
@Cazra
Cazra / css
Last active August 29, 2015 14:03
My Little Pony: Roleplaying is Magic, Season 3 edition character sheet
.charsheet label {
display: inline-block;
width: 75px;
text-align: right;
}
.charsheet .sheet-attrBox {
display:table-cell;
border:solid;
border-width:1px;
@Cazra
Cazra / css
Last active August 29, 2015 14:03
My Little Pony: Roleplaying is Magic, Season 4 edition
.charsheet {
background-image: url("https://sites.google.com/site/roleplayingismagichome/_/rsrc/1385907608270/config/WebsiteBackground_Rough.png.1385907608112.png");
height: 80%;
width: 100%;
}
.charsheet .sheet-everything {
height: 90%;
margin: 10px 40px;
width: 80%;
@Cazra
Cazra / gist:2378ab5a8a0ec3c208bf
Last active August 29, 2015 14:05
roll20 follow v2
/**
* A script with a command for specifying tokens to follow other tokens.
* Simply select the tokens in the marching order and enter the "!follow"
* commandwith either a direction for the marching order of the selected tokens
* or the name of a token for the selected tokens to follow behind.
*
* E.G. "!follow west" will make the selected tokens follow each other in order
* from east to west, with the westmost token being the leader and the eastmost
* token being the caboose.
* Alternatively if we want the selected tokens to follow a character named