Do you hate setting groups? You must make an encounter on the spot and don't have time to set all those nasty stats? Or you are just lazy and want the easy route? I've got something for you. An easy and fast group initiative roller. Just make a macro ("!tokeninit ?{modifier|0}"), select tokens, run it, set the initiative modifier and presto, you are done. API Script: function InitToken(mod, msg)
{
try
{
var turnorder;
if (Campaign().get("turnorder") == "")
{
turnorder = [];
}
else
turnorder = JSON.parse(Campaign().get("turnorder"));
_.each(msg.selected, function(selected)
{
var obj = getObj("graphic", selected._id);
var who = "";
var currChar = getObj("character", obj.get("represents")) || "";
var initString = " + " + mod;
if (currChar.length != 0)
{
who = currChar.get("name");
if (currChar.get("controlledby") != "") return;
}
var roll = randomInteger(20) + parseInt(mod);
var result = roll + "." + mod;
turnorder.push({
id: selected._id,
pr: result,
custom: who
});
});
Campaign().set("turnorder", JSON.stringify(turnorder));
}
catch(err)
{
return;
}
};
on("chat:message", function(msg)
{
if( msg.type != 'api' ) return;
var cmd = msg.content.toLowerCase().split(' ');
if( cmd[0] == "!tokeninit" )
{
InitToken( cmd[1], msg );
}
});