Multi-Incoming Macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Dr. Blunderpants
orc pawn
orc pawn
Posts: 25
Joined: Fri Dec 19, 2003 5:29 pm

Multi-Incoming Macro

Post by Dr. Blunderpants » Sat Feb 21, 2004 4:43 pm

inc.mac

Code: Select all

#turbo 100
Sub main()
/declare npcid global
/declare index global
/declare casters global

/varset index 0
/varset casters 0

/varcalc npcid $searchspawn(npc,loc:$target(x):$target(y),radius:@Param0,next)

:mainloop

/if n $spawn(@npcid,speed)<71.44 {
/if "$spawn(@npcid,class)"=="Shaman" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Cleric" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Druid" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Enchanter" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Wizard" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Necromancer" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Magician" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Beastlord" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Paladin" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Shadowknight" /varset casters @casters+1
/if "$spawn(@npcid,class)"=="Ranger" /varset casters @casters+1
/goto :skip
}
/varcalc index @index+1
/chat #@Param1 [$int(@index)] - Incoming -> $spawn(@npcid,name,clean)

:skip
/varcalc npcid $searchspawn(id:@npcid,npc,loc:$target(x):$target(y),radius:@Param0,next)
/if "$spawn(@npcid,name,clean)"=="NULL" /goto :end
/goto :mainloop

:end
/chat #@Param1 Total incoming: $int(@index) mob(s). Possible casting: $int(@casters)

/return
Description: Macro for pullers to use as an incoming message for more than 1 mob.

Usage: /mac inc.mac <radius> <chat channel name>

All is fine except for casting-on-incoming mobs. I need some suggestions on how I would go about catching them. All I can do atm is flag them as "possible".
Last edited by Dr. Blunderpants on Sat Feb 21, 2004 5:03 pm, edited 1 time in total.
You're ugly.

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Sat Feb 21, 2004 4:51 pm

Is there something missing from your code?
For example, I see /doevents, but no #events.

Is this to be run on the puller, or someone waiting back at camp?

#event incchat " incoming ->"

Sub Events
/if mob is in range {
/target $spawn(npcid)
}
/call cast whatever (use SpellCast.inc)
cycle through your index...
/return

Is that along the lines of what you're looking for?
I'll fire this up in EQ later today and see what I come up with. Could prove handy when PL botting some of my alts.
[b]- Bad Karma
________________________________________[/b]

In our own quest for excellence, we should strive to take the time to help those who help themselves.

All others should [b]RTFM[/b]!!!!!!!!!

Dr. Blunderpants
orc pawn
orc pawn
Posts: 25
Joined: Fri Dec 19, 2003 5:29 pm

Post by Dr. Blunderpants » Sat Feb 21, 2004 5:21 pm

Yeah I dunno why I put /doevents in there a while back, I can't remember. This is for the puller btw, not those at camp.

Working on caster thing. Only idea I have atm is to compare the heading of the possible casting mobs to the puller somehow.

Any suggestions are welcome.
You're ugly.

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Sat Feb 21, 2004 9:45 pm

Best solution I could see would be to beg, plead, buy beer, etc to get the animation flag found in $target(animation) into $spawn. Credit for that idea goes to Driftinsupra from this thread from a bit ago:

http://macroquest2.com/phpBB2/viewtopic.php?t=5101

Failing that, you could pretty robustly do it if you were willing to /target, and check either animation, or simply /assist off the target (if in range) and then check:

/if n $target(id)==$char(id) {
//mob agro on me
}

Probably better to work out the animation path however as accurately assisting requires a script side delay in my experience and if you're moving and the mob ain't, you might be out of range fairly often which would negate /assist (I have no idea what the range on /assist is btw but it's not massive).

But given that, when do you propose to be calling this script? Before you make the pull, while you're making it, when you're nearly back at camp? Do you have a set terrain that you can use to break LoS and get the mobs to run after they're finished casting? To be honest, I think I'd simply run before I pull given assist ranges which as a puller you can work out pretty quickly for a given environment with MQ and call it a day. If you're planning to use this in a real group (or anyone else using it for that matter), I wouldn't put the level of detail you're currently doing into the script for the chat report as people don't do it by default. PLing bots like BK suggested sure why not (though if PLing I don't really see why you need this anyway... heh).

Unfortunately I don't have any good ideas for checking this easily through $spawn as the current implemlentation stands.

G