Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7.1. Autosell grey trash and repair:
- Code:
- local g = CreateFrame("Frame")
- g:RegisterEvent("MERCHANT_SHOW")
- g:SetScript("OnEvent", function()
- local bag, slot
- for bag = 0, 4 do
- for slot = 0, GetContainerNumSlots(bag) do
- local link = GetContainerItemLink(bag, slot)
- if link and (select(3, GetItemInfo(link)) == 0) then
- UseContainerItem(bag, slot)
- end
- end
- end
- if(CanMerchantRepair()) then
- local cost = GetRepairAllCost()
- if cost > 0 then
- local money = GetMoney()
- if IsInGuild() then
- local guildMoney = GetGuildBankWithdrawMoney()
- if guildMoney > GetGuildBankMoney() then
- guildMoney = GetGuildBankMoney()
- end
- if guildMoney > cost and CanGuildBankRepair() then
- RepairAllItems(1)
- print(format("|cfff07100Repair cost covered by G-Bank: %.1fg|r", cost * 0.0001))
- return
- end
- end
- if money > cost then
- RepairAllItems()
- print(format("|cffead000Repair cost: %.1fg|r", cost * 0.0001))
- else
- print("Not enough gold to cover the repair cost.")
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement