Macro Targeting

Tempest

Lifetimer
Joined
Jul 20, 2008
Messages
278
Reaction score
0
Points
16
Hi guys...

Have a hunter type Mac I am trying to write and I hate the spam I get when there is no target...

So I was thinking about adding a spawn check in there or something but when I did it just ignored the mobs altogether....

Any ideas how I should change this to get it to work?

I want it to check if there is a current target, if not check within a 220 radius, if none wait for 10 seconds and check again...

It may be completely wrong but I am still learning and have only guessed this by looking at other macros and trying to think of how to write it...

Thanks!

Code:
Sub FindTarget       
	:TargetLoop
		/if (!${Target.ID} && ${SpawnCount[radius 220]} < 0) {
		/tar npc radius 220
		} else {
		}
		/delay 10s
		/goto :TargetLoop
	/call Main
/return
 
Code:
Sub FindTarget       
    :TargetLoop
    /if (!${Target.ID} && ${SpawnCount[radius 220]}) {
        /tar npc radius 220
        /delay 1s ${Target.ID}
    } 
    /if (!${Target.ID}) /goto :TargetLoop
/return
 
Thanks!

Thanks, will give it a go when it isn't past 1AM.

Zzzz
 
your issue was SpawCount Radius 300 and your target npc radius 220 ( you are checking a bigger distance then you are targeting)

You can also use /squelch /target to remove the target chatlines but would cause performance issues after awhile.
 
I tried it but it still gives the "There are no spawns matching:(0-100) nps Radius: 220" spam.

And having the 300 and the 220 was a typo brought on by the flu/being so late lol.
 
SpawnCount[NPC Radius 220] I didnt notice it last night I just copied your line.

SpawnCount[radius 220] will pick you up as well
 
Just a note since JJ didn't mention it.

You do not need:
Code:
/call Main
anywhere in your macro. The /return at the end of a sub takes you back to wherever it was called from, at the very next line. Example.

Code:
Sub Main
   /echo This is my main sub.
   /call MySub
   /echo This is after I called MySub
/return

Sub MySub
   /echo I am in MySub.
/return

Typed this off the top of my head, but this should produce output as follows:
Code:
This is my main sub.
I am in MySub.
This is after I called MySub

Now if your MySub looked like this:

Code:
Sub MySub
   /echo I am in MySub.
   /call Main
/return

I believe it would cause an infinite loop. I haven't tested it, but logically you'd get output as follows:

Code:
This is my main sub.
I am in MySub.
This is my main sub.
I am in MySub.
This is my main sub.
I am in MySub.
This is my main sub.
I am in MySub.

Repeat until something breaks it.

I hope this teaches somebody something =) Also, somebody correct me if I'm wrong and there is parser logic in place to prevent /call Main from doing that. I did not log in to test it.
 
SpawnCount[NPC Radius 220] I didnt notice it last night I just copied your line.

SpawnCount[radius 220] will pick you up as well

Thanks for that JJ, works like magic now :)

And thanks 40oz for the info, I'll take free advice :)