YES! I finally got the code to work, all of it!

If anyone wanna take a look...(the part where it prints stuff on the chat is where I'm gonna add code in the future)
- Code: Select all
local AddOn=0
local AddOnBag=0
local AddOnSlot=1
GameTooltip:SetScript("OnShow",function()
if (string.gsub(string.gsub(GetMouseFocus():GetName(),"ContainerFrame%d",""),"%d","")=="Item" and AddOn==0)then
AddOn=1
AddOnBag=string.gsub(string.gsub(GetMouseFocus():GetName(),"ContainerFrame",""),"Item%d+","")-1
AddOnSlot=GetContainerNumSlots(AddOnBag)-string.gsub(GetMouseFocus():GetName(),"ContainerFrame%dItem","")+1
DEFAULT_CHAT_FRAME:AddMessage("In"..GetContainerItemLink(AddOnBag, AddOnSlot))
end
end)
GameTooltip:SetScript("OnHide",function()
if (AddOn==1 and getglobal("ContainerFrame"..(AddOnBag+1)):IsVisible())then
if (GetMouseFocus():GetName()~="ContainerFrame"..(AddOnBag+1).."Item"..(-AddOnSlot+1+GetContainerNumSlots(AddOnBag)))then
AddOn=0
DEFAULT_CHAT_FRAME:AddMessage("OutOn"..GetContainerItemLink(AddOnBag, AddOnSlot))
end
end
end)
AddOnFrame=CreateFrame("Frame")
AddOnFrame:SetScript("OnUpdate",function()
local AddOnFrame=GetMouseFocus()
if AddOnFrame then
local AddOnName=AddOnFrame:GetName()or tostring(AddOnFrame)
end
if (AddOn==1 and not AddOnFrame)then
AddOn=0
DEFAULT_CHAT_FRAME:AddMessage("OutUp"..GetContainerItemLink(AddOnBag, AddOnSlot))
end
end)
I wanna say, thank you:
wowprogramming.com
google.com
stackoverflow.com
wowwiki.wikia.com
vanilla-wow.wikia.comand other sites that I don't have openned right now

like...
townlong-yak.com/framexml/1.1.2
github.com/Gethe
youtube.com/user/Infernoxv8