Need help with a macro please

Post Reply
Jimmyjimjames
Posts: 11

Need help with a macro please

Post by Jimmyjimjames » Sat Apr 22, 2023 7:36 pm

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?

Ravenstone
Posts: 308
Has liked: 1 time
Likes: 2 times

Re: Need help with a macro please

Post by Ravenstone » Sat Apr 22, 2023 8:52 pm

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")

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sat Apr 22, 2023 8:59 pm

/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

Ravenstone
Posts: 308
Has liked: 1 time
Likes: 2 times

Re: Need help with a macro please

Post by Ravenstone » Sat Apr 22, 2023 9:29 pm

Try

Code: Select all

/script if UnitExists("target") cast Serpent Sting(Rank 1) else run TargetNearestEnemy()
Shouldn't need any addons.

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sat Apr 22, 2023 9:39 pm

its giving me an error, that sounds like what I would want tho

Ravenstone
Posts: 308
Has liked: 1 time
Likes: 2 times

Re: Need help with a macro please

Post by Ravenstone » Sat Apr 22, 2023 9:50 pm

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?

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sat Apr 22, 2023 10:11 pm

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

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sun Apr 23, 2023 7:57 am

bump?

Ravenstone
Posts: 308
Has liked: 1 time
Likes: 2 times

Re: Need help with a macro please

Post by Ravenstone » Sun Apr 23, 2023 8:37 am

Try this:

Code: Select all

/script if not UnitExists("target") then TargetNearestEnemy() end
/cast Serpent Sting(Rank 1)

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sun Apr 23, 2023 9:09 am

it seems to working the way i wanted, thank you for taking the time to help me. means a lot

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Sun Apr 23, 2023 9:52 am

is there a way after my target dies to allow the macro to go to another target if the current one is dead?

Ravenstone
Posts: 308
Has liked: 1 time
Likes: 2 times

Re: Need help with a macro please

Post by Ravenstone » Sun Apr 23, 2023 10:28 am

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)

Jimmyjimjames
Posts: 11

Re: Need help with a macro please

Post by Jimmyjimjames » Mon Apr 24, 2023 4:46 am

It works perfectly, thank you. I found the command to add a pet attack with it, I think its good to go :)

Post Reply