1. daily Guild Bank repairs --- API command

    Is there a way to return the amount available for daily guild bank repair in the .lua of an addon ? GetGuildBankRepairMoney()
    https://imgur.com/a/a4tEqyj

    Found stuff like "GetGuildBankWithdrawMoney()" here : https://wowpedia.fandom.com/wiki/World_of_Warcraft_API
    but it won't cut it as the amount u can withdraw is separate from the allowed guild funds to repair

  2. I just checked out the UI code surrounding MerchantGuildBankRepairButtonIcon for that tooltip and they're using GetGuildBankWithdrawMoney().

    Code:
    GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
    local repairAllCost, canRepair = GetRepairAllCost();
    if ( canRepair and (repairAllCost > 0) ) then
        GameTooltip:SetText(REPAIR_ALL_ITEMS);
        SetTooltipMoney(GameTooltip, repairAllCost);
        local amount = GetGuildBankWithdrawMoney();
        local guildBankMoney = GetGuildBankMoney();
        if ( amount == -1 ) then
            -- Guild leader shows full guild bank amount
            amount = guildBankMoney;
        else
            amount = min(amount, guildBankMoney);
        end
        GameTooltip:AddLine(GUILDBANK_REPAIR, nil, nil, nil, 1);
        SetTooltipMoney(GameTooltip, amount, "GUILD_REPAIR");
        GameTooltip:Show();
    end
    After playing with the permissions in my personal guild I found that GetGuildBankWithdrawMoney() is returning the amount I can use for repairs when no gold withdraws are allowed.

  3. Yo, thanks I made it work with GetGuildBankWithdrawMoney() !

    My addon didn't work the first time I'd talk to the NPC after logging on / reloading, as GetGuildBankWithdrawMoney() returned 0 on 1st talk

    Anyway how did you check out the UI code around the guild bank repair button ?

    Here's the code if anyone stumbles upon it someday (I used the minimalist addon as base : it didn't have the option to use guild bank repair)
    Code:
    function Minimalist:RepairHandler() --/reload
    	local equipcost = GetRepairAllCost()
    	local funds = GetMoney()
    	local guildmoney = GetGuildBankMoney()
    	
    	local guildfunds = GetGuildBankWithdrawMoney()	
    	if guildfunds == -1 then 
    		guildfunds = guildmoney
    	else
    		guildfunds = min(guildfunds, guildmoney) 
    	end
    	----------------self:Print("Guild bank money:"..self.abacus:FormatMoneyExtended(guildfunds))
    	if guildfunds == 0 then self:Print("Talk again to the NPC") end
    	-- local guildbankmoney = GetGuildBankMoney()
    	-- self:Print("Guild bank money:"..self.abacus:FormatMoneyExtended(guildbankmoney))
    
    	local done = true
    	if (IsInGuild() and CanGuildBankRepair() and guildfunds > 0 and equipcost > 0) then 	
    		self:Print("Guild bank repair funds: "..self.abacus:FormatMoneyExtended(guildfunds))
    		RepairAllItems(1) -- argument = 1 for guild
    		if (equipcost > guildfunds) then 
    			self:Print("Insufficient Guild funds to repair") 
    			done= false
    		else 
    			self:Print("Repair cost covered by G-Bank: "..self.abacus:FormatMoneyExtended(equipcost)) ---print(format("|cfff07100Repair cost covered by G-Bank: %.1fg|r", equipcost * 0.0001))
    			done = true 
    		end	
    	end
    	if (not(done) and funds < equipcost) then self:Print("Insufficient Gold to Repair") end
    	if (not(done) and funds > equipcost and equipcost > 0) then
    		RepairAllItems()
    		self:Print("Total Repair Costs: "..self.abacus:FormatMoneyExtended(equipcost))
    	end
    end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •