local _,ns = ...
ns.ADDUIEVENT("PLAYER_LOGIN", function()
if AddUIDB.mh ==  true  then
--自动卖灰
local f = CreateFrame("Frame") 
f:SetScript("OnEvent", function(...) 
	local p,N,c,n=0
		for b=0,4 do
		    for s=1,C_Container.GetContainerNumSlots (b) do
			    n=C_Container.GetContainerItemLink(b,s) 
                    if n and string.find(n,"9d9d9d") then
					    N={C_Item.GetItemInfo(n)} 
                        c=C_Item.GetItemCount(n)
						p= p+(N[11]*c)
						C_Container.UseContainerItem(b,s)
					end
			end
		end 
    if p ~= 0 then
	    print("|cff44CCFF售卖垃圾: |r"..C_CurrencyInfo.GetCoinText(p))
	end
end)
f:RegisterEvent("MERCHANT_SHOW")
end

-- 快速拾取
if AddUIDB.sq ==  true  then
local faster = CreateFrame("Frame")
faster:RegisterEvent("LOOT_READY")
faster:SetScript("OnEvent", function(self, event, ...)
-- Time delay
local tDelay = 0
	if GetTime() - tDelay >= 0.1 then
		tDelay = GetTime()
		if GetCVarBool("autoLootDefault") ~= IsModifiedClick("AUTOLOOTTOGGLE") then
			for i = GetNumLootItems(), 1, -1 do
				LootSlot(i)
			end
			tDelay = GetTime()
		end
	end
end)
end

end)