• IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

Question - Trying to make a basic macro that runs around and kills shit...

#1
...but right now all it does is run around.

Ultimately I am trying to make farming tradeskill mats for artisan's prize easier. Kissassist is total overkill for doing it so I wanted to make it attack on my own. Right now what I am trying to do is make it so when the character enters combat it begins the Attack subroutine and when he exits combat it ends that subroutine. For some reason though the macro is refusing to do what I would like it to do.

Can anyone assist?


Rich (BB code):
-------------
Riftseekers' Sanctum "Pyrilen Flame" Farming Macro
----------**|

Sub Main

:loop
	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack

/return

:loop

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Riftseekers Main Farm Subs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers

/return

Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
	/delay 500s
	/call LeaveUpper
/return

Sub LeaveUpper

	/echo I have cleared everything there is to clear in Upper Riftseekers, it is time to leave - I am heading out.
	/delay 250s
	/play LeaveUpper
	/echo We have finished leaving Upper Riftseekers
	/delay 200s

/return


Sub GroundLevel

	/call Pet
	/delay 1s
	/echo Clearing the ground floor
	/play Ground
	/delay 300s

/return

Sub LowerRiftseekers

	/call pet
	/play LowerRiftseekers

/return


Sub LeaveLower

	/call pet
	/play LeaveLower

/return


Sub WallofSlaughter

	/echo I am in Wall of Slaughter, running to Muramite Proving Grounds
	/call Transport
	/delay 5s
	/path PortintoMPG
	/delay 60s
	/click left door
	/delay 60s ${Zone.ShortName.Equal[provinggrounds]}==TRUE
/return

Sub MPG

	/echo I am in Muramite Proving Grounds now. Time to navigate this shit hole. Took like fucking 45min to do all these locations.
	/call Transport
	/path MPGtoRiftseekers
	/delay 60s
	/doortarget CT_Crystal
	/click left door
	/delay 1s
	/moveto loc ${Switch.DefaultY} ${Switch.DefaultX}
	/keypress u
	/delay 60s ${Zone.ShortName.Equal[Riftseekers]}==TRUE
/return





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Utility" Subs"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Pet

	/echo I am now buffing my pet up
	/delay 1s 
	/pet hold off
	/delay 1s 
	/pet ghold off
	/delay 1s 
	/cast 9
	/delay 7s 
	/cast 10
	/delay 7s 
	/alt act 323
	/delay 7s 
	/alt act 852
	/delay 3s

/return

Sub Transport

	/echo Getting ready to run across an unfriendly zone
	/delay 1s
	/alt act 1210
	/delay 3s
	/pet hold off
	/delay 1s
	/pet ghold off
	/delay 1s

/return	

Sub Attack

	/echo Letting you know I called Attack Rotation (when I finally see this fucking echo im going to squeal with joy)
	/afollow pause
	/clear target
	/delay 1s
	/target npc

	/if (${Me.AltAbilityReady[Force of Elements]} && !${Target.Type.Equal["corpse"]}) /alt act 8800
	/if (${Me.PctHPs}<=50 && ${Me.AltAbilityReady[${Elemental Ward}]}) /alt act 2060
	/if (${Me.Combat} && ${Me.SpellReady[${Remorseless Servant}]} && ${Target.Distance} <= 35) /cast 3
	/hidecorpse all
	/if (${Me.CombatState.NotEqual[COMBAT]}) /afollow unpause
	/if (${Me.CombatState.NotEqual[COMBAT]}) /return



Sub Cauldron

	/if (${FindItem[Cauldron of Countless Goods].RecastTimer} !< 0) /broken
	/echo Using Cauldron of Countless Goods. Hopefully I get something good!!
	/nomodkey /itemnotify "${FindItem[Cauldron of Countless Goods]}" rightmouseup
	/delay 25s
	/autoi
/return
 

Warl0ck45

New member
RedCents
6,536¢
#2
Rich (BB code):
Sub Main

:loop
	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack

/return

:loop
Not sure why you have loop in there twice, and not really seeing where it would loop. Most macros I have seen have a "Mainloop" and "/goto Mainloop" or something similiar. Else, what is the main loop "/return"ing to?

Your attack sub has a conditional return. If that condition is not met though, there is no command for it to leave the sub routine, and would appear to overflow into the next sub.

That is what pops out at first glance anyways, but I am no macro writer.. I just tinker =)
 
#3
Rich (BB code):
Sub Main

:loop
	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack

/return

:loop
Not sure why you have loop in there twice, and not really seeing where it would loop. Most macros I have seen have a "Mainloop" and "/goto Mainloop" or something similiar. Else, what is the main loop "/return"ing to?

Your attack sub has a conditional return. If that condition is not met though, there is no command for it to leave the sub routine, and would appear to overflow into the next sub.

That is what pops out at first glance anyways, but I am no macro writer.. I just tinker =)
I put loop in there to try and make it do what it wasn't doing. - I am tinkering too and a lot of the stuff in this macro is in there to see what/if it would do.

I'll handle all flaws with the attack routine once I make it to that routine. I haven't even had the /echo go off yet so I haven't seen if the code in there will work, will stay or will even do what I want
 
#4
My reading of the code seems that you are only checking if you are in combat when you first enter riftseekers and when you are done with that subroutine.
 
