Target.PctHPs wrong

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

Sorry
orc pawn
orc pawn
Posts: 20
Joined: Thu Oct 26, 2006 6:18 pm

Target.PctHPs wrong

Post by Sorry » Thu Dec 11, 2008 4:38 pm

The Target.PctHPs value is often wrong after I target the nearest spawn. I don't know under what other situations this bug occurs. My macro is spitting out debug info and I could see it return 100 for a mob which was at about 20% health. Since it was targeted (duh!) I could see the mob's health in the standard EQ User Interface. I don't know if this happens all the time but it certainly happens frequently. Strangely if I do an /echo ${Target.PctHPs} it returns the correct value.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Dec 11, 2008 5:02 pm

Code: Select all

/target id ${MobID}
[color=red]/delay X[/color]
/echo ${Target.PctHPs}
This is not a bug. This is the way EQ works. Information on the target is not instant -- you must wait X for a round trip to the server.

X is dependent on your network latency. Most 'bot macros have code to deal with this -- check out that code.

Sorry
orc pawn
orc pawn
Posts: 20
Joined: Thu Oct 26, 2006 6:18 pm

Post by Sorry » Thu Dec 11, 2008 5:19 pm

First, wow you are fast!

Posting here is my last resort because I don't want to waste your time with my own stupid bugs. This is the code I am using:

Code: Select all

/target ${NearestSpawn[NPC]}
/doevents
/delay 2
/if (${Target.PctHPs}==100) {
    |Attack the mob...
}
The problem is that when the Target.PctHPs fails, I am going to kill steal someone which ends up lowering my player faction. Turns out is all a necro needs to do is give a mob a dirty look to kill steal a monk.

I will keep playing with the /delay until I find a number that works. I am a bit worried that a lag spike on my end will cause me to KS someone.

-Sorry

User avatar
Magoo
a grimling bloodguard
a grimling bloodguard
Posts: 690
Joined: Tue Jun 17, 2008 4:05 pm

Post by Magoo » Thu Dec 11, 2008 5:26 pm

Code: Select all

/delay 2 
That is only .2 seconds right?, not sure what your ping is, but on dial up mine is a bit higher then that.

Sorry
orc pawn
orc pawn
Posts: 20
Joined: Thu Oct 26, 2006 6:18 pm

Post by Sorry » Thu Dec 11, 2008 5:30 pm

Follow up questions: I am guessing that this update time is going to prevent NearestSpawn[NPC].PctHPs from working correctly since there is no way to insert the delay? If I first put the ID of the nearest spawn into a variable, delayed and then tested the spawn's PctHPs, would that allow the server to update? Should I always use /target with a delay for best results?

-Sorry

toomanynames
a grimling bloodguard
a grimling bloodguard
Posts: 1844
Joined: Mon Apr 11, 2005 11:10 am

Post by toomanynames » Thu Dec 11, 2008 5:33 pm

The delay is needed to compensate for latency between the moment a /target is issued to the point the network traffic reaches your client.

In the example the delay is located correctly, just make the delay longer, /delay 5 for example (these are tenths of a second iirc)

It isn't the server you wait for but the info to reach your client (afaik)
Last edited by toomanynames on Thu Dec 11, 2008 5:34 pm, edited 1 time in total.
[quote="DKAA"]You cant. Only the server knows.[/quote]

Sorry
orc pawn
orc pawn
Posts: 20
Joined: Thu Oct 26, 2006 6:18 pm

Post by Sorry » Thu Dec 11, 2008 5:33 pm

Magoo wrote:

Code: Select all

/delay 2 
That is only .2 seconds right?, not sure what your ping is, but on dial up mine is a bit higher then that.
It may be enough for my DSL connection but probably not enough for reliability. Now I know what is going on, I will rewrite the macro so that the mob gets targeted much sooner and the PctHPs test occurs right before I attack the mob with a delay of at least a second or two in between.

Perhaps my character will no longer be the most hated PC in the zone now.

Thanks everyone!

-Sorry

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Dec 11, 2008 8:27 pm

Code: Select all

/target clear
/delay 200s !${Target.ID}
/target ${NearestSpawn[NPC]}
/doevents
/delay 200s  ${Target.ID}
/if (${Target.PctHPs}==100) {
    |Attack the mob...
}

FrankJScott
naggy
naggy
Posts: 2128
Joined: Sun Feb 19, 2023 7:11 am

Useful Thai Online Slot Casino Info

Post by FrankJScott » Mon Aug 04, 2025 7:05 pm

In response to the person talking about casino on line, betus208, liberty slots no deposit bonus, free slot apps, play luckyland, play sweepstakes online for money, bitcasino, manhattan slots, slotzilla free slots, play free casino games, I highly recommend this top Thai online slot casino blog or playtech slots, virgin casino online, rock n cash casino slots, best online casino fast payout, bally's online casino, online casino free sign up bonus, pompeii slot machine, draftkings slots, huuuge casino slots vegas 777, betchain, not to mention this related site about Thai online slot casino site as well as lobstermania 2, royal vegas online casino, best gambling websites, great win casino, online casino free play, goonies slots, treasure mile casino, online casino welcome bonus no deposit, free roulette, judi slot, on top of this the full details for Thai online slot casino tips which is also great. Also, have a look at this going here for Thai online slot casino tips and don't forget jackpot mania, slots of vegas, all star slots no deposit bonus, betly sportsbook, 7bit casino no deposit bonus, best free slot games for android, crypto slots, pay by phone casino, online casino no deposit bonus, slots of vegas free spins, not to mention this top Thai online slot casino info together with sweepstakes slots, 777 casino free spins, online slots real money no deposit, triple diamond slots, treasure mile casino, use this link on as well as mbitcasino, true poker, boss casino, free pokie games, joker slots, for good measure. Check more @ New Tesla Accessories Site 9a89a61