UPDATE: This is obsolete: World of Warcraft now supports multiple tracking types simultaneously.
I had a character who was both a miner and an herbalist. At the time, World of Warcraft only supported the use of one tracking type at a time.
I wanted to occasionally swap between the two tracking types. What follows are some rough notes copied from various sources.
Random postings I found on the net ∞
Stumbled across this on another site, and its unbelievably handy.
/run if not THO then local f,t,c=CreateFrame("Frame","THO"),1,0 f:SetScript("OnUpdate", function(_, e) c=c+e if c>3 then c=0 SetTracking(t) if t==1 then t=2 else t=1 end end end) THO:Hide() end /run if THO:IsVisible() then THO:Hide() else THO:Show() end
This macro will switch between herbalism and mining tracking, every 3 seconds until you click it again. Great for flying around Sholozar if you have both. If you have Fish tracking as well, use this macro instead:
/run if not THO then local f,t,c=CreateFrame("Frame","THO"),1,0 f:SetScript("OnUpdate", function(_, e) c=c+e if c>3 then c=0 SetTracking(t) if t==2 then t=3 else t=2 end end end) THO:Hide() end /run if THO:IsVisible() then THO:Hide() else THO:Show() end
Credit to either Eyetotem on MMO-Champion, or gezus on MMOwned. Not sure who’d posted it first.
This should be pretty easily editable to include hunter tracking if you’re a skinner & miner/herb as well.
As far as I can tell, just edit:
/run if not THO then local f,t,c=CreateFrame("Frame","THO"),1,0 f:SetScript("OnUpdate", function(_, e) c=c+e if c>3 then c=0 SetTracking(t) if t==1 then t=2 else t=1 end end end) THO:Hide() end /run if THO:IsVisible() then THO:Hide() else THO:Show() end
That section, so the 1 matches which ever number in your tracking list you want, and 2 matches the second.
My todo list ∞
- put the list of places into an array
- when checking against my location, iterate through that array
-
multiple use of the tracking macro seems to slow things down.. as though it’s stacking multiple instances of itself! I can add in some debugging print() statements to determine if this is true or not..
Early variations ∞
/run a={1,"something","0"} /run local global_a=getglobal("a"); for key,value in pairs(a) do print(key,value) end /run local global_a=getglobal("a"); for key,value in pairs(a) do print(value) end
/run print("--") /run autoswap_tracking_locations={ "Valiance Keep", "Theramore Isle", "Menethil Harbor", "The Great Sea" } /run local locs=getglobal("autoswap_tracking_locations"); for key,value in pairs(locs) do print(value) end
/run print("--") /run autoswap_tracking_locations={ "Valiance Keep", "Theramore Isle", "Menethil Harbor", "The Great Sea" } /run test_function = function () locs=getglobal("autoswap_tracking_locations"); for key,value in pairs(locs) do print(value) end; end /run test_function()
/run print("--") /run autoswap_tracking_locations={ "Theramore Isle", "Menethil Harbor", "The Great Sea", "Valiance Keep", "Silver Covenant Pavilion" } /run autoswap_tracking_locations_function = function () locs=getglobal("autoswap_tracking_locations"); for key,value in pairs(locs) do if GetMinimapZoneText()==value then return 1 end; end end /run if autoswap_tracking_locations_function() then print "ok!" else print "not ok" end
/run local f=AuG or CreateFrame("Frame","AuG") f.m,f.t=1,0 f:SetScript("OnUpdate",function(s,e) f.t=f.t+e if f.t>2.5 and not InCombatLockdown() and not ( IsResting() or GetMinimapZoneText()=="Valiance Keep" ) then f.t=0 f.m=3-f.m sfx=GetCVar("Sound_EnableSFX") SetCVar("Sound_EnableSFX","0") UIErrorsFrame:Hide() SetTracking(f.m) UIErrorsFrame:Clear() local global_sfx=getglobal("sfx") SetCVar("Sound_EnableSFX",global_sfx) end end) f:Show()
My macros ∞
I think this was the final revision I made before I learned of the upcoming changes and halted development.
Autoswap_Tracking ∞
/run local a=1 -- There is a critical error which crashes WoW which is caused by a combination of many comments and the addon Super Duper Macro --- To solve this, I add the above line at the top of the macro. I suspect just about anything would work. -- -- About -- -- Toggles the first two tracking options every 2.1 seconds. --- when out of combat (automated programming is disabled in combat) --- when not resting --- if not in select places -- Works until you log out or reload the UI with /console reloadui -- Can be stopped with another macro that does /run global_ATS=0 -- -- To do -- Clean up / shorten my locations code so that I use a simple procedure. -- modify to disable itself if the tracking is not of type 1 or 2 (i.e. the user changed tracking manually) -- modify to disable itself if tracking type 1 is repair (i.e. the user has nothing interesting to track) -- To be re-investigated: This code is SUPPOSED to work, and it's given as examples. BUT IT DOES NOT WORK. -- So there's no easy way to disable this macro when in a friendly area which would not have any gathering in it.. ARGH. --- /run local pvpType,isFFA,faction = GetZonePVPInfo(); DEFAULT_CHAT_FRAME:AddMessage(tostring(pvpType)..tostring(isFFA) ..tostring(faction)) --- consider having a list of anti-exceptions, like a list of places which would have tracking swapping enabled even regardless of faction control status. Some places are actually still gatherable. -- Re-investigate the removal of the floating combat text. Is it possible to disable floating combat text from a macro? -- Make the various variables global and the move the tracking-swapping into its own function. This will clean the code up a lot. -- Just bite the bullet and turn this into an addon. --- with a gui to manage the list of location exceptions (take this code from some other addon) -- Detect latency [is that possible?] and enlarge the tracking swapping timer? -- Stop the tracking, or even set it to something else, while in flight.. I hate seeing that stuff and just flying past. -- Do not re-run it if I'm in a city. That's the time when I'm most likely to attempt that. -- Utgarde Keep = mining only -- Azjol Nerub = herbalism only -- -- Known issues -- -- With floating combat text enabled, that there will be a message about the tracking change. --- This may be impossible to remove without using some combat text addon to replace the default one. --- For now, I chose to entirely disable floating combat text. Researching a better solution is on the todo list. -- Clicking a spell (like resurrect) and then mousing over the field to select a target will be cancelled when the tracking type is changed. I doubt anything can be done about that. --- This is why I implemented the start/stop functionality. -- Yes, this is Alliance-centric -- Damned WoW and your string length limitations. -- Damned Lua and your inability to easily append _multiple_ items into a table. /run ATS_Locations={} -- Classic / Vanilla /run table.insert(ATS_Locations, "Rut'theran Village" ) /run table.insert(ATS_Locations, "Thelsamar" ) /run table.insert(ATS_Locations, "Theramore Isle" ) /run table.insert(ATS_Locations, "Faldir's Cove" ) -- Note that there is Stranglekelp right by the docks /run table.insert(ATS_Locations, "Menethil Harbor" ) /run table.insert(ATS_Locations, "Booty Bay" ) /run table.insert(ATS_Locations, "Feathermoon Stronghold" ) /run table.insert(ATS_Locations, "Timbermaw Hold" ) /run table.insert(ATS_Locations, "Gadgetzan" ) /run table.insert(ATS_Locations, "Emerald Sanctuary" ) /run table.insert(ATS_Locations, "Talonbranch Glade" ) /run table.insert(ATS_Locations, "Morgan's Vigil" ) /run table.insert(ATS_Locations, "The Veiled Sea" ) /run table.insert(ATS_Locations, "The Great Sea" ) -- The Burning Crusade (TBC) /run table.insert(ATS_Locations, "Honor Hold" ) /run table.insert(ATS_Locations, "Hellfire Ramparts" ) /run table.insert(ATS_Locations, "The Blood Furnace" ) /run table.insert(ATS_Locations, "Allerian Stronghold" ) /run table.insert(ATS_Locations, "Orebor Harborage" ) /run table.insert(ATS_Locations, "Telaar" ) /run table.insert(ATS_Locations, "Wildhammer Stronghold" ) /run table.insert(ATS_Locations, "The Mechanar" ) -- Wrath of the Lich King (WotLK) /run table.insert(ATS_Locations, "Valiance Keep" ) /run table.insert(ATS_Locations, "Silver Covenant Pavilion" ) -- Dragonblight /run table.insert(ATS_Locations, "Fordragon Hold" ) -- /run table.insert(ATS_Locations, "Moa'ki Harbor" ) -- Grizzly Hills /run table.insert(ATS_Locations, "Amberpine Lodge" ) /run table.insert(ATS_Locations, "Fort Wildervar" ) /run table.insert(ATS_Locations, "Westguard Keep" ) /run ATS_IsLocationMatched = function () locs=getglobal("ATS_Locations") for key,value in pairs(locs) do if GetMinimapZoneText()==value then return 1 end; end end -- /run global_ATS=1 print("Automatic tracking-swapping has been started.") /run ATS=getglobal("global_ATS") if ATS==1 or ATS==0 then print("Warning... you should probably only start this once. It's allowed, but do a /console reloadui if you regret it.") else global_ATS=1 print("Automatic tracking-swapping has been started.") end -- Note the f.t>2.1 - If you are too lagged, you cannot even switch tracking types, so I suppose making this number larger would help. /run local f=AuG or CreateFrame("Frame","AuG") f.m,f.t=1,0 f:SetScript("OnUpdate",function(s,e) f.t=f.t+e local ATS=getglobal("global_ATS") if f.t>2.1 and not ( ATS==0 or InCombatLockdown() or IsResting() or ATS_IsLocationMatched() ) then f.t=0 f.m=3-f.m global_sfx=GetCVar("Sound_EnableSFX") SetCVar("Sound_EnableSFX",0) UIErrorsFrame:Hide() SetTracking(f.m) UIErrorsFrame:Clear() local sfx=getglobal("global_sfx") SetCVar("Sound_EnableSFX",sfx) end end ) f:Show()
Autoswap_Tracking_Enable ∞
/run ATS=getglobal("global_ATS") global_ATS=1 print("Automatic tracking-swapping has been started.")
Autoswap_Tracking_Toggle ∞
/run local a=1 -- Disable automatic tracking (see the macro Autoswap_Tracking) /run ATS=getglobal("global_ATS") if ATS==0 then print("Switching tracking types.") else global_ATS=0 print("Automatic tracking-swapping has been stopped.") end -- Swap tracking types /run local _,_,t=GetTrackingInfo(2);SetTracking(t or 2)