#5
My reading of the code seems that you are only checking if you are in combat when you first enter riftseekers and when you are done with that subroutine.
Indeed this is my thought as well. Though I don't know how to tell it to prioritize this line of code and that's kind of what I am trying to figure out. That's why the loop is in there. I thought maybe if I looped that line of code it would give all lines of code in that loop utmost priority. It didn't though =(

I'd like the macro to essentially work like this... If you're in combat, run sub Attack - if you aren't in combat do whatever you were doing.

So, my sub routine of Attack and the line of code that initiates it will take utmost priority over everything else.

I am unsure how to achieve this goal though.
 
#6
You need to change this bit of code
Rich (BB code):
Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
	/delay 500s
	/call LeaveUpper
/return
Into something where instead of just delaying while you path around the zone you check if your in combat so something like this

Rich (BB code):
Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
:pathloop
	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
        /if (check if path is done however you want) 	/call LeaveUpper
/goto :pathloop	
/return
 
#7
You need to change this bit of code
Rich (BB code):
Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
	/delay 500s
	/call LeaveUpper
/return
Into something where instead of just delaying while you path around the zone you check if your in combat so something like this

Rich (BB code):
Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
:pathloop
	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
        /if (check if path is done however you want) 	/call LeaveUpper
/goto :pathloop	
/return
[video=youtube;EqWRaAF6_WY]https://www.youtube.com/watch?v=EqWRaAF6_WY[/video]

- - - Updated - - -

I got it to work for a little while, enough to where it entered that routine and I made another routine for it when combat ends. It kept giving me a double positive/false error so that seemed like the best way. It worked great but it super spammed my windows. They flashed and went blank each time it would get into combat like it does when you have your map open and a ton of shit is running/loaded.

Then suddenly shit just stopped working. Now I can't get it to enter into the attack rotation no matte what I do again *sigh* here's my code:

Rich (BB code):
-------------
Riftseekers' Sanctum "Pyrilen Flame" Farming Macro
----------**|

Sub Main

	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

:mainloop

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (${Me.CombatState.Equal[RESTING]}) /call EndFight

	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers
	
/goto :mainloop

/return

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Riftseekers Main Farm Subs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers

/return

Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
	/delay 500s
	/call LeaveUpper

/return

Sub GroundLevel

	/call Pet
	/delay 25s
	/echo Clearing the ground floor
	/play Ground
	/delay 300s

/return

Sub LowerRiftseekers

	/call pet
	/play LowerRiftseekers
	/delay 500s
	/echo Finished clearing Lower
	/play LeaveLower

/return


Sub LeaveLower

	/call pet
	/play LeaveLower

/return


Sub LeaveUpper

	/echo I have cleared everything there is to clear in Upper Riftseekers, it is time to leave - I am heading out.
	/delay 350s
	/play LeaveUpper
	/echo We have finished leaving Upper Riftseekers
	/delay 300s

/return


Sub WallofSlaughter

	/echo I am in Wall of Slaughter, running to Muramite Proving Grounds
	/call Transport
	/delay 20s
	/play PortintoMPG
	/delay 60s
	/click left door
	/delay 60s ${Zone.ShortName.Equal[provinggrounds]}==TRUE
/return

Sub MPG

	/echo I am in Muramite Proving Grounds now. Time to navigate this shit hole. Took like fucking 45min to do all these locations.
	/call Transport
	/play MPGtoRiftseekers
	/delay 60s
	/doortarget CT_Crystal
	/click left door
	/delay 1s
	/moveto loc ${Switch.DefaultY} ${Switch.DefaultX}
	/keypress u
	/delay 60s ${Zone.ShortName.Equal[Riftseekers]}==TRUE
/return





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Utility" Subs"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Pet

	/echo I am now buffing my pet up
	/delay 1s 
	/pet hold off
	/delay 1s 
	/pet ghold off
	/delay 1s 
	/cast 9
	/delay 7s 
	/cast 10
	/delay 7s 
	/alt act 323
	/delay 7s 
	/alt act 852
	/delay 5s

/return

Sub Transport

	/echo Getting ready to run across an unfriendly zone
	/delay 1s
	/alt act 1210
	/delay 3s
	/pet hold off
	/delay 1s
	/pet ghold off
	/delay 1s

/return	

Sub Attack

	/echo in attack rotation
	/if (${Me.CombatState.Equal[COMBAT]}) /afollow pause
	/if (${NearestSpawn[NPC los targetable].Distance}<160) /target ${NearestSpawn[NPC los targetable]}) /cast 3
	/hidecorpse all

	/if (${Me.AltAbilityReady[Force of Elements]} && !${Target.Type.Equal["corpse"]}) /alt act 8800
	/if (${Me.PctHPs}<=50 && ${Me.AltAbilityReady[${Elemental Ward}]}) /alt act 2060
	/if (${Me.Combat} && ${Me.SpellReady[${Remorseless Servant}]} && ${Target.Distance} <= 35) /cast 3

/return

Sub Cauldron

	/if (${FindItem[Cauldron of Countless Goods].Timer}) /return
	/echo Using Cauldron of Countless Goods. Hopefully I get something good!!
	/nomodkey /itemnotify "${FindItem[Cauldron of Countless Goods]}" rightmouseup
	/delay 25s
	/autoi
/return

Sub EndFight

	/if (${Me.CombatState.Equal[Cooldown]}) /squelch /afollow unpause

/return
 
