+ Reply to Thread
Results 1 to 11 of 11

Thread: Help on a macro for focus

  1. #1
    Join Date
    Sep 2010
    Posts
    10

    Help on a macro for focus

    I am looking for a macro that will target current target, or self target if no focus is set. Currently using:

    #showtooltip
    /cast [target=focus] (spell name)

    Works great unless I forget to set a focus or need to use spell on a different target. I would prefer not to use modifiers.
    Little help please.

  2. #2
    Join Date
    Dec 2007
    Posts
    26
    So you want it to try to cast on your focus, then on your current target if no focus is there, then on yourself if you have no target?
    Just trying to clarify

  3. #3
    Join Date
    Dec 2007
    Posts
    26
    If you have auto selfcast on this macro will cast on your focus if you have one and it is alive. If you have no focus or it is dead it will just cast the spell as if you were to click it right from the spellbook

    #showtooltip
    /cast [@focus,exists,nodead][] (Spell Name)

    Not sure if that is what you were asking for or not.

  4. #4
    Join Date
    Sep 2010
    Posts
    10
    Your understanding was perfect. I will try this new macro. Will it work if the focus is out of range? What are the second set of brackets for?

  5. #5
    Join Date
    Dec 2007
    Posts
    26
    Depends on how far the focus is. If it is far enough out of range that you don't get the OOR error message then it will just cast as if you had no focus, but if it's say 50yds then it will still get stuck casting on the focus. I don't believe there's a conditional for being in or out of range. I could be wrong though.
    The brackets are conditions that must be met. If a set of conditions(Brackets) are all false, then it tries the next set of conditions. An empty set of brackets means that there are no special conditions that need to be met to cast. So if the first set is false it casts like normal.
    I may not have worded that correctly, but it essentially means that if all else fails, then cast it like normal.

    This would have done the same thing with more letters.

    #showtooltip
    /cast [@focus,exists,nodead] (Spell Name); (Spell Name)

  6. #6
    Join Date
    Sep 2010
    Posts
    10
    It worked very nicely. I use this to tank heal while using using Healbot for the rest of the raid. Works great for things like Earth Shield and Lifebloom.

  7. #7
    Join Date
    Nov 2009
    Location
    WI, USA
    Posts
    2,614
    Quote Originally Posted by Blightlenox View Post
    If it is far enough out of range that you don't get the OOR error message then it will just cast as if you had no focus
    This is incorrect.

    The reason why it would cast normally isn't because your focus is so far away, but rather that your focus no longer exists. If range is too far you can no longer reference that unit and the focus is lost. Set your focus to someone standing at Dalaran south bank steps. Start walking to the flight path. You will continue to get Out of Range errors until such time as your focus frame disappears (focus no longer "exists"). Because the focus no longer exists, it fails that check and skips to the next modifier case.

    There is a difference between being far away and not existing (from the perspective of your game client).
    "In anything, if you want to go from just a beginner to a pro, you need a montage." /w TankSpot WTB Montage for Raiders.

  8. #8
    Join Date
    Dec 2007
    Posts
    26
    Quote Originally Posted by Quinafoi View Post
    This is incorrect.

    The reason why it would cast normally isn't because your focus is so far away, but rather that your focus no longer exists. If range is too far you can no longer reference that unit and the focus is lost. Set your focus to someone standing at Dalaran south bank steps. Start walking to the flight path. You will continue to get Out of Range errors until such time as your focus frame disappears (focus no longer "exists"). Because the focus no longer exists, it fails that check and skips to the next modifier case.

    There is a difference between being far away and not existing (from the perspective of your game client).
    Actually when you are in a group with your focus, which is the situation I assume the OP would be in, You don't lose the focus when the target gets out of range. You can go and test it in game if you would like.
    So I stand by my original statement.

  9. #9
    Join Date
    Nov 2009
    Location
    WI, USA
    Posts
    2,614
    Actually in this case we are both wrong.
    I will conceed that the focus will continue to exist if they are a unit in your party or raid group because then you can reference them regardless of distance.

    However, the macro will not default to the second case when distance is excessive. I haven't done testing in this area before.

    Because both "exists" and "nodead" modifiers still pass for your focus target, that is the case the macro will attempt to continue to use. However, once a unit is beyond rendering distance it no longer does the distance check and in fact passes in casting the spell. But what you are wrong about is it isn't falling through to the second case to cast the spell, but rather casting with the focus as the target. In the case where this is a healing or friendly spell, this results in the "waiting for target" mode of the spell. For example, group with someone in Dalaran, set your focus to them, then port to a different major city. When you are there try running a macro like this...

    /cast [@focus,exists,nodead] [@player] Holy Light

    If the focus truly failed, you would expect this to cast on yourself, one can assume you are always in range to cast on yourself. However what you find instead is that you are waiting for target mode like if you picked the spell and no target was resolved. It doesn't actually get to the second case in the macro syntax because the first passes it's conditionals, however no valid target is passed to the spell. If it never gets to the @player case, you can expect the same results in any other situation where this may occur. If your focus still exists and your focus is out of rendering range, the macro will not ever skip that condition.

    Range checking fails once the unit is out of rendering range so it no longer causes the error... but because there is no longer an error doesn't mean that condition fails and is skiped, in fact that condition is still valid and because you don't get an error the result is much different than expected.
    "In anything, if you want to go from just a beginner to a pro, you need a montage." /w TankSpot WTB Montage for Raiders.

  10. #10
    Join Date
    Dec 2007
    Posts
    26
    Quote Originally Posted by Quinafoi View Post
    Actually in this case we are both wrong.
    I will conceed that the focus will continue to exist if they are a unit in your party or raid group because then you can reference them regardless of distance.

    However, the macro will not default to the second case when distance is excessive. I haven't done testing in this area before.

    Because both "exists" and "nodead" modifiers still pass for your focus target, that is the case the macro will attempt to continue to use. However, once a unit is beyond rendering distance it no longer does the distance check and in fact passes in casting the spell. But what you are wrong about is it isn't falling through to the second case to cast the spell, but rather casting with the focus as the target. In the case where this is a healing or friendly spell, this results in the "waiting for target" mode of the spell. For example, group with someone in Dalaran, set your focus to them, then port to a different major city. When you are there try running a macro like this...

    /cast [@focus,exists,nodead] [@player] Holy Light

    If the focus truly failed, you would expect this to cast on yourself, one can assume you are always in range to cast on yourself. However what you find instead is that you are waiting for target mode like if you picked the spell and no target was resolved. It doesn't actually get to the second case in the macro syntax because the first passes it's conditionals, however no valid target is passed to the spell. If it never gets to the @player case, you can expect the same results in any other situation where this may occur. If your focus still exists and your focus is out of rendering range, the macro will not ever skip that condition.

    Range checking fails once the unit is out of rendering range so it no longer causes the error... but because there is no longer an error doesn't mean that condition fails and is skiped, in fact that condition is still valid and because you don't get an error the result is much different than expected.
    I guess I never noticed the range thing with a focus macro, b/c I typically only use my focus macros for enemy targets. In the situations that I use specific targets for macros on helpful spells (like 3v3) I have a specific person in mind on which I intend to cast so I call for their name in the macro.
    Something like

    #showtooltip
    /cast [nomod,@Dorry,exists,nodead][mod:shift,@Grizzlee,exists,nodead][mod:alt,@player] Hand of Freedom; Hand of Freedom

    For that it resorts to the normal function if I'm grouped with them, but not in same zone/really far away. I guess I just assumed that Focus on a group member would function the same way and not catch on the focus when it's in a different zone.

    That macro isn't the same one I use on my pali alt verbatim, just as close as I can remember it. I'm typing from a campus library so I can't check it exactly. So it may not be written correctly.
    But definitely, I thank you for the insight on the focus and apologize if I came off as being too spiteful. I tend to challenge things that appear to go against my understanding of something to the point of offending others.

    And btw do you know of any conditional for being in the same zone as a target or range or something to that effect?

  11. #11
    Join Date
    Nov 2009
    Location
    WI, USA
    Posts
    2,614
    Quote Originally Posted by Blightlenox View Post
    And btw do you know of any conditional for being in the same zone as a target or range or something to that effect?
    There is no macro modifier syntax for "inzone" or "inrange" type tests.

    A complete list of macro conditionals can be found here:
    http://www.wowwiki.com/Making_a_macro#Conditionals

    Note that complete doesn't include "no" prefix. It lists the "dead" conditional but doesn't list the "nodead" conditional. The "no" prefix can be used on any conditional. The list doesn't list all variations either (such as "modifier" shorthand "mod").

    Also note that neither of these are conditionals, there is no condition evaluated but rather a instruction.

    target= or @
    reset=

    Only way you can do range checking is through API calls. For example... the good old Lady Vashj tainted core macro.
    You can have a macro use the Tainted Core, but the use or cast command can't determine if the target is in range. You can do that with script however and whisper your target "Hey Joe, you're out of range." You would still get the "Out of Range" error when attempting to use it however.
    Code:
    /use Tainted Core
    /run f=SendChatMessage w="WHISPER"c="Tainted Core"t="target"u=UnitName(t)if IsItemInRange(c,t)==1 then f("You have the "..c,w,nil,u)f(u.." has "..c,"RAID")else f("Can't throw core at you. Get close!",w,nil,u)Minimap:PingLocation(0,0)end
    Last edited by Quinafoi; 09-10-2010 at 10:30 AM.
    "In anything, if you want to go from just a beginner to a pro, you need a montage." /w TankSpot WTB Montage for Raiders.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts