This is my first major api script so it is sorta buggy and the code is a mess, but it is something I feel others will find useful
This script handles 4e combat from buffs to attack rolls to damage, an example macro from one of my characters
/me takes an opportunity attack at @{target|token_name}
!attack @{target|token_id} @{selected|token_id} AC 1d12 @{tohit} @{damage} 12 0 (optionalname) (optionalhalfmiss)
The !attack calls the api then it gets sent the id of the target and selected tokens, then damage type (ac fort reflex will), damage dice, the to hit bonus, the damage bonus, the 12 is the damage it does on a crit, and the 0 is the tohit bonus for certain attacks that get an extra bonus to hit, optional after that is name of attack in case like in the example below you have certain attacks that you want to do special things on hit like say mark a creature and optional "halfmiss" which will make the attack do half on a miss.
There is a bunch of campaign specific stuff in there talking about my characters buffs/hunters quarry but I left it in so people can see how to modify it to their needs stuff like checking to see if a target is marked or if you have combat advantage helps speed up my combat as they have to worry less about the numbers and more about tactics. The roll formatting needs some work but it is readable. This will not handle AOEs I have a second script for that I will upload shortly that works to gather aoe targets then feed them into this one.
https://gist.github.com/stephenhudson/8144136
This script handles 4e combat from buffs to attack rolls to damage, an example macro from one of my characters
/me takes an opportunity attack at @{target|token_name}
!attack @{target|token_id} @{selected|token_id} AC 1d12 @{tohit} @{damage} 12 0 (optionalname) (optionalhalfmiss)
The !attack calls the api then it gets sent the id of the target and selected tokens, then damage type (ac fort reflex will), damage dice, the to hit bonus, the damage bonus, the 12 is the damage it does on a crit, and the 0 is the tohit bonus for certain attacks that get an extra bonus to hit, optional after that is name of attack in case like in the example below you have certain attacks that you want to do special things on hit like say mark a creature and optional "halfmiss" which will make the attack do half on a miss.
There is a bunch of campaign specific stuff in there talking about my characters buffs/hunters quarry but I left it in so people can see how to modify it to their needs stuff like checking to see if a target is marked or if you have combat advantage helps speed up my combat as they have to worry less about the numbers and more about tactics. The roll formatting needs some work but it is readable. This will not handle AOEs I have a second script for that I will upload shortly that works to gather aoe targets then feed them into this one.
https://gist.github.com/stephenhudson/8144136