New to Addon Development and Looking for UPDATED Resources

I’m not sure how riveting watching a thousand hours of code being typed onto a screen is going to be no matter how personable the voice describing it is.

You can paste the following into the website addon.bool.no to create/download an addon example that gives a simple display of the total of a listed set of herbs (Legion) you have in your bags (updates as new herbs in the list are picked).

Coded for simplicity, not efficiency.

local total = 0 -- Will hold the total of listed herbs you have in your bags

local herbs = { -- A list of herbs type you want to count.
	aethril = 124101,
	dreamleaf = 124102,
	foxflower = 124103,
	fjarnskaggl = 124104,
	starlightRose = 124105,
	felwort = 124106,
}


function CountHerbs(itemID) -- A function to go through your bags looking for herbs of a given type
	local _, itemLink = GetItemInfo(itemID)
	for bag = 0, NUM_BAG_SLOTS do
		for slot = 1, GetContainerNumSlots(bag) do
			if (GetContainerItemLink(bag, slot) == itemLink) then
				if select(2, GetContainerItemInfo(bag, slot)) then
					total = total + select(2, GetContainerItemInfo(bag, slot))
				end
			end
		end
	end
end

local herbCountFrame = CreateFrame("frame", "FizzleHerbCountFrame", UIParent) -- Create a frame to do the work
herbCountFrame:SetSize(50,16)
herbCountFrame:SetPoint("CENTER", UIParent) -- Place the frame in the middle of the screen
herbCountFrame:SetMovable(true)  -- The rest is pretty much to make the frame dragable
herbCountFrame:EnableMouse(true)
herbCountFrame:RegisterForDrag("LeftButton")
herbCountFrame:SetScript("OnDragStart", herbCountFrame.StartMoving)
herbCountFrame:SetScript("OnDragStop", herbCountFrame.StopMovingOrSizing)
herbCountFrame:SetClampedToScreen(true)

herbCountFrame.text = herbCountFrame:CreateFontString(nil, "OVERLAY") -- Add a text display widget (FontString)
herbCountFrame.text:SetFont("FONTS\\FRIZQT__.TTF", 18, "OUTLINE") -- General text settings
herbCountFrame.text:SetTextColor(1, 1, 0, 1) -- Yellow
herbCountFrame.text:SetAllPoints(true) -- Anchor the text display and make it the same size as the frame

herbCountFrame:RegisterEvent("BAG_UPDATE") -- Get notified when you bags inventory changes
herbCountFrame:SetScript("OnEvent", function(self, event, ...) -- self=the frame the event is registered for, event=the event (for multiple events), ...=a variable number of parameters based on the event
	total = 0
	for herb, id in pairs(herbs) do -- Cycle throught the herb list
		CountHerbs(id) -- Count the total herbs of each type in you bags (see CountHerbs above).
	end
	self.text:SetText(total) -- Display the new total
end)

SLASH_FizzleHerbs1 = "/fzh" -- A slash handler using /fzh or /fh
SLASH_FizzleHerbs2 = "/fh"
SlashCmdList["FizzleHerbs"] = function(msg)  -- Slash handler control function
	herbCountFrame:SetShown(not herbCountFrame:IsShown()) -- toggle hiding/showing the frame
end

Edit: Spoiled for choice :rofl: