Get character token action/ability was used on?

1526574068

Edited 1526574087
DXWarlock
Pro
Sheet Author
API Scripter
I cannot find a reference to this in the API doc (if its even possible as clicking my token action triggers and !API command, they don't natively send one itself). I'm trying to get what character a token action was used from. My token action is an !API command to do attacks, and I need to lookup the characters critical chance attribute. And msg.who won't work, as the GM I can select anyone in the dropdown and it uses that character or player. Not the token I have selected and clicked the token action from. Is this even possible? 
1526574176
The Aaron
Pro
API Scripter
Is msg.selected not sufficent?
1526574399

Edited 1526574444
DXWarlock
Pro
Sheet Author
API Scripter
That does work wonderfully, what I had in the first place, but that doesn't work if its triggered from the macro bar vs token action bar. Some of my players like adding them to the bottom bar.
1526574641
Jakob
Pro
Sheet Author
API Scripter
DXWarlock said: That does work wonderfully, what I had in the first place, but that doesn't work if its triggered from the macro bar vs token action bar. Some of my players like adding them to the bottom bar. Just send the character id with the macro somewhere. @{Tim|character_id} will send Tim's character id, or you can use @{character_id} from within an ability.
1526575597
The Aaron
Pro
API Scripter
^^^^ What he said.  =D
1526575665
DXWarlock
Pro
Sheet Author
API Scripter
That might work :) Need to rewrite the script to take that into account as one of the varibles, but seems way easier than the rabbit hole I was trying to go down to get it to work..hehe
1526575861
The information might be in the roll template as well if you are using them. For example the 5e OGL templates have a {{charname=NAME}} option.
The shaped sheet has a similar option to include character name with the roll template.
1526576809

Edited 1526576825
DXWarlock
Pro
Sheet Author
API Scripter
Its my custom character sheet, I havent gotten fancy with it and done Roll Templates yet. :)