Last edited:
#8
I'll take a look and mod tomorrow

But fundamentally I think you are close, just thinking about macros wrong

Create a loop in submain that is a bunch of checks and keep running that loop over and over

Think of a sub like a peon/worker/person that you give jobs (call them to do the job)

Write a sub to do basically 1 'job', if it is a string of job's you make multiple subs (aka jobs) to do things specifically and you call those till you want to go back to your main loop

Rich (BB code):
|**
The above and below line is how you can comment code
You can put a bunch of lines or crap in between |** CRAP HERE **|
**|

| You can also use just | per line like this
| line 1 comment
| line 2 comment

Sub Main

:loop
 /if (some crap is happening) /call subJOB-doCrap1
 /if (some other crap is happening) /call subJOB-doCrap2
 /if (some other other crap is happening) /call subJOB-doCrap2
 /if (all is cool then go back to loop!) /goto :loop

/end macro <--- this is basically the 'shits not cool lets stop fucking around and abandon ship!'

Generically I would structure what you are trying to do like this

Rich (BB code):
| Farming whatever zone thing.mac

sub Main
 :1-time-setup-before-loop
 /do some cool shit
 /do more cool shit

 :loop
 /if ( I am in upperZone ) /call farmUpperZone
 /if (I am in lowerZone ) /call farmLowerZone
 /if ( I am in upperZone || I am in lowerZone && everything is cool) /goto :loop
/end

sub killShit
  /if (i got aggro) /killstuff
/return

sub farmUpperZone
 /if (I have aggro) /call killShit
 /play path-upper-1
 /if (I have aggro) /call killShit
 /play path-upper-2
 /if (I have aggro) /call killShit
 /call goToLowerZone
/return

sub farmLowerZone
 /if (I have aggro) /call killShit
 /play path-Lower-1
 /if (I have aggro) /call killShit
 /play path-Lower-2
 /if (I have aggro) /call killShit
 /call goToUpperZone
/return

sub goToLowerZone
 /play path-to-lower-from-upper
 /do whatever else
/return

sub goToUpperZone
 /play path-to-upper-from-lower
 /do whatever else
/return
 
Last edited:
#9
I'll take a look and mod tomorrow

But fundamentally I think you are close, just thinking about macros wrong

Create a loop in submain that is a bunch of checks and keep running that loop over and over

Think of a sub like a peon/worker/person that you give jobs (call them to do the job)

Write a sub to do basically 1 'job', if it is a string of job's you make multiple subs (aka jobs) to do things specifically and you call those till you want to go back to your main loop

Rich (BB code):
|**
The above and below line is how you can comment code
You can put a bunch of lines or crap in between |** CRAP HERE **|
**|

| You can also use just | per line like this
| line 1 comment
| line 2 comment

Sub Main

:loop
 /if (some crap is happening) /call subJOB-doCrap1
 /if (some other crap is happening) /call subJOB-doCrap2
 /if (some other other crap is happening) /call subJOB-doCrap2
 /if (all is cool then go back to loop!) /goto :loop

/end macro <--- this is basically the 'shits not cool lets stop fucking around and abandon ship!'
That's how it will look once it is finished, sure. I think people keep assuming I am trying to put out a professional product and not learn how to write macros. Someone learning how to write macros isn't going to have the neatest code there is, especially on their second macro and before it is even finished/while they are stuck tinkering.

Right now I have the macro organized exactly how you say - just instead of it being in "main" it's in the first Riftseekers. That *should* be the main loop that the macro runs and calls all other parts of the macro to fulfill that main loop. I will reformat the whole macro.... Once it works the way I would like it to =P

Right now this is the entire macro (if it would just fucking work)

Rich (BB code):
Sub Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers

/return
But it refuses to call the attack routine UNLESS I put the attack routine IN the :pathloop. Like seen here:

Rich (BB code):
:pathloop
	/if (${Me.XTarget}==1) /afollow pause /squelch
	/if (${Me.XTarget}==1) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/if (!${AdvPath.NextWaypoint}=1140) /call LeaveUpper
/goto :pathloop

/return
Also I noticed checking the extended worked better than If I get agro /call attack. It seemed much more reliable. When it works like this though it runs into a lot of weird issues. First off, it seems like you spam /pause /unpause too much on /afollow it just turns off /afollow. I don't know if this is the actual cause but rarely did my chars finish farming even 1 floor of riftseekers before the macro breaks now. Shit, it was more reliable with moveto loc points than the advnav for now.


After last night's tinkering here is what I have:

Rich (BB code):
-------------
Riftseekers' Sanctum "Pyrilen Flame" Farming Macro
----------**|

Sub Main

	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (${Me.CombatState.Equal[RESTING]}) /call EndFight

	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers
	

/return

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Riftseekers Main Farm Subs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/call UpperRiftseekers
	/call Groundlevel
	/call LowerRiftseekers

/return

Sub UpperRiftSeekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi
	/echo Starting
	/play UpperRiftseekers
:pathloop
	/if (${Me.XTarget}==1) /afollow pause /squelch
	/if (${Me.XTarget}==1) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/if (!${AdvPath.NextWaypoint}=1140) /call LeaveUpper
/goto :pathloop

/return

Sub GroundLevel

	/call Pet
	/delay 25s
	/echo Clearing the ground floor
	/play Ground
