Question group check - ignoring my merc if out

EQDAB

Premium Member
Joined
Nov 13, 2015
Messages
225
Reaction score
12
Points
18
Age
68
Location
Wdbg., VA Eastern USA
Forever I've used:
Code:
${If[!${Group.Members},1,0]}
to check for a group. But if I have my merc out it fails (as it should, I guess :rolleyes:). But I'd like to know an efficient, easy replacement. I'm sure one of you macro-masters must have the answer to show me the error of my ways. Thanks in advance!
 
Could use:


Code:
${If[!{Group.Members} || ${Group.Members}==${Group.MercenaryCount},1,0])
 
Last edited:
  • Love
Reactions: EQDAB
Nice answer htw, THANK YOU

Could use:


Code:
${If[!{Group.Members} || ${Group.Members}==${Group.MercenaryCount},1,0])
Sweet, 2 the point. Along that vein could it be shortened/combined like:
Code:
${If[${Group.Members}!==${Group.MercenaryCount},1,0])

Nope :eek: that would miss the basic group check, NM. Thanks htw!! I'm just always trying to simplify/cleanup my poor coding. I still remember someone saying they were scared to use a well-known mq2 person's macros because of their use of excessively long/complicated IF statements. It made a lasting & guiding impression on me :cool:.
 
Could use:


Code:
${If[!{Group.Members} || ${Group.Members}==${Group.MercenaryCount},1,0])
Sweet, 2 the point. Along that vein could it be shortened/combined like:
Code:
${If[${Group.Members}!==${Group.MercenaryCount},1,0])

Nope :eek: that would miss the basic group check, NM. Thanks htw!! I'm just always trying to simplify/cleanup my poor coding. I still remember someone saying they were scared to use a well-known mq2 person's macros because of their use of excessively long/complicated IF statements. It made a lasting & guiding impression on me :cool:.

Code:
${If[${Group},${If[${Group}==1 && ${Mercenary.ID},0,1]},0]}

So if you have a group check to see if you only have 1 group member, and if you have a mercenary ID. If that passes then you don't have a real group, otherwise you do, and if ${Group} isn't valid you don't have a group.

Many ways to skin a cat.

Edit:
Code:
${If[${Group}==1 && ${Mercenary.ID},0,${Group}]}
So if you're group is 1 and you have a merc then fail, otherwise return ${Group}, if you have no group ${Group} is NULL and Fails, if you have a ${Group} then it passes and returns the number of people in your group. Any non-null or non-zero number represents a passing value, thus ${Group} returning the size of your group will pass it.
 
Last edited:
Thanks my friends

Could use:


Code:
${If[!{Group.Members} || ${Group.Members}==${Group.MercenaryCount},1,0])
Sweet, 2 the point. Along that vein could it be shortened/combined like:
Code:
${If[${Group.Members}!==${Group.MercenaryCount},1,0])

Nope :eek: that would miss the basic group check, NM. Thanks htw!! I'm just always trying to simplify/cleanup my poor coding. I still remember someone saying they were scared to use a well-known mq2 person's macros because of their use of excessively long/complicated IF statements. It made a lasting & guiding impression on me :cool:.

Code:
${If[${Group},${If[${Group}==1 && ${Mercenary.ID},0,1]},0]}

So if you have a group check to see if you only have 1 group member, and if you have a mercenary ID. If that passes then you don't have a real group, otherwise you do, and if ${Group} isn't valid you don't have a group.

Many ways to skin a cat.

Edit:
Code:
${If[${Group}==1 && ${Mercenary.ID},0,${Group}]}
So if you're group is 1 and you have a merc then fail, otherwise return ${Group}, if you have no group ${Group} is NULL and Fails, if you have a ${Group} then it passes and returns the number of people in your group. Any non-null or non-zero number represents a passing value, thus ${Group} returning the size of your group will pass it.
Well said Chat & thanks. Honestly, I thought you'd be the 1st to respond. But I appreciate all :confused: advice/education/sources. I'm guessing it'll never be as easy as I was.
 
One of the other things that Group doesnt return is the number in zone and in range. I had to set one up for mq2bot for that. You can use them in your macros without turning the bot on.



Bot.Farthest[index] searches for the farthest group member within that index. used for Call of the Hero in mq2bot.
Bot.MinHP[index] returns group member with lowest hp within index radius
Bot.MinMana[index] returns group member with the lowest mana within index radius
Bot.MinPetHP[index] does same for pets.


At any rate, sometimes you might want to cycle through a radius as well depending on what your checks are, especially if it is for skill/spell usage.
 
Thoughtful people, love you all.

One of the other things that Group doesnt return is the number in zone and in range. I had to set one up for mq2bot for that. You can use them in your macros without turning the bot on.



Bot.Farthest[index] searches for the farthest group member within that index. used for Call of the Hero in mq2bot.
Bot.MinHP[index] returns group member with lowest hp within index radius
Bot.MinMana[index] returns group member with the lowest mana within index radius
Bot.MinPetHP[index] does same for pets.


At any rate, sometimes you might want to cycle through a radius as well depending on what your checks are, especially if it is for skill/spell usage.
Nice, I'll try to remember those goodies. I really should check out MQ2Bot. Sounds like you've put a lot of thought into it's design & abilities. Very :cool: