Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Script to auto mark a target when a script is used

I would appreciate some help with a macro. I would like to auto mark a target.

Example: When a fighter attacks in 4e, he marks a target no matter hit or miss. How could I get his attacks to mark his target with one of the games markers. Lets say, the yellow circle.

Here is the macro I am using for a basic melee attack. I am using the powercard2 API as well.

!power --tokenid|@{selected|token_id} --emote|The Fighter resorts to the
 simple attack he learned when he first learned to fight, bludgeoning 
things. --format|atwill --name|Melee Basic Attack --leftsub|At-Will 
--rightsub|Standard Action --Attack|[[1d20 + @{strength-mod} [Strength 
Mod]]] vs  @{target|token_name} AC of @{target|bar2} --Hit|[[1d4 + 
@{strength-mod} [Strength Mod]]] Melee Damage~~~~C//+[[@{wisdom-mod}]] 
to hit if an **opportunity attack**//~C

Thank you in advanced for those helping.

You Friendly Neighborhood Dungeon Master,
Ryeaa

May 22 (10 years ago)
Gen Kitty
Forum Champion
You should look into TokenMod
Thank you Genkitty, I shall read it over.
May 22 (10 years ago)
Don't forget you can do multiline formatting for your powercards now. Plenty of examples in the main thread. Makes it much easier to read.

HoneyBadger said:

Don't forget you can do multiline formatting for your powercards now. Plenty of examples in the main thread. Makes it much easier to read.

I tired doing that once before but I didn't see the {{ and the }} and the beginning and ends of the macro. I just updated one and its works! Thanks for making me look back and see that HoneyBadger
May 22 (10 years ago)
^___^
May 22 (10 years ago)
vÍnce
Pro
Sheet Author
I like Aaron's script to mark targets
[Script] Mark -- Places a numbered marker under each supplied token, clears on turn change/end of combat/page change.
May 22 (10 years ago)
The Aaron
Pro
API Scripter
If you use TokenMod for this, it would look something like this (bold):
!power {{
--tokenid|@{selected|token_id} --emote|The Fighter resorts to the simple attack he learned when he first learned to fight, bludgeoning things. --format|atwill --name|Melee Basic Attack --leftsub|At-Will --rightsub|Standard Action --Attack|[[1d20 + @{strength-mod} [Strength Mod]]] vs @{target|token_name} AC of @{target|bar2} --Hit|[[1d4 + @{strength-mod} [Strength Mod]]] Melee Damage~~~~C//+[[@{wisdom-mod}]] to hit if an **opportunity attack**//~C }}
!token-mod --set statusmarkers|yellow --ids @{target|token_id}
You would need to run !token-mod --help and turn on Players Can IDs to allow them to affect tokens they can't select.