Need help with a macro you are writing? Ask here!
Moderator: MacroQuest Developers
-
Dark_Lord_X
- orc pawn

- Posts: 16
- Joined: Fri Oct 01, 2004 5:42 pm
Post
by Dark_Lord_X » Sat Oct 02, 2004 2:36 am
Anyone else notice that sometimes a static spawn will have a slightly different loc when respawned and therefor targetting by loc wont work?
Ex: First Spawn is 301.88 570.41
Ex: Next Spawn is 302.04 570.30
So if you have it set to target 301, 570 it wont work the next spawn. I was thinking I could make it accurate to +-1 of the set number but I have no idea how to do that. =/
-
Dark_Lord_X
- orc pawn

- Posts: 16
- Joined: Fri Oct 01, 2004 5:42 pm
Post
by Dark_Lord_X » Sat Oct 02, 2004 2:53 am
Code: Select all
/for t 1 to 9
/if (${Spawn[loc ${Spawn${t}X} ${Spawn${t}Y} npc radius 5]}) {
/target ${Spawn[loc ${Spawn${t}X} ${Spawn${t}Y} npc radius 5]}
/varset MobID ${Target.ID}
/echo Target Aquired: > ${Target.CleanName} ${Target.ID} <
/return
}
/next t
so that would give me the spawn within 5 units of that loc? sorry im writing a macro but unable to test for a couple days.
-
dman
- a hill giant

- Posts: 181
- Joined: Fri Dec 05, 2003 12:54 pm
Post
by dman » Sat Oct 02, 2004 8:22 am
For your t 1 to 9, not a clue what you are trying to doing there, but you are on the right track.
Code: Select all
/if (${Spawn[loc X Y radius 5].ID}) {
/varset MobID ${Spawn[loc X Y radius 5].ID}
/target id ${MobID}
/echo Target Aquired: > ${Target.CleanName} ${Target.ID}
}
-
botia
- decaying skeleton

- Posts: 8
- Joined: Fri Sep 03, 2004 7:47 pm
Post
by botia » Sat Oct 02, 2004 1:11 pm
Looks as if he is checking a pre-built list of mob locations. The naming convention is different thant what I would use since it resembles a reference type.
This could get messy unless the spawn cycle was already broken (and stays broken). Otherwise you would target the last spawned mob in the list with no checking of your own proximity. Perhaps you have set your list up so that ${Spawn9X} ${Spawn9Y} is the mob closest to you and keep moving farther out down to ${Spawn1X}. Otherwise this could lead to a cycle that would end up with the final target that is farther away than you want and may end up training you if the other spawns are within aggro radius on the way back.
Am I correct in my assumptions here, or am I misunderstanding what you are trying to do with the code Dark_Lord_X?
-
Dark_Lord_X
- orc pawn

- Posts: 16
- Joined: Fri Oct 01, 2004 5:42 pm
Post
by Dark_Lord_X » Sat Oct 02, 2004 3:21 pm
The 1 to 9 is order of the pulls. I thought this would check them in order and if one is found return to the main loop to be pulled. This would also check for and target any respawn if the 9 mobs arent all dead which is fine as they dont add and are all approximately the same distance away from my HomeY,HomeX. If there is a better way to do this please share. =D
Code: Select all
/declare Spawn1Y int outer y
/declare Spawn1X int outer x
/declare Spawn2Y int outer y
/declare Spawn2X int outer x
/declare Spawn3Y int outer y
/declare Spawn3X int outer x
/declare Spawn4Y int outer y
/declare Spawn4X int outer x
/declare Spawn5Y int outer y
/declare Spawn5X int outer x
/declare Spawn6Y int outer y
/declare Spawn6X int outer x
/declare Spawn7Y int outer y
/declare Spawn7X int outer x
/declare Spawn8Y int outer y
/declare Spawn8X int outer x
/declare Spawn9Y int outer y
/declare Spawn9X int outer x
Sub AquireTarget
/declare t int local
:TargetLoop
/if (${Target.ID}) /return
/for t 1 to 9
/if (${Spawn[loc ${Spawn${t}X} ${Spawn${t}Y} npc radius 5].ID}) {
/varset MobID ${Spawn[loc ${Spawn${t}X} ${Spawn${t}Y} npc radius 5].ID}
/target id ${MobID}
/echo Target Aquired: > ${Target.CleanName} ${Target.ID} <
/return
}
/next t
/if (!${Target.ID}) {
/if (${Me.Buff["${BuffName}"].ID}) {
/notify BuffWindow Buff${Int[${Math.Calc[${Me.Buff["${BuffName}"].ID}-1]}]} leftmouseup
}
/delay 1s
/goto :TargetLoop
/return
Is basically what Im using for targetting code with a few tweaks to be made yet.
Edit: oh and yea i was gonna get around to renaming the variable i used to something else.