:pathloop
	/if (${Me.XTarget}==1) /afollow pause /squelch
	/if (${Me.XTarget}==1) /call Attack
	/if (!${Me.CombatState.Equal[COMBAT]}) /call EndFight
	/if (!${AdvPath.NextWaypoint}=1140) /call LowerRiftseekers
/goto :pathloop
	/delay 300s

/return

Sub LowerRiftseekers

	/call pet
	/play LowerRiftseekers
	/delay 500s
	/echo Finished clearing Lower
	/play LeaveLower

/return


Sub LeaveLower

	/call pet
	/play LeaveLower

/return


Sub LeaveUpper

	/echo I have cleared everything there is to clear in Upper Riftseekers, it is time to leave - I am heading out.
	/delay 350s
	/play LeaveUpper
	/echo We have finished leaving Upper Riftseekers
	/delay 300s

/return


Sub WallofSlaughter

	/echo I am in Wall of Slaughter, running to Muramite Proving Grounds
	/call Transport
	/delay 20s
	/play PortintoMPG
	/delay 60s
	/click left door
	/delay 60s ${Zone.ShortName.Equal[provinggrounds]}==TRUE
/return

Sub MPG

	/echo I am in Muramite Proving Grounds now. Time to navigate this shit hole. Took like fucking 45min to do all these locations.
	/call Transport
	/play MPGtoRiftseekers
	/delay 60s
	/doortarget CT_Crystal
	/click left door
	/delay 1s
	/moveto loc ${Switch.DefaultY} ${Switch.DefaultX}
	/keypress u
	/delay 60s ${Zone.ShortName.Equal[Riftseekers]}==TRUE
/return





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Utility" Subs"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Pet

	/echo I am now buffing my pet up
	/delay 1s 
	/pet hold off
	/delay 1s 
	/pet ghold off
	/delay 1s 
	/cast 9
	/delay 7s 
	/cast 10
	/delay 7s 
	/alt act 323
	/delay 7s 
	/alt act 852
	/delay 5s

/return

Sub Transport

	/echo Getting ready to run across an unfriendly zone
	/delay 1s
	/alt act 1210
	/delay 3s
	/pet hold off
	/delay 1s
	/pet ghold off
	/delay 1s

/return	

Sub Attack

	/target npc
	/squelch /delay 1s
	/pet attack
	/cast 3

/return

Sub Cauldron

	/if (${FindItem[Cauldron of Countless Goods].Timer}) /return
	/echo Using Cauldron of Countless Goods. Hopefully I get something good!!
	/nomodkey /itemnotify "${FindItem[Cauldron of Countless Goods]}" rightmouseup
	/delay 25s
	/autoi
/return

Sub EndFight

	/if (${Me.CombatState.Equal[COOLDOWN]}) /squelch /afollow unpause
	/if (${Me.CombatState.Equal[ACTIVE]}) /squelch /afollow unpause

/return
 
#10
Can I make a small suggestion to your Attack subroutine? This should keep it in the Attack subroutine like you want until there are no longer mobs near.

Your Code:
Rich (BB code):
Sub Attack

	/echo Letting you know I called Attack Rotation (when I finally see this fucking echo im going to squeal with joy)
	/afollow pause
	/clear target
	/delay 1s
	/target npc

	/if (${Me.AltAbilityReady[Force of Elements]} && !${Target.Type.Equal["corpse"]}) /alt act 8800
	/if (${Me.PctHPs}<=50 && ${Me.AltAbilityReady[${Elemental Ward}]}) /alt act 2060
	/if (${Me.Combat} && ${Me.SpellReady[${Remorseless Servant}]} && ${Target.Distance} <= 35) /cast 3
	/hidecorpse all
	/if (${Me.CombatState.NotEqual[COMBAT]}) /afollow unpause
	/if (${Me.CombatState.NotEqual[COMBAT]}) /return

/return
Suggestion:
Rich (BB code):
/declare AggroRadius int outer 200
/declare ZAggroRadius int outer 10
Sub Attack
/echo Letting you know I called Attack Rotation (when I finally see this fucking echo im going to squeal with joy)
/afollow pause

:FindTarget
/if (${SpawnCount[npc radius ${AggroRadius} zradius ${ZAggroRadius}]} > 0) {
/squelch /target clear
/delay 5 !${Target.ID}
/target ${NearestSpawn[npc radius ${AggroRadius} zradius ${ZAggroRadius}]}
/delay 5 ${Target.ID}
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${AggroRadius} && ${Target.LineOfSight}) /goto :LockedOn
/goto :FindTarget
} else {
/hidecorpse all
/afollow unpause
/return
}

:LockedOn
/if (${Me.AltAbilityReady[Force of Elements]} && !${Target.Type.Equal["corpse"]}) /alt act 8800
/if (${Me.PctHPs}<=50 && ${Me.AltAbilityReady[${Elemental Ward}]}) /alt act 2060
/if (${Me.Combat} && ${Me.SpellReady[${Remorseless Servant}]} && ${Target.Distance} <= 35) /cast 3
/if (!${Target.Type.Equal[NPC]} || !${Target.ID}) /goto :FindTarget
/goto :LockedOn
/return
Change your Sub Main to...
Rich (BB code):
Sub Main

:MainLoop
	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/call Attack
/delay 5
/goto :MainLoop 
/return
 
