Im making an automatic tracker for an alt with both herbalism and mining! This is my first WoW addon, and got no experience with LUA or wow API before this.
In my LUA code ive got a a function that repeats every 4 seconds, which work perfectly until i login in a rested zone (inn or capital).
this is the function:
local function tracking()
if UnitIsEnemy("player","target") then
if IsResting() then
if i == 0 then
i = i + 1;
elseif i == 1 then
i = i - 1;
As you can see Ive made it so if im targeting a hostile monster it shouldnt loop, so i dont get GCDs when Im fighting, ive also added so i dont use it while getting rested, to not screw with me while doing stuff in capitals.
the way I run the function is:
if IsSpellKnown(2580) and IsSpellKnown(2383) then
This works if I login out in the wilds, when entring an inn It will not do any new tracking, and when exiting it will continue the trackingloop.
When I login into the same inn the tracking will not change after leaving the inn and do a /reload