Magepet assist

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

Moderator: MacroQuest Developers

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Magepet assist

Post by Vire » Wed Mar 09, 2011 11:51 am

Hi. First time posting, just looking for some quick help on what is basically my first attempt at making a macro. I'm using three mage characters (3 boxing), each with a pet and grouped together. One mage will be the primary character I play. What I want is to play on the main character as normally, have the other two mages /stick (which I've gotten working of course) and follow me, then when I send my pet in on the main character to attack an npc, I want the two other mages to assist the main characters pet and send their pets in against it as well.

I thought it would have been pretty simple and I've tried a few different tactics, to some success, but it's still really inefficient/spammy. I mean I've gotten it working to the extent that the mages will assist, send their pet in either constantly or by some delay. The problem is not getting them to attack, its getting them to know when they're attacking and to stop spamming attack. First, because I don't really like seeing chat endlessly filled with "Attacking blank master", and I don't want "That is not a legal target" spammed when my main pet doesn't have a target (seeing as assist retardedly selects the target of assist if that target has no target)

So I guess what I'm really looking for; is there a reliable method of getting the macro to detect if someone (main pet) is in combat? I figured that way, I could have it still reiterate itself faster (I was using a /delay 10s before but it's too slow for my purposes and still spammy anyway), as well as not spam unless I'm actually in a fight. My macro as it is basically attempts to attack anything I target, which sucks, but I just don't understand the commands enough to figure out another way.

I've tried looking at other mage pet assist macros around here but they're all sort of confusing, and invariably bloated with making the mage cast spells and heal and buff and all nonsense I neither need nor want.

Here's what I've got so far;

Code: Select all

Sub Main

:loop
/assist blank
/goto :pet
}

:pet
/if ((${have_target}) && (! ${Target.PC})) {              < FYI; I don't know if Target.PC is even a valid statement, I was just hoping it wouldn't target PCs that way... didn't really work.
/delay 5s
/goto :loop
} else {
/delay 1s
/pet attack
/goto :loop
}

Last edited by Vire on Fri Mar 11, 2011 1:46 am, edited 2 times in total.

Sym
Macro Author
Macro Author
Posts: 107
Joined: Mon Jul 05, 2004 2:45 am
Contact:

Re: Magepet assist

Post by Sym » Wed Mar 09, 2011 1:12 pm

Try using this /if line instead

Code: Select all

