Skip to content

Instantly share code, notes, and snippets.

@birdbrainiac
birdbrainiac / createjournal
Created September 14, 2018 08:36 — forked from fmonaca/createjournal
Creates an empty HERO System character sheet in Roll20
on('chat:message', function(msg) {
if(msg.type == 'api' && msg.content.indexOf('!newsheet ') != -1)
{
var name = msg.content.substring(10);
var ocharacter = findObjs({
_type: "character",
_name: name,
});
if(ocharacter.length==0)
@birdbrainiac
birdbrainiac / locations
Created September 14, 2018 08:36 — forked from fmonaca/locations
HERO System combat locations (rollable table) for Roll20
on("chat:message", function(msg) {
if(msg.type == "api" && msg.content == "!tableread") {
var locsMalus = [8,6,5,5,3,7,8,4,6,8];
var oTable = findObjs({name: "locs",_type: "rollabletable"});
var oItems = findObjs({_type: "tableitem", _rollabletableid: oTable[0].id});
for(var i=0;i<oItems.length;i++)
{
log("aLocsModifier["+i+"] = ["+locsMalus[i]+",'"+oItems[i].get('avatar')+"'];");
}
}
@birdbrainiac
birdbrainiac / effects
Created September 14, 2018 08:36 — forked from fmonaca/effects
HERO Effects script, manages timed effects and spells like Drain, Aid, Entangle. Part of the HERO combat system scripts for Roll20
// {effect}[id]|[type:n[fixed/dice]]|[attribute]|[defence]|[frequency(type)][duration(number and type)][counter(0)][active][description][marker]{/effect}
// id a numeric, unique id - It is auto-generated when the Effect is applied by the macro
// dam:n[d/f]|aid:n[d/f]|fla:n[d]|ent:n[d] dam = damage (can also be used as a drain), aid = aid, fla = flash (not implemented yet), ent = entangle,
// n = number of dice | fixed value of effect, I.e. 3 dice of damage is dam:3d
// Special: if dam is set to 0 fixed, it means the attribute(s) is zeroed, if it is set to -1 fixed, the attribute(s) is halved - i.e. dam:0f, dam:-1f
// normal|killing|body|stun|str|dex|con|int|ego|pre|run|ocv|dcv|omcv|dmcv|end|pd|ed|rec|spd stat affected, can be more than one separated by "/". Type and hasDef are then common to all attributes in the list, though.
// hasdef:[pd][ed][rpd][red][powerdef][flashdef][mentaldef][no]
@birdbrainiac
birdbrainiac / recovery
Created September 14, 2018 08:36 — forked from fmonaca/recovery
recovery for HERO Combat System for Roll20 - NEEDED as some commands are parsed here
on('chat:message', function(msg) {
if(msg.type != 'api') return; // We're only deal with API commands
//var parts = msg.content.toLowerCase().split(' ');
var parts = msg.content.split(';');
var command = parts.shift();
if(command == '!recovery')
{
//var page = getObj('page', Campaign().get('playerpageid'));
var selected = msg.selected;
@birdbrainiac
birdbrainiac / turnorder
Created September 14, 2018 08:37 — forked from fmonaca/turnorder
Automatic Turn Order in Turn Tracker for HERO system campaigns
on('chat:message', function(msg) {
var command = msg.content.toLowerCase();
if (msg.type == "api" && command == "!combatstart"){
sendChat("GM", "Combat begins!");
var selected = msg.selected;
var aChars = new Array();
var nCount = 0;
_.each(selected, function(obj) {
if(obj._type != 'graphic') return;
@birdbrainiac
birdbrainiac / instructions
Created September 14, 2018 08:37 — forked from fmonaca/instructions
Notes and instructions (sort of) about the HERO combat system scripts for Roll20
HERO combat system scripts for Roll20
There are 5 scripts in total: heroturntracker2.0, autocombat, effects, recovery, locations.
The first manages the turn tracker, subdividing the turns into phases in which it shows only the tokens acting during those phases depending on their SPD attribute. It supports delayed actions (by putting a "d" in place of the Dex of the token). It also keeps track of status like stunned, deeply stunned, bleeding, movement, actions, etc.
The second manages the weapon and their effects (or spells that damage the opponent). It can be used for modern weapons and for fantasy ones. Any spell that does damage can be
emulated by this script.
@birdbrainiac
birdbrainiac / easter.js
Last active October 18, 2018 15:46
[roll20 Easter Calculator] A script to calculate the date of easter sunday, and also the day of the week for any given year, month, and day. The output isnt polished, it's simply presented as a proof of concept for now. #roll20 #roll20script
/*
Easter date Calculation
best easter calculator: https://www.staff.science.uu.nl/~gent0113/easter/easter_text2a.htm
script: https://www.staff.science.uu.nl/~gent0113/easter/addfiles/easter.js
root: https://www.staff.science.uu.nl/~gent0113/easter/eastercalculator.htm
historical easters: http://www.kevinlaughery.com/east4099.html
USAGE
!easter [year] [optional: true for gregorian calendar, false for julian]
gives the date of easter, and the date of paschal full moon, the full moon that immediately precedes easter sunday.
@birdbrainiac
birdbrainiac / wodice.js
Last active December 7, 2024 10:54
[Roll20 WOD Dice] A Dice roller for rolling new WOD, with double 10s adding two successes. #roll20 #roll20script
/*
basic structure
!wodice Alucard rolls [[7d10]] to use Dominate --sort --title:Fiendish Mind Control --7 --tens
!wodice Mina rolls [[5d10>7]] to resist Dominate --sort --title:Willpower --7 --tens
!wodice Alucard rolls [[7d10>7?{Special?|Yes,!|No,!11}]] to use Dominate --sort --title:Fiendish Mind Control
Structure is
!wodice [text to print out as description] --optional parameters
--sort or -sort:true (makes it sort, otherwise its unsorted, could also add ascending or descending option)
--title:some text or --some text (adds a title, otherwise a default title is used)
--difficulty: 7 or --7 (sets a variable difficulty)
@birdbrainiac
birdbrainiac / tokenimghealth.js
Last active March 10, 2020 21:51
[roll20 TokenImgHealth] Change Token Image Based on a Token Bar value #roll20 #roll20script
/*
If you have a character token made from Rollable Token, this script will change the image displayed based on the value of a token bar.
So you could have the image change automatically based on damage, or just if you just want to use a bar to quickly change the token's image.
The top four constants areset the behaviour of the script:
TOKENBAR: the token bar to use.
IMAGEMAX: if you want to limit the token selection to, say, the first 3 images, set IMAGEMSX = 3. If 0, it uses all the token images.
You can also create an attribute and set an array of images to use. If this attribute exists, the imagemax above is ignored.
The attribute can have values like 1,2,3,4 or 2-4, or 1,3-5,7. Only numbers, commas and hyphens are used.
IMAGEARRAY: name of the attribute to use.
@birdbrainiac
birdbrainiac / lazyexperience.js
Last active April 18, 2019 19:44
[LazyExperience AoE Template Fix] #roll20 #roll20script
/*
* Version 0.1.13a
* Made By Robin Kuiper
* with edit by GiGs for AOE Template Fix
* Skype: RobinKuiper.eu
* Discord: Atheos#1095
* Roll20: https://app.roll20.net/users/1226016/robin
* Roll20 Thread:
* Github: https://github.com/RobinKuiper/Roll20APIScripts
* Reddit: https://www.reddit.com/user/robinkuiper/