Elitist Jerks

Elitist Jerks (http://elitistjerks.com/forums.php)
-   Public Discussion (http://elitistjerks.com/f15/)
-   -   Macro for automatic autoattack (http://elitistjerks.com/f15/t7446-macro_automatic_autoattack/)

sp00n 07/26/06 8:26 AM

I'm looking for a way to well, automate the autoattack. ;)
Let me explain it. This was basicly during the Nefarian phase 1 learning time. There are (were) so many targets and you have to switch these targets so fast, that more than often you use tab to select the next target.
Then, if you have selected a new target, your melee attack won't start automatically. You either have to rightclick the target, use an ability, use a macro with /cast Attack or /script AttackTarget();.

In the heat of the fight I often don't have the time to rightclick a target, neither do I want to assign a button just to start autoattack, and most times I do not have enough energy/rage to use an ability which would trigger autoattack, so therefore the only solution I saw was using a macro.
Yet the problem is that /cast Attack as well as /script AttackTarget(); is a *toggle*, meaning if you use it twice, it will *stop* autoattacking again.
Therefore a macro with these commands isn't viable, since hammering the backstab button will lose a signifcant amount of white damage due to the attack just stops.

I then came across the IsAttacking addon.
It checks if you are already attacking a target and offers some script commands to start/stop attacking.

The macro I now use is
/script if (UnitMana("player")>59) then CastSpellByName("Backstab(Rank 9)") end; if (not IsAttacking()) then AttackOn(); end;

Basically it checks if I have enough energy to cast backstab, and if not, it checks if I am already actually attacking that target and if not, it triggers autoattack.
I works most of the times, but there are some times when just won't. It will execute the ability, but then it will simply stop autoattacking the target.
I suspect this behaviour is due to lag spikes and that the client doesn't recognize in time that I am attacking the target. Yet I am unsure on how to solve this issue.

What I would like to now, is anyone of you using a similar type of macro to automate the autoattack, and if yes, how does it look like?
Or how could I rewrite the macro so that such erroneous behaviour doesn't occur?

Falcon24 07/26/06 8:32 AM

Why not just use 't'? I'm pretty sure it is by default assigned to toggle auto-attack.

It's not automated but it's easier than waiting for a special/right clicking, and it's within easy reach of wasd.

Lactose 07/26/06 8:32 AM

I think you could place Auto Attack on a bar you're not showing, say page 4, slot 5 (each page has 12 slots, so slot 5 on page 4 would be slot 41), then do something similar to...

/script if (not IsActive(41)) then CastSpellByName("Auto Attack"); end

Can't remember the syntax, so might not work if you copy it directly :P

Lactose 07/26/06 8:33 AM

Because clicking T toggles Auto Attack off if it's active, making it non-spammable if what you want to do is start Auto Attack the moment something spawns.

Brissa 07/26/06 8:35 AM

Im using a floater in DAB where i have put my attack command, I assign the floater whatever ID (for example 10) i want and hide it.
I then make my MS macro like this:
/script if (IsCurrentAction(10) == nill) then AttackTarget(); end
/cast Mortal Strike(Rank 4)

This will check if button ID 10 is performing its function (attacking) and start autoattacking if it isnt.

sp00n 07/26/06 8:45 AM

/script if (IsCurrentAction(10) == nill) then AttackTarget(); end

I just tried this macro, yet it also toggles the autoattack. If autoattack is on, it will switch it off again if I use the same macro again.


***edit
Forget about this, first have to find the actual ID of this button. ;)

dreadnor 07/26/06 8:49 AM

Although I dont understand why, the following line does the job perfectly and you don't need to have auto attck on any of your bars.
/script if (not isCurrentAction(1)) then AttackTarget();end

sp00n 07/26/06 8:54 AM

Ok,
/script if (IsCurrentAction(13) == nil) then AttackTarget(); end
seems to work for me. Have to test it under raid conditions though.

Note that you have a typing error there, shouldn't it be nil instead of nill?


Quote:

Although I dont understand why, the following line does the job perfectly and you don't need to have auto attck on any of your bars.
/script if (not isCurrentAction(1)) then AttackTarget();end
Doesn't work for me, it delivers
Error: [string "if (not isCurrentAction(1)) then AttackTarg..."]:1: attempt to call global `isCurrentAction' (a nil value)

Do you have autoattack bind to your 1st key? :)

Malan 07/26/06 9:19 AM

There's a mod called DefendYourself that will automatically engage AutoAttack whenever you have been attacked. You can just bind a macro to the on/off function to disengage it when you dont want that on. Its an intelligent mod and will ignore crowd controlled targets, neutral targets, can be set to ignore opposite faction, etc.

http://ui.worldofwar.net/ui.php?id=2388

Deathwing 07/26/06 9:26 AM

I've heard that DefendYourself can be a resource hog. And in times the OP specifically mentioned, like phase 1 nef, the only way to get the mob to attack you is to attack it...otherwise it's bee-lining for healers.

I use almost the same thing Brissa does. But instead of putting it on my MS/BT ability, I just use that first line and then assign the floater to my middle mouse button. I'm not 100% sure, but I think there' an added bonus that if you don't have a target and use this macro, it will select the closest enemy as well. Great for things like suppression room, where your FPS is so low you can't click target anyway.

sp00n 07/26/06 9:28 AM

Actually I used DefendYourself, about a year ago is that if I remember correctly.
Yet it will only start autoattack if you are attacked yourself, doesn't it?

Anyway, I will keep it in mind (does it still rotate yourself to face the enemy, or was that prohibited by Blizzard? ;)), incase the solution posted here doesn't work out for me.

kharen 07/26/06 11:12 AM

if you use DUF, it has a flag that tracks whether autoattack is on:
/script if not DL_ATTACKING then AttackTarget() end

An equivalent if you use the regular unit frames is:
/script if not PlayerFrame.inCombat then AttackTarget() end

Kalman 07/26/06 12:50 PM

Quote:

Originally Posted by kharen
An equivalent if you use the regular unit frames is:
/script if not PlayerFrame.inCombat then AttackTarget() end

Fails to work on multi-target fights and boss fights where the player is always in combat.

The attack icon placed on an action slot,

if (not isCurrentAction(xx)) then UseAction(xx) technique is the best one I know of.

roq 07/26/06 1:23 PM

Quote:

Originally Posted by Kalman
Quote:

Originally Posted by kharen
An equivalent if you use the regular unit frames is:
/script if not PlayerFrame.inCombat then AttackTarget() end

Fails to work on multi-target fights and boss fights where the player is always in combat.

The attack icon placed on an action slot,

if (not isCurrentAction(xx)) then UseAction(xx) technique is the best one I know of.

Yes this one works just fine. Kalman gave it to me a few weeks ago... and i have had no problems since.

Malan 07/26/06 1:26 PM

Quote:

Originally Posted by sp00n
Actually I used DefendYourself, about a year ago is that if I remember correctly.
Yet it will only start autoattack if you are attacked yourself, doesn't it?

Anyway, I will keep it in mind (does it still rotate yourself to face the enemy, or was that prohibited by Blizzard? ;)), incase the solution posted here doesn't work out for me.

No it won't rotate you anymore, mods have no access to keybind calls for movement. And yah, it only starts attacking if you're being attacked yourself. Combine that with one of these scripts however to start attacking if not already doing so and you've got all your bases covered. Of course you'll still want to have access to the attack toggle so that you can stop auto attack manually.


All times are GMT -4. The time now is 9:45 AM.

Forum Infrastructure by vBulletin 3.6.12 ©2000-2007, Jelsoft Enterprises Ltd.