Log in

View Full Version : Can this be done - calling a script to set target.



shaeman
08-14-2008, 05:26 AM
I'm working on my failover script, which pretty much consists of having to add

/target [target=fyer, nodead]; [target=urtth, nodead]; [target=wyind, nodead]; [target=ashtara, nodead];

In to every macro prior to what I want it to do.

It occured to me that if the group composition changes I have to hand edit all those macros across the various characters, which is not good.

I then thought I could just create a macro with that line in it and call it targetlogic and then call that from each macro . However wow macros don't allow the calling of other macros.

It does however allow you to call a script - for example /script CastSpellByName("spellname") or something like that.

I've done a quick search but cant find anything that seems relevant.

Is there a way to implement the targeting logic above in lua script form callable from macro.

The advantage would be being able to only have to edit 1 script on each of the wows.

Ken
08-14-2008, 05:40 AM
Or you could just set a focus and make all your macros assist this focus?
http://www.dual-boxing.com/wiki/index.php/Macro:Ken%27s_complete_Shaman_macro_set#Set_focus

/assist [target=focus, exists]
/cast (spell)
This will assist your focus and will then cast. When you don't have a focus set, the character will act like it is played solo.
You could make the same macro differently:


/cast [target=focustarget,harm,exists][exists,harm] (spell)
This will fire at the focustarget(if it exists and is harmful) and otherwise will cast at your current target(if it exists and is harmful)

Steph
08-14-2008, 05:40 AM
There are examples for this in the Wiki.

shaeman
08-14-2008, 06:05 AM
I was aware of the focus way of doing things but I initially wanted to avoid the use of focus to achieve this, a hold over from my singleboxing days I guess, where I would set a focus that I could then fear, banish, seduce etc without an issue.

For my shaman team I don't see a great deal of need for this (although I was thinking of having some thing for PVE/PVP where you could set a focus on a caster to earthshock whilst dpsing another target).

I guess the pro's to the focus outweigh the cons, so I may move to a focus macro setup.

thanks.

puppychow
08-14-2008, 12:20 PM
I don't use focus macros, like to keep my focus free for other stuff. I am using Bartender, and I have a single button on my bars set as my "who to target" button. In each of my spell cast macros, I have the line:

/click BT4Button45Secure
/cast [target=targettarget,harm][] spellname

The macro I have at button 45 is:

/target [target=person1,nodead,help];[target=person2,nodead,help];... etc to person5

My follow macro just consists of

/click BT4Button45Secure
/follow



You can also do this with Trinity Bars and probably other bar mods. It works out great, you put the target button in your alts personal macros and thats the only place you have to change for new alts (I just log in all of em, set it up on one, and then cut & paste it across all screens into new macros).

Sorry, I have no idea how to do it with other bar mods or default Blizzard UI, and even in Bartender finding the button numbers is a pain (I set keybindings to the first button of every bar, then looked in my WTF/bindings-cache.wtf file which tells you the name/keybinding).

Good luck!

Rotten Deadite
08-14-2008, 02:39 PM
I don't suppose there's a way to address the Party Icons (Skull, Cross, Star, etc.) in Macros, is there? You could macro up quite a complex party if you could.

BobGnarly
08-14-2008, 03:54 PM
To answer your original question, no. Blizzard specifically disallows targeting in lua scripts, sadly.