Page 1 of 1
Using Group TLO and merc question.
Posted: Mon Oct 14, 2013 4:12 am
by dewey2461
If you loop over ${Group.Member[]} you get the name of each member which is what I would expect.
/echo ${Group.Member[0]}
/echo ${Group.Member[1]}
However if you look up a name in the group structure it only works for PC's. For mercs ${Group.Member[ <merc name> ] } always returns NULL.
/echo ${Group.Member[ <my name> ]} --> returns 0
/echo ${Group.Member[ <my merc> ]} --> returns NULL
I'm guessing it will be a trivial change to make the ${Group.Member} search work for mercs. Just have to find the place to change it and since its a core TLO I'd like to get buy in that this is the desired functionality.
On the other hand there may be a good reason we can't .
Re: Using Group TLO and merc question.
Posted: Mon Oct 14, 2013 7:57 am
by iconicman
At the risk of sounding dumb (and I do that often), are you suggesting we can search on their display name i.e. Kaleuil to return a group spot, or their full name Kaleuil11456 ?
Not in the game but does searching for their full name still make the Group TLO fall over?
Re: Using Group TLO and merc question.
Posted: Mon Oct 14, 2013 8:06 am
by EqMule
Im pretty sure you have to send the "real" mercenary name through the tlo for it to return something other than NULL.
So tulienne163729 or whatever not just tulienne
But I can look into it today.
Re: Using Group TLO and merc question.
Posted: Mon Oct 14, 2013 8:17 am
by dewey2461
Basically in the macro I'm using it likes to accept and store short names or spawn ID's.
So what I'm trying to do is figure out if the information from ${Spawn[id ${MobID} ].PctHps is valid or do I need to target it.
The PctHps field should be valid if I have it targeted, In group or on XTarget.
My code was doing ${Group.Member[ <name> ].ID} to check.
Instead I'm now looping over each ${Group.Member[ ${G} ].ID} = ${MobID} then ...
The code is a little longer but probably better now.
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 2:10 am
by dencelle
Code: Select all
/declare GID int outer 0
/declare HealPct int outer 70
/declare MemGem int outer 8
/declare HealingSpell string outer "Minor Healing"
Sub Main
/Call DoGroupCheck
/return
Sub DoGroupCheck
/For GID 0 to ${Math.Calc[${Group.GroupSize}-1]} {
/target ID ${Group.Member[${GID}].ID}
/call Memspell ${HealingSpell} ${MemGem}
/delay 30s ${Me.SpellReady[${HealingSpell}
/If (${Group.Member[${GID}].PctHPs}>${HealPct}) /cast ${HealingSpell}
/delay 30s !${Me.Casting}
/target clear
}
/return
Sub MemSpell(SpellName,SpellGem)
/if (${Me.Gem["${SpellName}"]) /return
/mem ${SpellName} ${SpellGem}
/delay 20s ${Window[SpellBookWnd].Open}
/return
this was wrote while i was work... took 10 min to write...
working on a new macro based casting manager... along with a lot of other things since i hate using plugins and i'm attempting to rebuild the old tradeskill macros...
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 8:30 am
by iconicman
I always target using IDs rather than names
/target id ${Spawn[ID ${Group.Member[${GID}].ID}]}
Always told it was best practice to do that.
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 11:09 am
by dencelle
your right... fixed that -.- idk what i was thinking... =\ lol
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 1:09 pm
by Maskoi
iconicman wrote:I always target using IDs rather than names
/target id ${Spawn[ID ${Group.Member[${GID}].ID}]}
Always told it was best practice to do that.
why even bother with spawn?
Code: Select all
/target id ${Group.Member[GID].ID}
and ${Group} = number of group members without you
Code: Select all
/For GID 0 to ${Math.Calc[${Group.GroupSize}-1]}
could be
and your /for needs a /next you have it {} like a /if statement
and > should be < or it will heal when toons hps are over 70% not under
Code: Select all
/If (${Group.Member[${GID}].PctHPs}>${HealPct}) /cast ${HealingSpell}
change to
Code: Select all
/If (${Group.Member[${GID}].PctHPs}<${HealPct}) /cast ${HealingSpell}
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 5:27 pm
by dencelle
Maskoi wrote:iconicman wrote:I always target using IDs rather than names
/target id ${Spawn[ID ${Group.Member[${GID}].ID}]}
Always told it was best practice to do that.
why even bother with spawn?
Code: Select all
/target id ${Group.Member[GID].ID}
and ${Group} = number of group members without you
Code: Select all
/For GID 0 to ${Math.Calc[${Group.GroupSize}-1]}
could be
and your /for needs a /next you have it {} like a /if statement
and > should be < or it will heal when toons hps are over 70% not under
Code: Select all
/If (${Group.Member[${GID}].PctHPs}>${HealPct}) /cast ${HealingSpell}
change to
Code: Select all
/If (${Group.Member[${GID}].PctHPs}<${HealPct}) /cast ${HealingSpell}
lol thanks maskoi for ripping my macro apart :p i never tested it... like i said... i was at work...
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 6:54 pm
by Maskoi
So was I lmao
Re: Using Group TLO and merc question.
Posted: Wed Oct 16, 2013 7:00 pm
by dewey2461
The code I inherited

was written before mercs came out. I've never run with them until recently.
The code basically has to find the current HP of anything on a list and at some point falls back to targeting the mob/npc/merc and getting hp = ${Spawn[].PctHps} which in the old days was /target id ${..} , wait , get hp.
I can skip targeting *IF* mob/npc/merc
1 - pc/merc is in group
2 - pc is broadcasting over netbots.
3 - mob is on XTarget
4 - otherwise /target and get hp.
Part #1 of that WAS coded as /if ( ${Group.Member[${NAME}]}) /varset hp ${Spawn[...].PctHps}
Workaround was to write a loop which checks everyone in group. Which means the macro gets slightly slower executing an extra set of loops as a macro instead of via plugin.