/if (${Target.ID} && ${Target.ID} != ${Spawn[MAGENAME].ID}) {
Replace MAGENAME with the main mage name.
Last edited by Sym on Wed Mar 09, 2011 4:28 pm, edited 1 time in total.

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Wed Mar 09, 2011 1:59 pm

Thanks for the quick response! And blank is the main mage. I'd meant to change that back to 'main mage' or something when posting but was in a rush.

Anyway, I appreciate the revision because I realize my if statement wouldn't have worked. I do have a concern though, which is that;

I am assisting blank, so I won't actually be targeting him. At least, not ideally - it does wind up targeting him when he has no target and continues assisting.

Ideally what I'm looking for is a way for the macro to know if it's been executed on a specific mob before or not. Like is there a way to get some sort of unique ID for the assist target, see if it's executed '/send pet' previously on that ID, and stop? Because I only really want it to do '/send pet' one time, per target at least.

Part of the problem is I'm not really sure I understand some of the syntax here. Like with the /if (${Target.etc - what is the significance of the $... little things like that. Not entirely sure I understand what the IDs mean either. Does your code
"/if (${Target.ID} && ${Target.ID} != ${Spawn[blank].ID}) {"
mean target.id is defined as spawn blank? so.. if the target equals blank, then continue. (EDIT: I just realized you've got a != in there... so I guess it means the opposite; if blank as target then dont continue, and even if not then that's handy for another problem I was having)


It would be handy if MQ2 could identify if a target has a pet or not. I know it can do that for the one running the macro, with /if (${Me.Pet.ID} - (at least I think) - but I haven't seen it mentioned anywhere if it can do Target.Pet.ID or such.

At any rate I'll give your code a go - maybe it's doing something I don't comprehend - and post back with results.

[edit] I was thinking I could try this;

Code: Select all

Sub Main

:loop
/assist blank
/if (${Target.ID} && ${Target.ID} !=${Spawn[blank].ID}) {"
/goto :pet
} else {
/goto :loop

:pet
/delay 1s
/pet attack
/goto :loop
That should solve my problem of the pet trying to kill the main mage when the two bots assist blank and he doesn't have a target (which makes them target him). Now I just need to figure out how to stop them from endlessly spamming attack on the same target.

[edit] replaced main mages name with blank.
Last edited by Vire on Fri Mar 11, 2011 1:42 am, edited 2 times in total.

Zenevil
orc pawn
orc pawn
Posts: 28
Joined: Fri Aug 14, 2009 9:11 am

Re: Magepet assist

Post by Zenevil » Wed Mar 09, 2011 3:46 pm

if I was you I would edit your post and remove you name. Its just asking for trouble to post you char name on these boards

Sym
Macro Author
Macro Author
Posts: 107
Joined: Mon Jul 05, 2004 2:45 am
Contact:

Re: Magepet assist

Post by Sym » Wed Mar 09, 2011 4:28 pm

The $ is used to specify a variable, in this case the identify of the target. It basically says if you have a target and that target is not your main mage to /goto :pet

Try this:

Code: Select all

Sub Main

    /declare MainMage string magename
    /declare SendPet int 1
    
    :Start
    /assist ${MainMage}
    /delay 5
    /if (${Target.ID} && ${Target.ID} != ${Spawn[pc ${MainMage}].ID} && ${SendPet}) {
        /varset SendPet 0
        /pet attack
    }
    /if !${Target.ID} /varset SendPet 1
    /delay 1s
    /goto :Start

/return
This sets a flag SendPet if you need to send in pet, if you have sent pet once it won't keep doing it. Once the mob dies and you have no target Target.ID will not be set so it'll reset SendPet for the next mob.

Change magename to your mage's name.

You can get other spawns pet via ${Spawn[name].Pet.ID}, target's pet would be ${Spawn[id ${Target.ID}].Pet.ID}

And yes, I would edit your post to remove the name of your character.

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Wed Mar 09, 2011 8:31 pm

I've followed both of your advice and removed the name, although I doubt there was anything to be worried about anyway.

Anyway, regarding the code; first of all, thanks! That is a lot neater than mine was and now I understand what the $ is doing too.
I do seem to be having a problem. It's doing exactly what I want it to do - magebot will assist mainmage, pick up the target and send pet, and only do it once to boot! The problem though is that it ends right after that! I'm just not sure why after looking at the code; it ought to be going back to the start and looping, but it doesn't.

The only clue I have is I'm getting an error in the MQ2 console when I start the macro, even though the macro works.
Failed to parse /if command. Expected () around conditions.
Assist.mac@13 (Main): /if !${Target.ID} /varset SendPet 1
The current macro has ended.
Usage: /if (<conditions>) <command>
I can see it's expecting a ( prior to the !$ ... at least that's what I assumed, since the above /if is done that way. If I add a ( prior to that it tells me it can't find the command - although I note, the macro still works fine either way, it just keeps ending when I want it to loop. Very bizarre.

Deeprave
a ghoul
a ghoul
Posts: 115
Joined: Sun Jul 11, 2010 9:46 am

Re: Magepet assist

Post by Deeprave » Wed Mar 09, 2011 9:22 pm

Vire wrote:I can see it's expecting a ( prior to the !$ ... at least that's what I assumed, since the above /if is done that way. If I add a ( prior to that it tells me it can't find the command - although I note, the macro still works fine either way, it just keeps ending when I want it to loop. Very bizarre.
It ends because of the error. Surround !${Target.ID} with (brackets) and the :goto Start will get reached.

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Thu Mar 10, 2011 1:34 am

Ah... I knew what was causing it, just wasn't sure where to put the brackets. Doing;
/if (!${Target.ID}) (/varset SendPet 1)
fixed the error problem.

I note now that it works perfectly the first time at assisting and sending the pet - but on subsequent targets doesn't appear to.

Sym
Macro Author
Macro Author
Posts: 107
Joined: Mon Jul 05, 2004 2:45 am
Contact:

Re: Magepet assist

Post by Sym » Thu Mar 10, 2011 2:32 am

Sorry about the missed ( ), I whipped this together and didn't check it very closely. The correct line should be

Code: Select all

/if (!${Target.ID}) /varset SendPet 1

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Fri Mar 11, 2011 1:37 am

Sym wrote:Sorry about the missed ( ), I whipped this together and didn't check it very closely. The correct line should be

Code: Select all

/if (!${Target.ID}) /varset SendPet 1
That's fine, I appreciate the help.

I seem to be having an issue with it still however. It now doesn't error with the correct /if, and it assists and sends pet to my target correctly the first time. But after that first target is dead, the magebots will continue to assist mainmage, but they won't send their pets to attack new targets. Any ideas?

Gomer
a snow griffon
a snow griffon
Posts: 304
Joined: Fri Apr 15, 2005 2:38 pm

Re: Magepet assist

Post by Gomer » Fri Mar 11, 2011 3:09 pm

Vire wrote:
Sym wrote:Sorry about the missed ( ), I whipped this together and didn't check it very closely. The correct line should be

Code: Select all

/if (!${Target.ID}) /varset SendPet 1
That's fine, I appreciate the help.

I seem to be having an issue with it still however. It now doesn't error with the correct /if, and it assists and sends pet to my target correctly the first time. But after that first target is dead, the magebots will continue to assist mainmage, but they won't send their pets to attack new targets. Any ideas?
The MQ2Melee plugin has full pet support. Just use that and use /killthis to make it engage each mob. Even better, use Autobot or one of the other generic macros to drive your slave Mages including their nukes/pets and buffs. Those macros generally use MQ2Melee for the pet control also.

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Sat Mar 12, 2011 2:03 am

Yeah... but AutoBot is VIP - and I'm not paying for a simple convenience script - and some of these other macros that I'm sure do what i want somehow somewhere, are just so huge and cluttered that I haven't the faintest clue how to get them working. MageBoT is an example of that, pages and pages of code, with virtually no explanation for how to set it up or use it. That seems to be a common theme amongst these macros unfortunately. One would think it isn't that difficult to write some example macros with line by line explanations of how/what they're doing... but I haven't found any ;/

At any rate I guess I'll look into the MQ2Melee thing, I just don't really know what I'm doing here, so when you generalize by saying "Use X" and "Use Y" I'm sort of just left scratching my head. I realize there's a page on MQ2Melee at least that I've been looking through, but it's not so much a 'guide' as it is a pile of syntax with little context.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Re: Magepet assist

Post by ieatacid » Sat Mar 12, 2011 10:52 am

MQ2Melee is VIP too :wink:

grumpyogre
a ghoul
a ghoul
Posts: 142
Joined: Fri Jul 07, 2006 7:18 am

Re: Magepet assist

Post by grumpyogre » Sat Mar 12, 2011 12:12 pm

Not to sound like a jerk, but if you cant figure out how to configure an .ini I don't see you writing an effective macro! ALL of the macros have enough instructions that even an old fat dude like me can figure them out. Hell Im usually drunk when I EQ and I still have no trouble setting up the .inis found here.

As for not paying the 15$. Fuck, just answering a post here takes someone five minutes. I charge $60 an hour in my profession, by the time I am done writing this post I have donated $1 of my time. The folks that spend days on this stuff are LONG over loving EQ, and they are LONG over you and I, the jackasses that dont know wtf we are doing so we rely on them. My point? Pay up and take 10 minutes to read a wiki or two and you have what you want, for 15$! Well worth the money and most certainly worth the time to do both.

Vire
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Jul 05, 2010 12:51 pm

Re: Magepet assist

Post by Vire » Mon Mar 14, 2011 12:24 am

Maybe you don't realize, but some of us are poor students who can't afford to dish out $15 for everything that strikes our fancy. I'd love to be able to buy VIP access, but it's a luxury, and I can't afford luxuries at the moment. Sorry if you have a failure of imagination of others situations. If I earned $60 an hour I would just buy it.

And if the people on here no longer like EQ or helping with Macros, then why support a program designed to build macros for a game with a subsequent help forum? So far Sym has been pretty helpful. You other guys not so much.

Moreover, your overall message is that if the total newbie to programming can't configure the 1600 line macro he sucks and should quit? Seriously? Thanks for the help.