#11
Can I make a small suggestion to your Attack subroutine?
With it just having "/call Attack" it doesn't seem to be calling attack when I get into combat, but that should be a change I can fix on my own.

Your overall changes to my attack subroutine helped a ton. I honestly had a feeling the issue I was facing had to do with declares or rather, declaring shit and making it more complicated would put me on the right track I should say.

http://www.macroquest2.com/wiki/index.php/Declare

http://www.macroquest2.com/wiki/index.php/MQ2DataVars

Only have minimal examples on what a declare can do and I see macros on this website with like .... 30 - 50 different declares sometimes. I really wish it had more examples of what a declare can do because they seem a lot more important than the wiki makes them out to be =P


Edit - I think mq2advnav just refuses to call forth another subroutine unless you put it in a :pathloop right after the path. Even with the attack subroutine in the main sub it refuses to call it. I am going to put it back into :pathloop and see if that works if it does.... Then is seriously the only way to call forth a subroutine while using Mq2nav to put it into a :pathloop with it? That seems a bit archaic of a design for a plugin so many people use.
 
#12
That's how it will look once it is finished, sure. I think people keep assuming I am trying to put out a professional product and not learn how to write macros. Someone learning how to write macros isn't going to have the neatest code there is, especially on their second macro and before it is even finished/while they are stuck tinkering.

Right now I have the macro organized exactly how you say - just instead of it being in "main" it's in the first Riftseekers. That *should* be the main loop that the macro runs and calls all other parts of the macro to fulfill that main loop. I will reformat the whole macro.... Once it works the way I would like it to =P

Right now this is the entire macro (if it would just fucking work)
Yea sorry, I was thinking this was about learning but I explained myself wrong.

My point about sub's and calling them for jobs is actually critical when building things because it lets you figure out what is messed up in a slice and lets you incrementally make the thing work properly.
If you do not split things up like this it usually takes longer (at least for me) because you are dealing with all the other nuances

The other thing I commonly do is t.mac !

I keep this open usually and try to figure out one little nugget of something that is not working properly in my macro by copying the absolutle minimal required from my main macro into t.mac (usually just 1 sub or maybe a chain of subs) and testing t.mac over and over until that exact thing works out well
It is very hard to try to debug a full macro but very easy to debug just a small portion not only because less code but also you can control your EQ char to keep repeating that exact thing over and over without having to wait for the rest of your main macro to work =)

Like the other day i was playing with /for loops and declares so this is what is currently in my t.mac (may give you a hint on importance of /declares!)
And wondering if I could use a for loop to increment a declare by nesting a # like 1 to 5
This is for a bigger macro I was making to try to powerlevel 1-5 characters so I needed a way to cycle thru those characters to add them to a group for example

Rich (BB code):
| t.mac , testing stuff

sub main
	/declare pcEXPCount string outer "5"
	/declare pcEXP1 string outer "bob"
	/declare pcEXP2 string outer "sue"
	/declare pcEXP3 string outer "john"
	/declare pcEXP4 string outer "phil"
	/declare pcEXP5 string outer "amy"	
	/declare i int local
	/for i 1 to ${pcEXPCount}
		/echo ${i}
		/echo ${pcEXP${i}}
	/next i
/return
So a variable and using a declare to populate the variable is used so you can refer to that thing.... it makes it abstract basically
So I was planning to use /declares for character names in my macro, that way I only need to edit 1 spot for a new character.... like bob gets to level 105 now I made a new character called Joe, I just edit the /declare pcEXP1 that is set to bob and set it to Joe, and everything is perfect.

So I have 5 characters and I want to do something to each character.... instead of making a line for each of them I wanted to use a /for loop. I have used /for loops many times but I wasnt sure how to do that against pcEXP1 pcEXP2 pcEXP3 (since those are strings+numbers!) so i did testing and found I could declare i (for integer or #) and nest that in pcEXP{#} but first couple ways I tried my syntax was wrong so I used t.mac to figure it out
 
#13
It seems to be one of those "if you know about them, they make sense... if you don't you shouldn't be messing with them" things I have run into before when asking about stuff. As in, it can be like pulling teeth getting some "usable to utter newbs" information, when I was struggling with starting out as well =)

I fully agree there ought to be a lot more examples on stuff in the wiki to help out folks. One reason I have been, from time to time, expanding on the wiki some. I will see if I can dredge up some stuff to put there, with some explanations on what is happening. If something doesn't appear soon, poke me a few times to wake up! Other folks are of course welcome to add to the wiki as well.
 
#14
With it just having "/call Attack" it doesn't seem to be calling attack when I get into combat, but that should be a change I can fix on my own.

Your overall changes to my attack subroutine helped a ton. I honestly had a feeling the issue I was facing had to do with declares or rather, declaring shit and making it more complicated would put me on the right track I should say.

http://www.macroquest2.com/wiki/index.php/Declare

http://www.macroquest2.com/wiki/index.php/MQ2DataVars

Only have minimal examples on what a declare can do and I see macros on this website with like .... 30 - 50 different declares sometimes. I really wish it had more examples of what a declare can do because they seem a lot more important than the wiki makes them out to be =P


