Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

looking to make a rage/durration tracker macro

I'm looking to create a macro that will let me add a custom tracker to the initiative tracker (for my example on my turn my barbarian rages, i'd like to be able to just click a macro and have a custom tracker added after me in initiative order named rage with an initiative of 10 and the -1 calculation, and i figure if that's possible it could also be modified for my players who cast spells to quickly generate trackers for those as well  should also add I'm the DM so i can do it manualy but I'd like to be able to save the time of creating the tracker, setting its starting value then placing it after the caster/barbarian in the turn order
1525302376
The Aaron
Pro
API Scripter
Not really possible with just a macro, but easy with an API script.  I just happen to have one... !act -1 10 --Rage This adds to the start of the turn order, but that could be modified. Here's the script: on('ready',function(){     "use strict";     const checkFormulaOnTurn = () => {         let to=JSON.parse(Campaign().get('turnorder')||'[]');         if(to.length && to[0].id==='-1'){             sendChat('',`[[${to[0].pr}+(${to[0].formula||0})]]`,(r)=>{                 to[0].pr=r[0].inlinerolls[0].results.total;                 Campaign().set('turnorder',JSON.stringify(to));             });         }     };     on('chat:message',function(msg){         var args,cmds,who,initial,change,entry;         if('api' === msg.type) {             if(msg.content.match(/^!act\b/) ){                 who=(getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname');                 if(_.has(msg,'inlinerolls')){                     msg.content = _.chain(msg.inlinerolls)                         .reduce(function(m,v,k){                             var ti=_.reduce(v.results.rolls,function(m2,v2){                                 if(_.has(v2,'table')){                                     m2.push(_.reduce(v2.results,function(m3,v3){                                         m3.push(v3.tableItem.name);                                         return m3;                                     },[]).join(', '));                                 }                                 return m2;                             },[]).join(', ');                             m['$[['+k+']]']= (ti.length && ti) || v.results.total || 0;                             return m;                         },{})                         .reduce(function(m,v,k){                             return m.replace(k,v);                         },msg.content)                         .value();                 }                 args = msg.content                     .replace(/<br\/>\n/g, ' ')                     .replace(/(\{\{(.*?)\}\})/g," $2 ")                     .split(/\s+--/);                 cmds=args.shift().split(/\s+/);                 change=parseFloat(cmds[1])||'+1';                 change=`${/^[+-]\d/.test(change)?'':'+'}${change}`;                 initial=parseFloat(cmds[2])||0;                 entry=args.join(' ');                 if(entry.length){                     let to=JSON.parse(Campaign().get('turnorder')||'[]');                     to.unshift({                         id: "-1",                         pr: initial,                         custom: entry,                         formula: change                     });                     Campaign().set('turnorder',JSON.stringify(to));                     if(!playerIsGM(msg.playerid)){                         sendChat('ACT',`/w gm <div style="padding:1px 3px;border: 1px solid #8B4513;background: #eeffee; color: #8B4513; font-size: 80%;"><div style="background-color: #ffeeee;"><b>${who}</b> added entry for <b>${entry}</b> starting at <b>${initial}</b> and changing by <b>${change}</b>.</div></div>`);                     }                 } else {                     sendChat('ACT',`/w "${who}" <div style="padding:1px 3px;border: 1px solid #8B4513;background: #eeffee; color: #8B4513; font-size: 80%;"><div style="background-color: #ffeeee;">Use <b><pre>!act [formula] [starting value] --[description]</pre></b></div></div>`);                 }             } else if(msg.content.match(/^!eot/i)){                 _.defer(checkFormulaOnTurn);             }         }     }); });
that's awesome, still saves a lot of time compared to having to open the menu, set the tracker then go to the end of order to actually set it up, just having to drag it down 1 is not a problem, and i assume the trigger macro should work just fine with queries to add other options beyond rage
1525305011
The Aaron
Pro
API Scripter
Yup!