Automatically repairs all equipped gear when you talk to a vendor.
Very minimal addon and code. Here is all of it:
Code:
local OnlyRepairs_MerchantShowFrame = CreateFrame("Frame")
OnlyRepairs_MerchantShowFrame:RegisterEvent("MERCHANT_SHOW") -- Register the show-vendor-window event
OnlyRepairs_MerchantShowFrame:SetScript("OnEvent", function(self,event,...) OnlyRepairs_MERCHANT_SHOW() end) -- Set function to run when event is triggered
function OnlyRepairs_MERCHANT_SHOW() -- When you talk to a vendor
if (CanMerchantRepair()) then -- If talking to a merchant who is able to repair gear
RepairAllItems() -- Repair all items
end
end