local function defaultcvar()
SetCVar("nameplateMaxDistance", 40)--姓名版显示距离
SetCVar("overrideArchive", 0) --和谐国服  1:开启      0:关闭
SetCVar("screenshotQuality", 10) --截图品质(10最高) 
SetCVar("screenshotFormat", "jpg") --截图格式，tga或jpg 
end 
local frame = CreateFrame("FRAME", "defaultcvar") 
   frame:RegisterEvent("PLAYER_ENTERING_WORLD") 
local function eventHandler(self, event, ...) 
         defaultcvar() 
end 
--alt点击批量购买
local savedMerchantItemButton_OnModifiedClick = MerchantItemButton_OnModifiedClick 
function MerchantItemButton_OnModifiedClick(self, ...) 
   if ( IsAltKeyDown() ) then 
      local itemLink = GetMerchantItemLink(self:GetID()) 
      if not itemLink then return end 
      local maxStack = select(8, GetItemInfo(itemLink)) 
      if ( maxStack and maxStack > 1 ) then 
         BuyMerchantItem(self:GetID(), GetMerchantItemMaxStack(self:GetID())) 
      end 
   end 
   savedMerchantItemButton_OnModifiedClick(self, ...) 
end

--自动Delete
hooksecurefunc(StaticPopupDialogs["DELETE_GOOD_ITEM"],"OnShow",function(boxEditor) boxEditor.editBox:SetText(DELETE_ITEM_CONFIRM_STRING) end)
--快速拾取
local addon = CreateFrame("Frame")
local epoch = 0

local LOOT_DELAY = 0.3

-- NOTE The event triggers twice upon opening a lootable container
addon:RegisterEvent("LOOT_READY")

--[[
Attempts to loot items from a container.

Looting occurs only if auto loot is enabled xor its toggle key is pressed. In
addition, enough time must elapse after a LOOT_READY event to prevent possible
disconnections.
]]--
addon:SetScript("OnEvent", function ()
	if GetCVarBool("autoLootDefault") ~= IsModifiedClick("AUTOLOOTTOGGLE") then
		-- Verify that enough time has passed
		if (GetTime() - epoch) >= LOOT_DELAY then
			for i = GetNumLootItems(), 1, -1 do
				LootSlot(i)
			end
			
			epoch = GetTime()
		end
	end
end)
