Tracking Macros

Slack Programming
Slack Programming

For a long time, I’ve been wanting to make tracking toggle macros. As in a [Track Humanoids] button that turns on the track humanoids option. If you click it again, it turns it off.

A long time ago in  a galaxy far far away… those abilities showed up in your spell book and could easily be added to your action bars or used in a macro. Now, they’re hidden in API function calls.

Today, while playing on her hunter, my honey says “I wish I could make a macro for Track Humanoids” and it reminded me that I wanted to do this for my Druid too.

Whelp… since she wanted it, and I was thinking I should figure it out one day, today was the day. The end result is something that I can share, so here you go. If you want to do any of the others, like Track Beasts/Demons/Hidden/Giants… just create a new macro for the different tracking type and change the part that says “Track Humanoids” to “Track Beasts” or “Track Demons” or whatever you are looking for that’s on your mini-map tracking. Make sure you use the text as you see it on your mini-map icon. “Find Herbs” for herbalism. “Mailbox” for mailboxes. Yada yada.

/run for i=1,GetNumTrackingTypes() do local spell,_,status=GetTrackingInfo(i) if spell==”Track Humanoids” then SetTracking(i, not status) end end

As of 8.3, it works for both Hunters and for Druids in Cat Form.

Since it’s a script, you can’t use the [?]-icon/#showtooltip in the macro. You must select an icon if you don’t want to see “?” in your action bar.  I’ll give you 2 freebies, because I was wanting to setup macros for track humanoids and beasts. The icon for track humanoids (as it appears in the hunter tracking) is 7th page down in the icon listing… second row… far right. The icon for track beasts is 4th page down… first row… fourth icon. For any others, you’re on your own.

For those that are curious about what the code is doing, it finds out how many different types of tracking there are and loops from tracking type 1 through the last tracking type. As it’s looping through, it’s getting the name of the type and its status (active or not active). If it finds what we’re looking for (“Track Humanoids” in this case), then it sets the status to the opposite of what it’s currently set to.

If you’re like me and are curious what the different tracking types are, run this script and it will display in your chat log the tracking type number and the tracking type name.

/run for i=1,GetNumTrackingTypes() do local spell,_,status=GetTrackingInfo(i) print(i .. ” – ” .. spell) end

I like programming, as you saw here. I could spend hours/days/weeks programming things like this. Where’s my callback Blizzard? I’d like to program for you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s