Can I do this any better?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

arantius2
orc pawn
orc pawn
Posts: 12
Joined: Sun Sep 01, 2002 10:10 pm

Can I do this any better?

Post by arantius2 » Sun Sep 01, 2002 10:22 pm

Code: Select all

Sub findTarget
    /target npc bear
    /varset v20 $target(distance)
    /target npc kodiak
    /varset v21 $target(distance)
    /target npc spiderling
    /varset v22 $target(distance)
    /target npc puma
    /varset v23 $target(distance)
    /target npc lion
    /varset v24 $target(distance)
    /target npc cat
    /varset v25 $target(distance)

    /varset v18 15000
    /if n $v20<$v18 {
        /varset v18 $v20
        /target npc bear
    }
    /if n $v21<$v18 {
        /varset v18 $v21
        /target npc kodiak
    }
    /if n $v22<$v18 {
        /varset v18 $v22
        /target npc spiderling
    }
    /if n $v23<$v18 {
        /varset v18 $v23
        /target npc puma
    }
    /if n $v24<$v18 {
        /varset v18 $v24
        /target npc lion
    }
    /if n $v25<$v18 {
        /varset v18 $v25
        /target npc cat
    }
/return
This is a subroutine from my macro that kills the appropriate animals in EC that drop quality pelts and spiderling silks to make leather padding with. So clearly I target each of the appropriate mob (it chooses the closest right?) then I figure out which one of that list is the closest of them all.

Unfortunately it goes around rapidly targeting mobs all over the zone which is just not something I consider all that wise to do. Is it possible to instead of /target closest [name] do a single /target closest [name]|[name]|[name]|[name] ? Something similar? Thanks!

crazyshiza
decaying skeleton
decaying skeleton
Posts: 9
Joined: Tue Aug 20, 2002 7:43 pm

Post by crazyshiza » Sun Sep 01, 2002 11:48 pm

this is what I'd do...

/alert add 1 npc bear
/alert add 1 npc kodiak
/alert add 1 npc spiderling
/alert add 1 npc puma
/alert add 1 npc lion
/alert add 1 npc cat

/target $alert 1

this will target the closest of any of those mobs