Skip to content

Instantly share code, notes, and snippets.

@Bastlifa
Bastlifa / witcherLifeEvent.js
Created May 15, 2020 01:56
Witcher TTRPG Life Events Script for Roll20
on("ready", function()
{
on("chat:message", function (msg)
{
if (msg.type === "api" && msg.content === "!allyEnemy")
{
allyEnemy()
}
if (msg.type === "api" && msg.content === "!fortuneMisfortune")
{
@Bastlifa
Bastlifa / CombatManeuverBatch
Created September 4, 2019 01:48
Combat Maneuver Batch Adder for Roll20 PF1
// Add other maneuvers as desired.
// Select PC tokens tokens, hit !CombatManeuverBatch
var generateUUID = (function() {
"use strict";
var a = 0, b = [];
return function() {
var c = (new Date()).getTime() + 0, d = c === a;
a = c;
@Bastlifa
Bastlifa / TableMaker.js
Created December 17, 2018 03:00
Roll20 Table Maker via Blank Character Sheet
//TableMaker
//Make a character with no sheet.
//All attributes are table entries, all current values are weights.
//Drag token (can be default) to canvas. Select it. Type !TableMaker <table name> into chat and hit enter
//Table name must use dashes for spaces (probably)
//Transmog your table over to whatever game you need it for.
//This probably sucks, don't use it.
on("ready", function() {
@Bastlifa
Bastlifa / AddWep.js
Last active November 21, 2018 06:38
Add Weapon to FFG SW Sheets on Roll20
on("ready", function() {
on('chat:message', function(msg) {
if (msg.type === "api" && msg.content.split(' ')[0] === "!AddWep")
{
// strips the first bit off of the api command
let weaponName = msg.content.replace("!AddWep ", "");
AddWep(msg, weaponName);
}
});
});
@Bastlifa
Bastlifa / FamiliarSightSwap.js
Created September 28, 2018 23:17
Familiar Sight Swap for Roll20 D&D 5E
//Familiar Sight Swap
// make a macro with body:
// !SwapSight PlayerTokenName FamiliarTokenName
on("ready", function() {
on("chat:message", function (msg) {
if (msg.type === "api" && msg.content.split(' ')[0] === "!SwapSight") {
SwapSight(msg);
@Bastlifa
Bastlifa / DiceSetup.js
Last active April 8, 2021 08:45
Dice Macro Setup for roll20: buttons make for faster rolling.
on("ready", function()
{
on("chat:message", function (msg)
{
if (msg.type === "api" && msg.content === "!DiceMacroSetup")
{
if (playerIsGM(msg.playerid))
{
if (!findObjs({_type: 'macro', _playerid: msg.playerid, name: 'd2'})[0])
{
@Bastlifa
Bastlifa / ShapeMakerSFHud
Last active July 26, 2023 14:10
ShapeMaker for Roll20 Starfinder HUD Sheet
//TemplateGenerator
//Fill in the table TemplateShapes that the script makes using the images from the imgur link
//imgur link: https://imgur.com/a/vekJIAg
//Also make a macro called ShapeMaker or something, body should read: !ShapemakerMacro
//Share that macro with all players.
//Warning! This only works on the page that the player tab is on. Make sure to select a token before clicking the shape
on("ready", function() {
@Bastlifa
Bastlifa / TemplateGenMacro
Last active September 15, 2020 20:51
Roll20 API Script to create aoe templates at tokens.
&{template:npcaction} {{name=Size and Shape}} {{rname=Shape Maker}} {{description=**Circle Radius**
[5 ft](!TemplateGenerator Circle 5) | [10 ft](!TemplateGenerator Circle 10) | [20 ft](!TemplateGenerator Circle 20) | [30 ft](!TemplateGenerator Circle 30) | [40 ft](!TemplateGenerator Circle 40)
________________________
**Square Side**
[10 ft](!TemplateGenerator Square 10) | [15 ft](!TemplateGenerator Square 15) | [20 ft](!TemplateGenerator Square 20) | [40 ft](!TemplateGenerator Square 40)
________________________
**Cones**
[60](!TemplateGenerator Cone 60 135) -------- [60](!TemplateGenerator Cone 60 90) -------- [60](!TemplateGenerator Cone 60 45)
----[30](!TemplateGenerator Cone 30 135) ---- [30](!TemplateGenerator Cone 30 90) ---- [30](!TemplateGenerator Cone 30 45)----
--------[15](!TemplateGenerator Cone 15 135) [15](!TemplateGenerator Cone 15 90) [15](!TemplateGenerator Cone 15 45)---------
@Bastlifa
Bastlifa / Faces.js
Created November 24, 2017 23:31
Face Changing API Script for Roll20
/*
* A Simple face changing script.
* Make a rollable table with the character name (one word characer name) plus -Faces
* Example, character named John Smith
* Table name is John-Faces
* Fill table with face names, and pictures which you have uploaded. Can't be from purchase or search
* Must be uploaded to your library.
* Make macro with this body, as token action macro:
* !FaceChange John-?{Face|Normal|Soldier|Popper|Pirate|Noble|Elder|Cleric}
* Where those options (other than the title "Face") are the names of the items in your rollable table.
@Bastlifa
Bastlifa / ShowHealth.js
Created November 24, 2017 23:23
Roll20 API script to show the health of any tokens on the object layer on the current map the GM is looking at.
on("ready", function() {
on("chat:message", function (msg) {
if (msg.type === "api" && msg.content === "!ShowHealth")
{
var page = getObj('page', getObj('player',msg.playerid).get('lastpage')).id;
var tokens = findObjs({type: 'graphic', _pageid: page});
for (var i=0; i<tokens.length; i++)
{
if (tokens[i].get("bar1_value"))