TurnMarker has an !eot command built in that advanced the turn if the player executing it owns the current turn's token. If you just want a pass the turn command, I can throw one together. on('ready', ()=>{
const getTurnArray = () => ( '' === Campaign().get('turnorder') ? [] : JSON.parse(Campaign().get('turnorder')));
const setTurnArray = (ta) => Campaign().set({turnorder: JSON.stringify(ta)});
const addCustomTurn = (custom, pr) => Campaign().set({ turnorder: JSON.stringify( [...getTurnArray(), {id:-1,custom,pr}]) });
const sorter_asc = (a, b) => b.pr - a.pr;
const sorter_desc = (a, b) => a.pr - b.pr;
const sortTurnOrder = (sortBy = sorter_desc) => Campaign().set({turnorder: JSON.stringify(getTurnArray().sort(sortBy))});
const getPageForPlayer = (playerid) => {
let player = getObj('player',playerid);
if(playerIsGM(playerid)){
return player.get('lastpage');
}
let psp = Campaign().get('playerspecificpages');
if(psp[playerid]){
return psp[playerid];
}
return Campaign().get('playerpageid');
};
on('chat:message', (msg)=>{
if('api'===msg.type) {
if(/^!eot\b/i.test(msg.content)){
let to = getTurnArray();
let t = to.shift();
to.push(t);
setTurnArray(to);
} else if (/^!sort\b/i.test(msg.content)){
sortTurnOrder();
} else if (/^!asort\b/i.test(msg.content)){
sortTurnOrder(sorter_asc);
} else if (/^!toggle-turn-order\b/i.test(msg.content)){
let p = getPageForPlayer(msg.playerid);
if(false === Campaign().get('initiativepage')){
Campaign().set({
initiativepage: p
});
} else {
Campaign().set({
initiativepage: false
});
}
} else if (/^!add-turn\b/i.test(msg.content)){
if(msg.hasOwnProperty('inlinerolls')){
msg.content = _.chain(msg.inlinerolls)
.reduce(function(m,v,k){
let 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();
}
let args = msg.content.slice('!add-turn '.length).split(/\s+--/);
addCustomTurn(args[0],args[1]||0);
}
}
});
});
Edit: Expanded to have the following commands: !eot This advances to the next turn. !sort This sorts in descending order !asort This sorts in ascending order !toggle-turn-order Shows the turn order if it is hidden, hides it if it is not. !add-turn SOME TEXT --NUMBER This adds a custom turn (no token needed) with whatever the text is. You can optionally follow it with a number or inline roll: !add-turn Frank the Great --[[1d20]] Will roll 1d20 and assign that to a turn named "Frank the Great" !add-turn Frank the Great --10 Will assign 10 to a turn named "Frank the Great" !add-turn Frank the Great Will assign 0 to a turn named "Frank the Great" Technically, you can put whatever you like after the --, so you could use some other turn priority, like A, B, C. If that's the case though, I'll need to give you a different sort option...