Need help with a macro please
-
- Posts: 11
Need help with a macro please
I am trying to make a macro that will target the nearest enemy and then use X ability, I am able to do this but I run into the problem of the target nearest enemy part continuing to cycle thru enemies, does anyone know a way to make it so I am able to target nearest enemy(or anything similar) and continue to use the ability in the macro without changing targets to something else until my target dies?
-
- Posts: 308
- Has liked: 1 time
- Likes: 2 times
Re: Need help with a macro please
What have you got? You could try this at the beginning and else the rest of your current macro.
Code: Select all
/script if UnitExists("target")
-
- Posts: 11
Re: Need help with a macro please
/run TargetNearestEnemy()
/cast Serpent Sting(Rank 1)
That's what the macro is. I tried adding the script but it gave me an error, I'm not using any macro addons if I needed one for that to work
/cast Serpent Sting(Rank 1)
That's what the macro is. I tried adding the script but it gave me an error, I'm not using any macro addons if I needed one for that to work
-
- Posts: 308
- Has liked: 1 time
- Likes: 2 times
Re: Need help with a macro please
Try
Shouldn't need any addons.
Code: Select all
/script if UnitExists("target") cast Serpent Sting(Rank 1) else run TargetNearestEnemy()
-
- Posts: 308
- Has liked: 1 time
- Likes: 2 times
Re: Need help with a macro please
I can't log in to check, but thinking about it, is this not default behaviour anyway? Casting Serpant Sting should automatically cast at the nearest one no?
-
- Posts: 11
Re: Need help with a macro please
I was thinking that too, it seems to only work with some abilities, it works for my raptor strike but when I try to do it with sting even next to a target it wont do it
-
- Posts: 308
- Has liked: 1 time
- Likes: 2 times
Re: Need help with a macro please
Try this:
Code: Select all
/script if not UnitExists("target") then TargetNearestEnemy() end
/cast Serpent Sting(Rank 1)
-
- Posts: 11
Re: Need help with a macro please
it seems to working the way i wanted, thank you for taking the time to help me. means a lot
-
- Posts: 11
Re: Need help with a macro please
is there a way after my target dies to allow the macro to go to another target if the current one is dead?
-
- Posts: 308
- Has liked: 1 time
- Likes: 2 times
Re: Need help with a macro please
Code: Select all
/script if UnitHealth("target")==0 and UnitExists("target") then ClearTarget() end
/script if not UnitExists("target") then TargetNearestEnemy() end
/cast Serpent Sting(Rank 1)
-
- Posts: 11
Re: Need help with a macro please
It works perfectly, thank you. I found the command to add a pet attack with it, I think its good to go :)