Reply
 
Thread Tools Display Modes
Old 05-27-11, 08:47 PM   #1
jurundo
Banned
Join Date: May 2011
Posts: 9
Ask of help so as to create complex targeting macros

Hi,

Should you know I tried everything I could to this myself, unfortunately, I guess I don't know enough to succeed it.

I tried many scripts made by me or found on some forums which didn't work on 3.3.5 and that I didn't test on 4.0.0 +

I figured 3 extremly helpful targeting macros, made them half working since 2.4.3, and now aim to make them fully work with your help.

Here they are.

Should we firstly assume these as variables, if I can say so...

FOCUS = fact of focusing; TARGET = fact of targeting; focus = focused unit; target = targeted unit; player = unit nature;

lasttarget = previous target;

Macro 1: focus current target then change target

Action 1:

if "target" exists and "target" is hostile and "target" is player then FOCUS (target)

if "target" = "focus" then FOCUS ("lasttarget) or [if unit = "currenttarget" then "DO NOT TARGET")

-- so to avoid my focus to go on the current target when spamming the macro while no other unit is in the targeting range

Action 2:

if unit is hostile and unit is player then TARGET (unit)


Macro 2: focus current target then target lasttarget

Action 1:

if "target" exists and "target" is hostile and "target" is player then FOCUS (target)

if "target" = "focus" then FOCUS ("lasttarget") or [if unit = "currenttarget" then "DO NOT TARGET")

-- so to avoid my focus to go on the current target when spamming the macro while no other unit is in the targeting range

Action 2:

TARGET ("lasttarget")

Macro 3: target only Non Player Units

if unit is not player and is hostile then TARGET (unit)

What I managed to do:

macro 1: incomplete
/focus [harm, exists]
/targetenemyplayer

macro 2: incomplete
/focus [harm, exists]
/targetlasttarget

macro 3: not working on 3.3.5 but not tested on 4.0.0 +
/target pet, totem

Thank you for whoever takes the time to read this and eventually helps or tries me or tries to.
jurundo is offline   Reply With Quote
Old 05-28-11, 02:36 PM   #2
Jynks
A Flamescale Wyrmkin
Join Date: Oct 2006
Posts: 133
might be easyer for peopel to help if in stead yo udescribed what your macro is meant to do... rather than all that broken code and short hand...

Just describe what you want the macros to do
Jynks is offline   Reply With Quote
Old 05-28-11, 04:11 PM   #3
jurundo
Banned
Join Date: May 2011
Posts: 9
Hi,
In my view, if you can't take the time to read it all and/or don't understand what I mean, you won't be able to help me (no offense, just saying).

Anyway, if you insist, here is what I "clearly" want:

Macro 1: focus only PLAYER targets which exist and are hostile, then target new unit which is PLAYER and hostile.
+ do not focus if target doesn't change

Macro 2: same as one except it targets lasttarget
Macro 3: targets only NON PLAYER units

Still, I think my post was very clear, if only you took the time to read it.
jurundo is offline   Reply With Quote
Old 05-28-11, 06:12 PM   #4
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,703
Originally Posted by jurundo View Post
Macro 1: focus only PLAYER targets which exist and are hostile, then target new unit which is PLAYER and hostile.
...
Macro 3: targets only NON PLAYER units
1. Not possible. Macros cannot check whether a unit is a player or an NPC.

2. Everyone who posts here is a volunteer. Not everyone who posts here speaks English as a first language. If someone takes the time to ask you to clarify what you want, that means that they want to help you. Most likely, they already have "taken the time" to read your whole post (which is fairly painful, by the way) but don't understand all of it. Rather than being a condescending ass, why don't you just try to phrase your request in another way so that this person who wants to help you can help you?
Phanx is offline   Reply With Quote
Old 05-28-11, 07:53 PM   #5
jurundo
Banned
Join Date: May 2011
Posts: 9
Checking if a unit is player or npc isn't the only way to make this work.
We may make it someway like /targetenemyplayer with a script.
I know someone made this work on 2.4.3 so one sure thing is this is possible.
Also, should you know I didn't mean to hurt anyone by me previous post, so if I did hurt you Jynks, I'm sorry.
jurundo is offline   Reply With Quote
Old 05-28-11, 07:59 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,479
In addition to what Phanx said, macros cannot compare two targets to see if your current target is the same unit as your focus.

Originally Posted by jurundo View Post
Checking if a unit is player or npc isn't the only way to make this work.
We may make it someway like /targetenemyplayer with a script.
I know someone made this work on 2.4.3 so one sure thing is this is possible.
Also, should you know I didn't mean to hurt anyone by me previous post, so if I did hurt you Jynks, I'm sorry.
What do you mean "with a script"? Targeting is a protected action and addons have not been able to do this since the 2.0 patch. And perhaps what you're thinking of from 2.4.3 either is a) not exactly what you're wanting to do above, or b) something that was fixed in the 3 years since.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Old 05-31-11, 08:57 AM   #7
jurundo
Banned
Join Date: May 2011
Posts: 9
Hi,

You almost made me lose faith. Hopefully, I have found a way to make this FULLY work (that's actually what I meant by scripts, the wow API). However, I would need someone who's good at manipulating LUA to explain how some functions work TOGETHER.

If anyone is interested at doing this, please email me at izemmouri@hotmail.fr

Of course, if this ever works, I will let you know; also, if you are interested in this macro/addon, email me and I will send it to you once it's been released.

Anyway, thank you for trying to help me.
jurundo is offline   Reply With Quote
Old 05-31-11, 09:17 AM   #8
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 541
Uhmm these responses are from the most knowledgeable Lua addon authors you will ever find ...

if they say you can't do something particular, then you probably can't
Ketho is offline   Reply With Quote
Old 05-31-11, 10:17 AM   #9
jurundo
Banned
Join Date: May 2011
Posts: 9
I don't pretend I am good at that, but here is what I found.
TargetLastEnemy() - Selects the last targetted enemy as the current target.
TargetLastTarget() - Selects the last target as the current target.
TargetNearestEnemy([reverseFlag]) - Selects the nearest enemy as the current target.
TargetNearestEnemyPlayer([reverseFlag]) - Selects the nearest enemy player as the current target.
TargetUnit("unit") - Selects the specified unit as the current target.
UnitExists("unit") - Returns 1 if the specified unit exists, nil otherwise. UnitIsEnemy("unit", "otherUnit") - Returns true if the specified units are enemies, false otherwise.
UnitIsFriend("unit", "otherUnit") - Returns true if the specified units are friends (PC of same faction or friendly NPC), false otherwise.
UnitIsUnit("unit", "otherUnit") - Determine if two units are the same unit.
UnitPlayerControlled("unit") - Returns true if the specified unit is controlled by a player, false otherwise.

If we use these together we can make my macros work.

All I wonder now is if there is something which focus instead of targeting; even if it happens to not be the case, I am sure we can use the /focus command in some other way instead.

Yes, since I am editing, please find below what the macro could look like (note that there must be some huge scripting mistakes since I don't know much about that; all I want is to give an idea of what I am conceiving).

/script target = t, focus = f, if UnitPlayerControlled(t) and UnitExists(t) and UnitIsUnit(t, f) = false then runmacro "/focus" end
/targetenemyplayer

Last edited by jurundo : 05-31-11 at 10:43 AM.
jurundo is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » Macro Help » Ask of help so as to create complex targeting macros

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off