DarkLatto80
New member
- Joined
- Dec 23, 2016
- RedCents
- 0¢
Hello all, semi-new here (I believe this is my first post, although I've been hovering for years)... I nabbed level 2 again simply to root around and see if I could find an answer to my questions, but it seems I cannot find precisely what I am looking for. (anywhere, I also read on several other sites and have VIP there too)
I would consider myself intermediate in MQ2 coding, although I feel like a noob (others think I am some genius but I cannot hold a candle to the guys that write these macros that are thousands of lines long), no where near the "fluent" that Maskoi references in his posts. I've been using MQ2 for about 5 years I guess, but I work a full time job (typically 60-90 hours a week) and have a family with two children so my time is very limited.
I've been creating a series of snippets to be handled through MQ2Melee. Mostly for my mother, who just turned 68, and needs something simple and turnkey. Also, we play on the THF server and use the MQ2EMU UF Gold compile. (not sure if that will make any difference or not, but thought I should share that).
Anyway, what I am trying to accomplish is a simple loop to be run on a timer to check pet health and cast an assigned heal where necessary. I have forgotten more things than I can recall about what I have tried. My latest run was with MQ2NetBots:
/if (${NetBots[X].PetHP}=100 && ${Cast.Ready})
/multi ; /target id ${NetBots[X].PetID} ;
/casting "Spiritual Touch Rk. II" -maxtries|3
With this I keep getting an error that states "non-numeric," and the /echo error shows @6 "100=100 && TRUE," ironically, which is (${NetBots[X].PetHP}=100 && ${Cast.Ready}). (btw X = name of toon)
I've attempted altering it a bunch of ways. When I /echo each piece alone, they all return what I am looking for, but the flow in macro form isn't working. (if there is any stupid typos here it's because I am just typing it out fast, the typos I can assure you aren't in the original works)
I also previously attempted this in my cleric macro without any success (just to add a loop at the end to check pets)... Ironically, the cleric macro, which is super simple, just runs through everyone's HP in group, checks PctHPs, then if below certain intervals 80%, 65%, or 50% it casts heals, uses clickies, or DI where needed and it has 0 errors. However, pets are just a pain for some reason and I know I am just over looking something stupid in my logic... (this is just an excerpt of the Sub PetHealLoop, of course my declarations were all made at the start of the macro)
varset MendPet ${PetHealSpell}
/if (${Group.Member[${GrpMem}].Pet.ID}) {
/if (${Group.Member[${GrpMem}].Pet.PctHPs} < ${PetHealthPct}) {
/target id ${Group.Member[${GrpMem}].Pet.ID}
/g Casting ${MendPet} on ${Target}
/casting "${MendPet}" -targetid|${Group.Member[${GrpMem}].Pet.ID} -maxtries|5
Any help, ideas, or cleaning up of my nonsense is appreciated... Thanks in advance. I've spent months of frustration trying to get this stuff to work. (Thu Jul 27, 2017 6:11 pm was my last post on this topic)
I can live without it, but my mom really wants it on her SHM...
- - - Updated - - -
I wonder if...
/if (${If[${NetBots[X].PetHP}<80(bool),true,false]}=TRUE && ${Cast.Ready})
would fix the error... I'll test that when I get home...
I would consider myself intermediate in MQ2 coding, although I feel like a noob (others think I am some genius but I cannot hold a candle to the guys that write these macros that are thousands of lines long), no where near the "fluent" that Maskoi references in his posts. I've been using MQ2 for about 5 years I guess, but I work a full time job (typically 60-90 hours a week) and have a family with two children so my time is very limited.
I've been creating a series of snippets to be handled through MQ2Melee. Mostly for my mother, who just turned 68, and needs something simple and turnkey. Also, we play on the THF server and use the MQ2EMU UF Gold compile. (not sure if that will make any difference or not, but thought I should share that).
Anyway, what I am trying to accomplish is a simple loop to be run on a timer to check pet health and cast an assigned heal where necessary. I have forgotten more things than I can recall about what I have tried. My latest run was with MQ2NetBots:
/if (${NetBots[X].PetHP}=100 && ${Cast.Ready})
/multi ; /target id ${NetBots[X].PetID} ;
/casting "Spiritual Touch Rk. II" -maxtries|3
With this I keep getting an error that states "non-numeric," and the /echo error shows @6 "100=100 && TRUE," ironically, which is (${NetBots[X].PetHP}=100 && ${Cast.Ready}). (btw X = name of toon)
I've attempted altering it a bunch of ways. When I /echo each piece alone, they all return what I am looking for, but the flow in macro form isn't working. (if there is any stupid typos here it's because I am just typing it out fast, the typos I can assure you aren't in the original works)
I also previously attempted this in my cleric macro without any success (just to add a loop at the end to check pets)... Ironically, the cleric macro, which is super simple, just runs through everyone's HP in group, checks PctHPs, then if below certain intervals 80%, 65%, or 50% it casts heals, uses clickies, or DI where needed and it has 0 errors. However, pets are just a pain for some reason and I know I am just over looking something stupid in my logic... (this is just an excerpt of the Sub PetHealLoop, of course my declarations were all made at the start of the macro)
varset MendPet ${PetHealSpell}
/if (${Group.Member[${GrpMem}].Pet.ID}) {
/if (${Group.Member[${GrpMem}].Pet.PctHPs} < ${PetHealthPct}) {
/target id ${Group.Member[${GrpMem}].Pet.ID}
/g Casting ${MendPet} on ${Target}
/casting "${MendPet}" -targetid|${Group.Member[${GrpMem}].Pet.ID} -maxtries|5
Any help, ideas, or cleaning up of my nonsense is appreciated... Thanks in advance. I've spent months of frustration trying to get this stuff to work. (Thu Jul 27, 2017 6:11 pm was my last post on this topic)
I can live without it, but my mom really wants it on her SHM...
- - - Updated - - -
I wonder if...
/if (${If[${NetBots[X].PetHP}<80(bool),true,false]}=TRUE && ${Cast.Ready})
would fix the error... I'll test that when I get home...