Quantcast
WoWInterface - View Single Post - Simple tracking scrips
View Single Post
04-17-20, 09:02 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,236
The global space is shared by the entire Blizzard UI and all the 3rd party addons you have installed. Naming a global variable "i" is not a great idea as it's too easy for it to be "trampled" by someone missing a "local" declaration by accident.

Code:
local Mining, Herbing = 2580, 2383
local FindHerbs
local function tracking()
	if not UnitIsEnemy("player","target") and not IsResting() then
		FindHerbs = not FindHerbs
		if FindHerbs then
			CastSpellByID(Herbing)
		else
			CastSpellByID(Mining)
		end
	end
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote