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

Help with Macros

I made this macro about 3 years ago, but then immediately stopped using Roll20 ( because the group moved entirely in person).  But now we are moving back online, I'm I'm trying to pick this up again.  There is a bit of code here that I just cannot find where I got it from. Nor can I figure out what some of it it does.  

Here it is... I'll follow up with some questions.

[[[[[9 - {[[@{target|ac} - 0@{selected|repeating_npcaction_$0_attack_tohit}]],0}>4*(5) - {[[@{target|ac} - 0@{selected|repeating_npcaction_$0_attack_tohit}]],0}>6*(2) - {[[@{target|ac} - 0@{selected|repeating_npcaction_$0_attack_tohit}]],0}>8*(1)]]]]]

This was part of a macro I made to help me manage mob attacks. It was the first part of a "A out of B" hits on the character.

Heres what I don't recall. what does the "0@" do?

In fact, just the over all process I no longer get. Sad really, I remember it took me a day or two to figure this much out. Maybe I got the code from someone. Anyway, if someone can help me parse this it would be great.

July 06 (3 weeks ago)
Gauss
Forum Champion

Hi Grimtoothy, 

If an attribute is blank then it will cause an error in your macro. Since you are calling repeating actions there is the chance that one of them will be empty (blank). 

To resolve that putting 0 in front will prevent it from being blank. And if there is a number there it will just put a 0 in front of the number. 
Example: 
If the to hit number is "2" putting a 0 in front of that attribute will be "02" which is still "2". 

July 06 (2 weeks ago)

I'm not totally understanding what your macro does, or where your numbers came from, but I'm guessing it's modified from your post a couple years ago where I gave you this macro for Mob Rules. There's an explanation of the Catering for 'missing attributes' when summing values a couple more posts further down in that thread.

I posted later for someone else with versions that apply Advantage or Disadvantage as well. 

Ah... it was YOU Jarren!  Thanks.  I'll go back through that post and reread.