Macro Help
Macro Help
I am trying to create a macro that will cast a spell and turn off all forms of attack. Scatter Shot stuns the target and any damage done to it will break the stun. So far I have:
/cast Scatter Shot - casts the spell
/script PetWait() - keeps my pet near the mob for when the spell breaks
/script PetPassiveMode() - turns my pet attack off
/script if IsCurrentAction(3,1) then CastSpellByName("Auto Shot"); end;
- I have it check another action bar that I don't use to see if auto shoot is turned on then turn it off.
For whatever reason, I can not figure out how to get it to check if auto attack (3,4 - if you need to know) is on and turn it off if it is. All I can get it to do is toggle between on or off.
Could anyone help me out a bit? Thank you.
/cast Scatter Shot - casts the spell
/script PetWait() - keeps my pet near the mob for when the spell breaks
/script PetPassiveMode() - turns my pet attack off
/script if IsCurrentAction(3,1) then CastSpellByName("Auto Shot"); end;
- I have it check another action bar that I don't use to see if auto shoot is turned on then turn it off.
For whatever reason, I can not figure out how to get it to check if auto attack (3,4 - if you need to know) is on and turn it off if it is. All I can get it to do is toggle between on or off.
Could anyone help me out a bit? Thank you.
-
- Super Poster!
- Posts: 8509
- Joined: July 3, 2002, 1:06 pm
- XBL Gamertag: SillyEskimo
- XunilTlatoani
- Star Farmer
- Posts: 379
- Joined: September 6, 2002, 2:37 pm
- Location: Lakemoor, IL
I don't know if there is a single built-in function that will tell you if you are in some form of auto-combat (melee, ranged, etc.). My guess is that you would need to write a lua event-handler (sans the UI component, unless you want to display the value) that maintains a global variable of your combat state that can be referenced from the macro. For example, there is a PLAYER_ENTER_COMBAT and PLAYER_LEAVE_COMBAT event pair, but I think that will only tell you when you start/stop melee auto-attack, not ranged.
Anyway, something similar has probably already been done, so your next best bet is to find a similar add-on/macro and yank their code
Anyway, something similar has probably already been done, so your next best bet is to find a similar add-on/macro and yank their code

Xunil Tlatoani - Gnome Arch Lich (Retired)
Keepers of the Elements
Tlatoani - Gnome Warlock
Light of Dawn (Lightbringer Server)
Keepers of the Elements
Tlatoani - Gnome Warlock
Light of Dawn (Lightbringer Server)
- masteen
- Super Poster!
- Posts: 8197
- Joined: July 3, 2002, 12:40 pm
- Gender: Mangina
- Location: Florida
- Contact:
10 print "UR A NOOB!!!1!!!"
20 goto 10
20 goto 10
"There is at least as much need to curb the cruel greed and arrogance of part of the world of capital, to curb the cruel greed and violence of part of the world of labor, as to check a cruel and unhealthy militarism in international relationships." -Theodore Roosevelt
- miir
- Super Poster!
- Posts: 11501
- Joined: July 3, 2002, 3:06 pm
- XBL Gamertag: miir1
- Location: Toronto
- Contact:
Hehe...cid wrote:Tumble macro for teh win!!
When I gave it another go late last year, it was nearly impossible to find any non-bot entertainers. I played mostly entertainer in beta and early on so it was a bit depressing to a social profession like entertainer replaced by bots.

Haven't kept up with what's going on in SWG lately but I'd be curious to find out of they put the kibosh on recursive macros yet.
I've got 99 problems and I'm not dealing with any of them - Lay-Z
- XunilTlatoani
- Star Farmer
- Posts: 379
- Joined: September 6, 2002, 2:37 pm
- Location: Lakemoor, IL
I was kinda right...just didn't know they already had a lua event handler for it 
Seems like auto-shoot is a whole different animal though, so you'll have to stick with your previous method of checking if it is active it seems.

Code: Select all
if ( event == "PLAYER_ENTER_COMBAT" ) then
this.inCombat = 1;
PlayerFrame_UpdateStatus();
return;
end
if ( event == "PLAYER_LEAVE_COMBAT" ) then
this.inCombat = nil;
PlayerFrame_UpdateStatus();
return;
end
Xunil Tlatoani - Gnome Arch Lich (Retired)
Keepers of the Elements
Tlatoani - Gnome Warlock
Light of Dawn (Lightbringer Server)
Keepers of the Elements
Tlatoani - Gnome Warlock
Light of Dawn (Lightbringer Server)