This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
The macro sends the ID or name of the attacker, the ID or name of the defender, and optionally some other modifiers to the script: | |
attmod - Default = 0, optional OCV modifier (because of status like SET, BRACE or various types of bonus/malus); | |
distance - Default = 0, optional distance (in meters) - In case you have to manually specify a distance in metres; | |
shots - optional modifiers - can be: shots[n] - Number of shots firing for that phase for weapons with selective autofire [1 (max = autofire value)]; | |
abort - optional modifier needed for "abort" type maneuvers like block and dodge. | |
manualroll - optional in case players want to roll manually to hit | |
macro example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
USAGE: | |
Select tokens and | |
!combatstart Initiate combat | |
!nextphase Advance to next phase in which at least one of the tokens in combat acts | |
!combatend End combat | |
!combatadd Add token(s) into combat | |
!combatremove Remove token(s) from combat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on("chat:message", function(msg) { | |
if(msg.type == "api" && msg.content == "!spawn") { | |
var selected = msg.selected; | |
_.each(selected, function(obj) { | |
var newID = spawnCharacter(obj._id); | |
var oAttrib = findObjs({name: "STR",_type: "attribute", _characterid: newID}, {caseInsensitive: true})[0]; | |
var attrib = parseInt(oAttrib.get('current')); | |
attrib += 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------------------------------------------------------------------------------------- */ | |
// Initiative Script | |
// | |
// Usage: Select the tokens you want the initiative to be rolled for and use the command "!initiative" | |
// This command rolls a die of the type specified using the "initiativeDie" variable, adds | |
// the result to the attribute specified using the "initiativeAttribute" variable (for each | |
// token), then sorts the tokens by the total achieved (higher to lower) and puts them into | |
// the Turn Tracker. Use the command "!nextround" to move to the next round and increase the | |
// counter. | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iii = iii || {}; | |
var iTurn = iTurn || {}; | |
var combatBegun = combatBegun || {}; | |
var aChars = new Array(); | |
var aSPDchart = new Array(); | |
aSPDchart = ['','12','6,12','4,8,12','3,6,9,12','3,5,8,10,12','2,4,6,8,10,12','2,4,6,7,9,11,12','2,3,5,6,8,9,11,12','2,3,4,6,7,8,10,11,12','2,3,4,5,6,8,9,10,11,12','2,3,4,5,6,7,8,9,10,11,12','1,2,3,4,5,6,7,8,9,10,11,12']; | |
function recoveryAll(tokens) { | |
for(var idCounter=0; idCounter<tokens.length; idCounter++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A shorthand to create new events in the encounters table. | |
var event = function(freq, msg) { | |
return {message: msg, frequency: freq}; | |
}; | |
// The encounter table. Create a new section and populate it with events. The | |
// event text will be displayed in the GM chat window if it is selected. | |
// Events with a frequency of '3' will happen 3 times as often as events with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is my collection of useful functions to use in other commands/functions. I will keep this top post updated with the list of included functions as I add more. | |
Library includes: | |
- removePlus. Takes string or array of strings and returns the integer after the symbol "+". Useful for getting an integer from a string that represents a bonus like +2. Will also convert any numbers in the string/array of strings to integers. | |
- getAttributeObjects: takes a character object and an array of attribute names, checks the names against the character for existing attributes, error checks them for empty values or existence at all, and returns an array of the attributes' objects. | |
- getCharacterObj: takes a graphic, attribute, ability, or character object and returns the associated character object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global createObj TokenMod spawnFxWithDefinition getObj state playerIsGM sendChat _ findObjs log on*/ | |
/* | |
My Profile link: https://app.roll20.net/users/262130/dxwarlock | |
GIT link: https://github.com/dxwarlock/Roll20/blob/master/Public/HeathColors | |
Roll20Link: https://app.roll20.net/forum/post/4630083/script-aura-slash-tint-healthcolor | |
My Tweaks: | |
Lines 31-33, and 64-66 were to allow for Pendragon-style HPs | |
Lines 46-49 were commented out to disable the colour tint of characters. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
For use with Darren's HeroTracker | |
By The great Aaron | |
Type !sorths | |
*/ | |
on('ready', () => { | |
const sortHeroSystem = (a,b) => { | |
const aInt = (parseInt(a.pr)||0); | |
const aFloat = (parseFloat(a.pr)||0); | |
const bInt = (parseInt(b.pr)||0); |