Edit - I think mq2advnav just refuses to call forth another subroutine unless you put it in a :pathloop right after the path. Even with the attack subroutine in the main sub it refuses to call it. I am going to put it back into :pathloop and see if that works if it does.... Then is seriously the only way to call forth a subroutine while using Mq2nav to put it into a :pathloop with it? That seems a bit archaic of a design for a plugin so many people use.
Let me know if you want help. I'll take a look at the full macro. I wrote a macro to just pull mobs awhile back as I didn't need to move at all. It would be pretty trivial to change it to path.

Onto declares.. I will do my best here. Below you'll find an some code as it was the best way I could think of to explain things. Basically though.. You can declare an outer anywhere and have it referenced freely by any other subroutine. A local on the other hand will only be accessible where it was declared. You'll notice things say NULL when it happens.

Rich (BB code):
|------------------------------------------------------------|
|          DeclareExample.mac
|
|      Last Modified by: TheDroidUrLookingFor
|
|		Version:	1.0.0
|
|------------------------------------------------------------|

|------------------------------------------------------------|
|          Main Rountine
|------------------------------------------------------------|
Sub Main
/declare StringGlobal string outer This will work from any subroutine.
/declare StringLocal string local This will work only from the subroutine where it was declared.

/declare IntGlobal string outer 9001
/declare IntLocal string local 5

/declare BoolGlobal string outer TRUE
/declare BoolLocal string local TRUE

/echo Global String: ${StringGlobal}
/echo Local String: ${StringLocal}

/echo Global Power Level: ${IntGlobal}
/echo zOMG its over 9000!
/echo Local Power Level:  ${IntLocal}
/echo Perhaps we should train more

/echo The Answer is 42: ${BoolGlobal}
/echo The Answer is 42: ${BoolLocal}

/call Declares

/echo Global String: ${SubStringGlobal}
/echo Local String: ${SubStringLocal}

/echo Global Power Level: ${SubIntGlobal}
/echo Local Power Level:  ${SubIntLocal}

/echo The Answer is 42: ${SubBoolGlobal}
/echo The Answer is 42: ${SubBoolLocal}
/return
|------------------------------------------------------------|
|          End Main Rountine
|------------------------------------------------------------|
|------------------------------------------------------------|
|          Declares Rountine
|------------------------------------------------------------|
Sub Declares
/declare SubStringGlobal string outer This will work from any subroutine.
/declare SubSubStringLocal string local This will work only from the subroutine where it was declared.

/declare SubIntGlobal string outer 9001
/declare SubIntLocal string local 5

/declare SubBoolGlobal string outer TRUE
/declare SubBoolLocal string local TRUE

/echo Global String: ${StringGlobal}
/echo Local String: ${StringLocal}

/echo Global Power Level: ${IntGlobal}
/echo zOMG its over 9000!
/echo Local Power Level:  ${IntLocal}
/echo Perhaps we should train more

/echo The Answer is 42: ${BoolGlobal}
/echo The Answer is 42: ${BoolLocal}

/echo Global String: ${SubStringGlobal}
/echo Local String: ${SubStringLocal}

/echo Global Power Level: ${SubIntGlobal}
/echo Local Power Level:  ${SubIntLocal}

/echo The Answer is 42: ${SubBoolGlobal}
/echo The Answer is 42: ${SubBoolLocal}
/return
|------------------------------------------------------------|
|          Declares Rountine
|------------------------------------------------------------|
 
#15
Yea sorry, I was thinking this was about learning but I explained myself wrong.

My point about sub's and calling them for jobs is actually critical when building things because it lets you figure out what is messed up in a slice and lets you incrementally make the thing work properly.
If you do not split things up like this it usually takes longer (at least for me) because you are dealing with all the other nuances

The other thing I commonly do is t.mac !

I keep this open usually and try to figure out one little nugget of something that is not working properly in my macro by copying the absolutle minimal required from my main macro into t.mac (usually just 1 sub or maybe a chain of subs) and testing t.mac over and over until that exact thing works out well
It is very hard to try to debug a full macro but very easy to debug just a small portion not only because less code but also you can control your EQ char to keep repeating that exact thing over and over without having to wait for the rest of your main macro to work
I agree with you on the subs and I did break my macro up with a subroutine for each different activity (including leaving an area, instead of mapping an entire area then you running into an issue as you're returning to camp, each area + moving to a different area is its own subroutine for me). I do this in HTML too and organizing websites/their web pages. It is something you pick up pretty early on as a coder for that exact reason =P

When you're looking at this giant block of code, even if you wrote it - shit can be a total nightmare finding what you want and fixing it in a timely maner.

t.mac is a good idea too. Luckily I don';t have to dive very far into my macro to run into an error right now, I am still working on getting a seemless transition in and out of the attack rotation



It seems to be one of those "if you know about them, they make sense... if you don't you shouldn't be messing with them" things I have run into before when asking about stuff. As in, it can be like pulling teeth getting some "usable to utter newbs" information, when I was struggling with starting out as well =)

I fully agree there ought to be a lot more examples on stuff in the wiki to help out folks. One reason I have been, from time to time, expanding on the wiki some. I will see if I can dredge up some stuff to put there, with some explanations on what is happening. If something doesn't appear soon, poke me a few times to wake up! Other folks are of course welcome to add to the wiki as well.
Right now I think what would be of most help is if each TLO had a list of variables to go with it. Everything is explained on the wiki but only explained partially. It says Hey, this is what a TLO does but we're not going to give you a list of ALL the variables it can use. For example, here's the issue I am currently trapped with...

