The Ultimate Turkey Macro

2009 November 22
by Strobe

Since we’re all hunting turkeys at the moment, I decided to craft a macro to make it a little easier. Run around spamming this macro to mark every turkey in the area. Behold, and do make sure you can mark things before starting.

/tar Wild Turkey
/run if not GetRaidTargetIndex("target") and not UnitIsDead("target") and UnitName("target") == "Wild Turkey" then if turkey == nil or turkey == 0 then turkey = 8 end SetRaidTarget("target", turkey); turkey = turkey -1 end;
5 Responses leave one →
  1. Matt permalink
    October 1, 2010

    STROBE – so i have a question for you, can you explain this macro a bit? does this only work for them holiday turkeys? i have tried everything to try and make it work for other things while questing and such and it simply will not work for me. please please let me know. This macro was AMAZING while the event was happening, i would love to be able to throw a different target in there and just spam while lvling toons and such. Please let me know! appreciate the help!!!

    • October 1, 2010

      Hello Matt,

      Sure, I can give it a try. Let’s break it up and use less shorthand for easier reading:

      /target Wild Turkey
      /run
          if not GetRaidTargetIndex("target") and not UnitIsDead("target") and UnitName("target") == "Wild Turkey" then
              if turkey = nil or turkey == 0 then
                  turkey = 8
              end
              SetRaidTarget("target", turkey);
              turkey = turkey -1
          end

      And now in bite-sized chunks.

      /target Wild Turkey

      This will target the nearest Wild Turkey

      /run

      This starts a Lua interpretor, allowing everything that follows to be written in pure Lua as opposed to WoW commands. It would be impossible to write this macro without the assistance of Lua.

      if not GetRaidTargetIndex("target") and not UnitIsDead("target") and UnitName("target") == "Wild Turkey" then

      This evaluates a condition:

      If the current target is not already marked, and the current target is not dead, and the current target is indeed a Wild Turkey, do the following…

      if turkey = nil or turkey == 0 then
          turkey = 8
      end

      This introduces a variable, “turkey”. It is not initialised to any value, but the first line will check if the variable doesn’t exist, so that’s no problem. So basically, if the variable turkey either does not exist or is equal to 0, set turkey to 8. end breaks us out of the if conditional. Why do this? The variable turkey is used to keep track of the raid icons (numbered from 1 to 8, see) in use. For now, just keep that in mind.

      SetRaidTarget("target", turkey);

      Add an icon to the current target. Which icon? That’s defined by the current number of turkey. A list is available of what number is equivalent to what icon at WoWWiki.

      turkey = turkey -1

      Decrement turkey by 1. Every time the button is pressed, you will effectively be decrementing your turkey variable by 1 in order to cycle through available raid icons. The above conditional ensures that if turkey ever gets to 0, it’s set back to 8 (a valid icon number).

      end

      And this breaks us out of the outer conditional.

      Given the explanation, you should be able to modify it to your liking. It should work with any target whatsoever, but I’m not sure exactly what you’re after.

  2. Matt permalink
    October 4, 2010

    Thank you so much for the reply. Im at work now but i will have to try it out. The breakdown was very helpful. again, thank you!1111111111

  3. Trisha permalink
    November 26, 2011

    ok so i looked up ur amazeing Macro & typed it in exactly as it is writen & saved it to my macro ran to the nearest turkey hit the macro button & nothing happened. can u give me some advice please? i was told recently that WoW has takin Macro auto targeting away but i dont know thank you for your time.

    • November 29, 2011

      Hello Trisha,

      I no longer play WoW so I’m not really in the loop with recent changes, but if Blizzard did indeed remove macro targeting, there is no way this macro could work. Sorry!

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS