Simple Heal Macro

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Empathy88
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Mar 20, 2011 1:43 pm

Simple Heal Macro

Post by Empathy88 » Sun Mar 20, 2011 1:46 pm

Sub Main
/target Name
/if(${Target.PctHPs}<60)
{
/cast 8
}
/return




---------------------

This is the first macro I have ever written so go easy. It's so simple I thought for sure I could get it to work heh, what happens is my cleric just spams heal even when my target is at 100% health. But the if statement to me seems correct, any help from the pro's please? Thank you.

Milten
a hill giant
a hill giant
Posts: 176
Joined: Thu Oct 09, 2003 11:40 am

Re: Simple Heal Macro

Post by Milten » Sun Mar 20, 2011 3:22 pm

I can't, but what I can do is tell you how the spend the best 10$ you will ever spend in your entire life. ever.

Donate for VIP.

Then get Modbot.

Trust me on this one.

doormat
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sat Mar 26, 2011 12:46 am

Re: Simple Heal Macro

Post by doormat » Thu Apr 07, 2011 12:17 am

/target is something that is asychronous to your code execution, probably because the client actually generates a packet and waits for a response when a target is changed. When you execute /target it is non-blocking, the result is that any subsequent code that depends upon the Target TLO being changed may be interacting with stale data. So you need to synchronize somehow. The easiest thing to do is to simply add a delay, such as /delay 5. Experimentally that's enough for me on DSL, most of the time. It isn't 100%.

In theory you can use delay differently, using the first parameter as a timeout, while the second parameter is a condition for wake-up (see wiki). Experimentally I tried this: /delay 10s ${Target.ID} but that didn't quite work out. I think this is the general form of the "best" solution, but I'm still a novice myself and I'm not entirely sure which aspects of the Target TLO get "updated" when the target is changed such that you can wait on them to become valid.

VIP section definitely has loads of good stuff, but if you just want to understand, I think this is generally the problem you're having.

Qhynos
a ghoul
a ghoul
Posts: 81
Joined: Fri Jul 14, 2006 6:19 pm
Location: The Bunker in San Diego, CA

Re: Simple Heal Macro

Post by Qhynos » Thu Apr 14, 2011 1:12 pm

When you target anything in EQ, you need to delay long enough before the next instruction to ensure that the target is set. Use a /delay with a check like:

Code: Select all

Sub TargetMyBuddy(string mybuddysname)
	/declare mobid int local ${Spawn[mybuddysname].ID}
	/target id ${mobid}
	/delay 10 ${Target.ID} == ${mobid}
/return
In addition to this, you will need an extra delay afterward if you are about to check extended information like buff duration on group members as it takes a bit for the server to send some target details to your client. Usually /delay 2 is adequate, but it depends on your network connection latency.

demonmachine666
orc pawn
orc pawn
Posts: 18
Joined: Sun Mar 11, 2007 11:06 pm

Re: Simple Heal Macro

Post by demonmachine666 » Thu Apr 14, 2011 4:37 pm

Try this:

Code: Select all

Sub Main
/target Name
/if (${Target.PctHPs} < 60)
{
/cast 8
}
/return
Not sure if fixing the space on your /if statement will fix it or not but it should.

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

Excellent Product Guide

Post by FrankJScott » Fri Aug 18, 2023 6:44 pm

Why don't you Google it! before you post

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

Best Toto Slot Info

Post by FrankJScott » Sat Aug 19, 2023 10:13 am

Sebagai balasan untuk pria bertanya tentang nama nama situs judi slot online terbaik, game slot terpercaya, daftar judi onlen terpercaya, judi slot online itu apa, slot dan togel gacor, situs judi terpercaya di indonesia, daftar slot dan togel, bola bola slot, agen gacor slot, slot deposit pulsa 2023, situs online slot terpercaya, situs slot indonesia, game slot terpercaya di indonesia, rtp yang gacor hari ini, link situs slot resmi, slot terpercaya gacor hari ini, tempat togel terpercaya, agen slot resmi terpercaya, situs slot terlaris, situs judi slot terbaik di indonesia, Saya dapat menjamin ini situs slot gacor for toto togel deposit pulsa, togel no 1 di indonesia, agen slot terpercaya indonesia, togel online resmi, menang judi terbesar, situs terpercaya slot, daftar gacor, agen game slot online, link judi slot terbaik, game slot terpercaya deposit pulsa, toto slot togel, situs judi slot gacor, situs link togel, daftar togel onlen terpercaya, daftar slot gacor 2023, togel dan pragmatic, bola gacor com, togel online terbaik, judi slot terpercaya, daftar judi deposit pulsa, also. See More Recommended Toto Togel Guide 52a1b86