• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Problem - XTarget bugs

Joined
Oct 15, 2013
RedCents
949¢
There seems to be a bug in XTarget functionality, or user error, which is more likely). If a mob in XTarget has aggro on my Merc (only me and Merc in grp, no pets), ${Me.XTarget[x]} returns NULL.

I've managed to work around it, but I'd really like to be able to:

/if (${Me.XTarget[]>=1) {
/target ${Me.Xtarget[0]}
/attack on
}

reliably. The odd thing is ${Me.XTarget[]>=1} returns true even if all mobs in XTarget are aggroing my merc, but the members all return NULL. So it works fine for aggro detection but not targeting reliably.
 
Set XTarget 2 to Mercenary Target and... this?

Rich (BB code):
/if (${XTarget[1].ID}) {
/tar id (${XTarget[1].ID})
/attack on
}
/if ((!${XTarget[1].ID}) && (${XTarget[2].ID})) {
/tar id (${XTarget[2].ID})
/attack on
}
 
Last edited:
Just a heads up caddie, but you need the Me. before XTarget as it's a member of the Me TLO.


Fuzzy,
${Me.XTarget[]} is the same as ${Me.XTarget}.

You're saying that ${Me.XTarget[1]} will return the correct name of the mob when you have aggro on it, but returns NULL when your merc has aggro and you don't? In the same line of thought, it's the same for ${Me.XTarget[1].ID}, correct with aggro, NULL without?


Have you tried rebooting, or doing a fresh install of MQ2 recently? That'd be step one, as that's not how the XTarget data should be behaving at all.
 
Maybe it's compile specific but I have a scripted a few macros I use that definitely don't use "Me."

all good though, that also works
 
"${Me.XTarget} should return the amount of things on your XTarget window. For instance I use "/if (${Me.XTarget}>3)" on my tanks to activate AE taunt/defensive dicsc, as it indicates there are more then 3 things on the XTarget window.

Thus "${Me.XTarget[]>=1} " (which is giving me an "unmatched bracket or invalid character following bracket" error ingame right now) I imagine ought to be "${Me.XTarget}>=1" to say "if there is 1 or more things on my Xtarget window"

Rich (BB code):
/if (${Me.XTarget[]>=1) {
/target ${Me.Xtarget[0]}
/attack on
}

I am not sure there is an XTarget 0. I get a NULL trying to use it with things on my XTarget. Pretty sure it starts at 1, so

Rich (BB code):
/if (${Me.XTarget}>=1) {
/target ID ${Me.Xtarget[1].ID}
/attack on
}

it is better to use ID when targeting, just to avoid potentially targeting something with the same/similiar name that happens to be closer. That is just my opinion though =)

As a suggestion, you may want to do something like

Rich (BB code):
/if (${Me.XTarget}>=1) {
/target ID ${Me.Xtarget[1].ID}
/delay 5s ${Target.ID}==${Me.XTarget[1]ID}
/if (${Target.ID}==${Me.XTarget[1]ID} && ${Target.Distance}<150) /attack on
}

The delay is to insure time enough for target switching, incase of lag. The condition after the delay timer, if met, will cancel the delay... IE it will delay 5s OR until your target ID is that of XTarget1's ID.

The double check and distance check before turning on attack is so you don't randomly start attacking the wrong target, or try attacking something on the other side of the zone.
 
Rich (BB code):
/if (${Me.XTarget}) {
/delay 1
/xtarget target 1
/delay 1s ${Target.ID}==${Me.XTarget[1].ID} && ${Target.Distance}<150
/squelch /attack on
}

Basically says If there is anything on Xtarget, hold on for a tenth of a second to account for lag and make sure things are populated, target the first one, and wait for either 1 second or until my target is the first one and is in range to attack, then turn on attack, but don't spam me with I'm attacking this messages.

Targeting with /xtarget target 1 targets more reliably than with ID.
Also /target myself is better than /target ${Me.ID} for the same reason. ${Me.ID} seems to be like a spawn search and sometimes gives that there is no spawn id 5129 - 5129 when shit is hitting the fan or whatever.

:)
 
Last edited:
When using the ${Me.XTarget[1].ID} in an /if () statement. The returning a null can mess up the logic, so to get around this, I use 1 of 2 functions and both of them convert a null to something that is usable.

First ${Int[${Me.XTarget[1].ID}]} will return 0(zero) when ${Me.XTarget[1].ID} returns null and ${Bool[${Me.XTarget[1].ID}]} will return FALSE.

I have found using 1 of the 2 I listed helps make my /if () statements more stable.
 
Problem - XTarget bugs

Users who are viewing this thread

Back
Top
Cart