http://www.redguides.com/community/showthread.php/24698-MQ2AdvPath

has a list of TLO's for MQ2AdvPath. Ok, but what variables can I use with them? Ok so lets look more at TLOs:

http://www.macroquest2.com/wiki/index.php/TLO

Ok.... But.... what variables can I use with them? .....

Rich (BB code):
:pathloop
	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack
	/if (${AdvPath.State}=0) /call LeaveUpper
/goto :pathloop
	/delay 650s

Right now when I want it to leave that loop I can't figure out how to get it to leave it because it tells me what the TLO is in multiple locations but NOWHERE does it say what variables to pair with that TLO. I've tried a bunch of different things...

Rich (BB code):
	/if (${AdvPath.State}=0) /call LeaveUpper
	/if (!${AdvPath.State}=2) /call LeaveUpper
	/if (${AdvPath.State.Equal[0]}) /call LeaveUpper
	/if (!${AdvPath.State.Equal[2]}) /call LeaveUpper
       /if (${AdvPath.NextWaypoint}=1140) /call LeaveUpper
       /if (${AdvPath.NextWaypoint.Equal[1140]}) /call LeaveUpper
I have spent the last hour or so trying all different formats of the code since I can't find any examples anywhere in any macro or on google.
 
#16
I looked at the code in the original post and it confused the hell outta me. One thing I do when writing macros is too never call a subroutine from within a subroutine. It gets very confusing at least to me.

It usually helps me to write what I want to do then find the macro commands/TLO's that do what I wrote... example

main loop
/if i'm in zone name and I'm not in combat and there are no spawns around then /move somewhere else
/if i'm in different zone name and I'm not in combat and there are no spawns around then /move different somewhere else
/if there are spawns around and I'm not in killing them then /move to the nearest spawn
/if I'm under attack but not fighting then /start fighting
/if i'm fighting and I don't have a target then /stop fighting
/start the loop over again... forever

sub fight
blah, blah, blah
/return

sub stop fighting
blah, blah, blah
/return
 
#17
I looked at the code in the original post and it confused the hell outta me. One thing I do when writing macros is too never call a subroutine from within a subroutine. It gets very confusing at least to me.

It usually helps me to write what I want to do then find the macro commands/TLO's that do what I wrote... example

main loop
/if i'm in zone name and I'm not in combat and there are no spawns around then /move somewhere else
/if i'm in different zone name and I'm not in combat and there are no spawns around then /move different somewhere else
/if there are spawns around and I'm not in killing them then /move to the nearest spawn
/if I'm under attack but not fighting then /start fighting
/if i'm fighting and I don't have a target then /stop fighting
/start the loop over again... forever

sub fight
blah, blah, blah
/return

sub stop fighting
blah, blah, blah
/return

Thank you for this. As a noob, who doesn't know how to write macro code, this makes it so much easier to understand when someone breaks stuff down into laymen terms!
 
#18
Thank you for this. As a noob, who doesn't know how to write macro code, this makes it so much easier to understand when someone breaks stuff down into laymen terms!
The issue with never doing a subroutine call from within another sub though is you can only write basic macros. This macro could definitely be written this way. But it's also an extremely basic macro that was my second macro/is something I am just tinkering with for now. If I can't figure out this part I may scrap the whole darn thing.

Right now the issue im having (I switched to trying MQ2Nav) is I need to figure out the code involved in telling the program how to realize I have made it to a nav point and go to the next nav point.

Right now I just have all my navs lined up and I am trying to figure out how to tell it to check that I have reached the location. Sadly there is nothing involving location in the Me. TLO wiki. The MQ2 nav wiki isn't very long, it kinda just says what the commands are but gives no variables/data entries on them.

/navigate waypoint start
/navigate waypoint FirstIntersection
/Navigate waypoint LargeRoom
/navigate waypoint SecondRoom
/navigate waypoint ThirdRoom
/navigate waypoint FourthRoom
/navigate waypoint SixthRoom
/navigate waypoint EigthRoom
/navigate waypoint NinthRoom
/navigate waypoint TenthRoom
/navigate waypoint EleventhRoom

If I can figure out how to get it to do a check then proceed to the next waypoint I think it should work flawlessly. What a ride this was, first I start with /moveto then Advpath then Nav. I've literally tried everything at this point.
 
#19
${Math.Distance[y,x,z:y,x,z]} distance between two points, defaults to your location

Look at the wiki for TLO math

also look at kissassist sub DoWeMove, it has some nice examples
 
#20
I changed the code around a bit using TheDroidUrLookingFors help, currently I can get it to do two things... I can get it to run the path but not transition to another path even when I put in for it to look around my coords... but... the issue is the bot runs to the wrong coords entirely. As seen in the picture below.

JaOqyXx.jpg

Or it just refuses to run a path and says MQ2 nav no end reference found.

This macro has been a total fucking nightmare for me so far. I feel like I am out of my league and it shouldn't be this hard to get it to do what I am asking it to do. I don't know why it refuses to call the sub routine attack 90% of the time despite the code being solid and people have given me tons of code that should work... but it just doesn't. I can't even get the bot to run to 1 room reliably with ANY navigation other than /moveto which makes testing almost everything about the bot nearly impossible. If I can't get the nav to work, I can't test the combat. And when I finally do get the bot to run around (like I could do with ADvpath) I had to loop the combat subroutine INTO pathloop in order for it to ever be called

