You can certainly activate api commands from a macro. API commands start with a ! and can be named whatever you like. The script simply has to respond to them. There are a few limitations, but mostly you can get any task accomplished with a combination of macros calling API commands. I'm not completely clear on what you are imagining with your last sentence, but I'm happy to try and talk out the implications of doing it with an API command and macros. =D Just to talk through a small example to give you the feel, it sounds like you'd want to do something like (in simplest form...) this, called via a macro: !attack @{target} bow @{target} prompts the caller to select a target token by clicking on it. The API command string will then look like '!attack -1234adsf13245afd bow', as the @{target} will be substituted for the token id before sending it to the API. In the API, you would have a script that listens to the command '!attack' var command = msg.content.split(' ')[0];
if('!attack' === command){
// do stuff
} and expects the first argument to be the id of a token, and the second to be some action. The API can then find that token var token_id = msg.content.split(' ')[1];
var token_obj = findObj('graphic',token_id); and perform some action for 'bow': var action = msg.content.split(' ')[2];
switch(action) {
case 'bow':
// verify there is ammunition
// check to hit vs token_obj's AC
// find damage and apply it to the token_obj
// deduct ammunition
break;
} Hopefully that gives you an idea of what you're looking at. Feel free to ask questions, we're a helpful bunch!