Hiyas, all. This has me stumped, so forgive me if it's an obvious question. I have a small add on I wrote to go with Seerah's lovely Sstats add on. Sstats Zone. I'm trying to change the syntax of the readout to display zone AND subzone. The problem comes in when I try to separate them with a colon, like so.
What I end up with are syntax errors, or just ZoneSubzone, no colon. Here is the code I have. I know it's something simple, but I can't find it.
However, repeating that on every frame draw ever (by using an OnUpdate script) is reeeeally inefficient. You should register for the events that fire when you change zones or subzones and, since the API doesn't always return the updated values immediately when the events fire, use the OnUpdate script to add a 1/10 second delay or so:
local sStats_Zone, sStats_ZoneText = sStats:CreateModule("Zone")
local f = CreateFrame("Frame")
local e = 0
f:SetScript("OnUpdate", function(self, elapsed)
e = e + elapsed
if e > 0.1 then
sStats:SetModuleText(sStats_ZoneText, GetZoneText() .. " : " .. GetSubZoneText(), "")
f:SetScript("OnEvent", function(self, event, ...)
e = 0
sStats.RegisterCallback(sStats_Zone, "sStats_Modules_Ready", function()
e = 0
__________________ Retired author of too many addons.
Message me if you're interested in taking over one of my addons. Donít message me about addon bugs or programming questions.