And when it was it kinda worked but if you get summoned at all using ADvpath it offsets the whole thing and since you're forced to use :pathloop in order to get the attack subroutine to work it makes finding a way to offset the summon difficult because that line of code would be spammed to all fuck and I (I couldnt anyway) figure out how to get the bot back on the nav path after he got summoned using ADVpath while also still calling the attack subroutine when needed.

This is what I have right now and all it does is run to the wrong location in riftseekers (to the coords show in the screenshot above) and never call the attack subroutine:

Rich (BB code):
-------------
Riftseekers' Sanctum "Pyrilen Flame" Farming Macro
----------**|

Sub Main

:MainLoop
	 /if (${Zone.ShortName.Equal[wallofslaughter]}) /call WallofSlaughter
	 /if (${Zone.ShortName.Equal[provinggrounds]}) /call MPG
	 /if (${Zone.ShortName.Equal[Riftseekers]}) /call Riftseekers

	/if (${Me.CombatState.Equal[COMBAT]}) /call Attack

/delay 5
/goto :MainLoop 
/return

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declares
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


	/declare AggroRadius int outer 200
	/declare ZAggroRadius int outer 10

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Riftseekers Main Farm Subs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sub Riftseekers

	/echo I am in RiftSeekers Sanctum, I am going to clear Upper Riftseekers first
	/call cauldron
	/call pet
	/autoi

	/call RollOut "633" "-773" "2"
	/call CheckMobs



/return


Sub WallofSlaughter


	/echo I am in Wall of Slaughter, running to Muramite Proving Grounds
	/call Transport
	/delay 20s
	/play PortintoMPG
	/delay 60s
	/click left door
	/delay 60s ${Zone.ShortName.Equal[provinggrounds]}==TRUE
/return


Sub MPG


	/echo I am in Muramite Proving Grounds now. Time to navigate this shit hole. Took like fucking 45min to do all these locations.
	/call Transport
	/play MPGtoRiftseekers
	/delay 60s
	/doortarget CT_Crystal
	/click left door
	/delay 1s
	/moveto loc ${Switch.DefaultY} ${Switch.DefaultX}
	/keypress u
	/delay 60s ${Zone.ShortName.Equal[Riftseekers]}==TRUE
/return





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Utility" Subs"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Sub Pet


	/echo I am now buffing my pet up
	/delay 1s 
	/pet hold off
	/delay 1s 
	/pet ghold off
	/delay 1s 
	/cast 9
	/delay 7s 
	/cast 10
	/delay 7s 
	/alt act 323
	/delay 7s 
	/alt act 852
	/delay 5s

/return


Sub Transport


	/echo Getting ready to run across an unfriendly zone
	/delay 1s
	/alt act 1210
	/delay 3s
	/pet hold off
	/delay 1s
	/pet ghold off
	/delay 1s

/return	


Sub Attack


/doevents
/echo Entering Attack Rotation

:FindTarget
/if (${SpawnCount[npc radius ${AggroRadius} zradius ${ZAggroRadius}]} > 0) {
/squelch /target clear
/delay 5 !${Target.ID}
/target ${NearestSpawn[npc radius ${AggroRadius} zradius ${ZAggroRadius}]}
/delay 5 ${Target.ID}
/if (${Target.Type.Equal[NPC]} && ${Target.Distance}<${AggroRadius} && ${Target.LineOfSight}) /goto :LockedOn
/goto :FindTarget

} else {
/hidecorpse all
/return
}

:LockedOn
/if (${Me.AltAbilityReady[Force of Elements]} && !${Target.Type.Equal["corpse"]}) /alt act 8800
/if (${Me.PctHPs}<=50 && ${Me.AltAbilityReady[${Elemental Ward}]}) /alt act 2060
/if (${Me.Combat} && ${Me.SpellReady[${Remorseless Servant}]} && ${Target.Distance} <= 35) /cast 3
/if (!${Target.Type.Equal[NPC]} || !${Target.ID}) /goto :FindTarget
/goto :LockedOn

/return


Sub Cauldron


	/if (${FindItem[Cauldron of Countless Goods].Timer}) /return
	/echo Using Cauldron of Countless Goods. Hopefully I get something good!!
	/nomodkey /itemnotify "${FindItem[Cauldron of Countless Goods]}" rightmouseup
	/delay 25s
	/autoi
/return

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Sub CheckMobs

:MobCheck
/if (${SpawnCount[npc los loc ${Me.X} ${Me.Y} radius ${AggroRadius} zradius ${ZAggroRadius} targetable noalert 1]}>0) {
/call Attack
/goto :MobCheck
}

/return


Sub RollOut(int X, int Y, int Z)

	/if (!${Bool[${Plugin[MQ2Nav]}]}) /plugin mq2nav load
	/echo Starting Movement

	:LetsRoll
	/if (${Navigation.MeshLoaded} && !${Navigation.Active}) /nav ${X} ${Y} ${Z}
	/call CheckAggro
	/if (${Macro.Return}) /return
	/if (${Math.Distance[${X},${Y}:${Me.X},${Me.Y}]}>5) /goto :LetsRoll

/return

Sub CheckAggro

/declare i int local 1
/for i 1 to ${Me.XTarget}
	/if (${Me.XTarget[${i}].ID}!=0) /return TRUE
/next i
/return FALSE
 
Top