The Aaron said: I don't know if turn formulas work on tokens, I've only ever used them with custom turns. There isn't a way in the interface to set one for a token, but you could certainly set the data for it with the API. I'll have to try that. For adding custom turns, I have this 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);
}
}
});
});
You call it like this: !act -1 10 --Bless on Bob, Nancy, and Sue And it will add a custom turn at the top of the turn order that starts at 10, subtracts 1 each time it comes up, and is named "Bless on Bob, Nancy, and Sue" This is genius work ! It can and will handle my cooldowns very neatly. Though, do you know if there can be two different active turn tracker at the same time ? In the mean time, I found that sending an image representing the spell in chat through the macro also somewhat "helps" when the players need to know if this or that spell is available, they just scroll until they found the image which is much more visible than a line of text. Now the ultimate perfect goal would be to have the said image working with the command as for example : !act -1 10 -- [Coup de Pied Surpuissant du Buffle](<a href="http://wow.zamimg.com/images/wow/icons/large/ability_monk_mightyoxkick.jpg" rel="nofollow">http://wow.zamimg.com/images/wow/icons/large/ability_monk_mightyoxkick.jpg</a>) → Something that would display the picture alongside its cooldown, but I doubt it's possible :/ → Anyway, thanks a TONE, I'm just beginning to grasp the concept of the API ^^