AutoRepair 4.0

Simply autorepairs your cloth while talking to a vendor who offers repairing

some little chatmessage with the costs will be shown

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of enjoy2000 enjoy2000 May 04, 2010 at 11:20 UTC - 0 likes

    Hi,

    Many thanks for writing this useful addon. I would like to propose a small addition: Repair from the Guild Bank.

    I have tested the addition to your code, and would like to offer you the changes. This version works with patch 3.3.3, and it works fine with characters not in a guild, not allowed to use GB money and of course with one that can.

    Please find the code below. I have kept your author signature intact, I have no desire to get any credits for this minimal addition.

    I hope that you find it useful,

    Regards,

    Eelco Ligtvoet

    -- Author      : danina  Thrall-EU
    -- Create Date : 27/01/2010 5:12:06 PM
    -- RamUsage    : 2,3 kb
    
    if (GetLocale() == "deDE") then
        NixZuReppen = "AutoRepair: Nix zu reparieren !"
        KannNichtreppen = "AutoRepair: Hรคndler kann nicht reparieren !"
        Repariert	= "AutoRepair: Alle Items repariert. Kosten"
        GBnote = " vom GuildBank" 
    else
        -- for the rest, usually english since it's the default language
        NixZuReppen = "AutoRepair: Nothing to repair !"
        KannNichtreppen = "AutoRepair: Vendor can not repair !"
        Repariert	= "AutoRepair: All items repaired. Cost"
        GBnote = " from GuildBank"
    end
    
    
    function AutoRepair_OnLoad()
    	this:RegisterEvent("MERCHANT_SHOW")
    	--this:RegisterEvent("MERCHANT_CLOSED");
    end
    
    function AutoRepair_OnEvent()
    	if (event == "MERCHANT_SHOW") then
    		if (CanMerchantRepair()) then
    			local repairAllCost, canRepair = GetRepairAllCost()
    			if (canRepair) then
    												--Fuckin floor
    												--12889											--12g 88s 99c
    				Goldcost = floor(repairAllCost / 10000)				--12
    				Rest_One	= repairAllCost - (Goldcost*10000)			--8899
    				SilverCost	= floor(Rest_One / 100)					--88
    				CopperCost = Rest_One - (SilverCost*100)				--99
    				
      				RepairAllItems(CanWithdrawGuildBankMoney())
    				msg = Repariert..": "..Goldcost.."g "..SilverCost.."s "..CopperCost.."c"
    				if (CanWithdrawGuildBankMoney()) then
    					msg = msg..GBnote
    				end
    				DEFAULT_CHAT_FRAME:AddMessage(msg)
    			else
    				DEFAULT_CHAT_FRAME:AddMessage(NixZuReppen)
    			end
    		else
    			DEFAULT_CHAT_FRAME:AddMessage(KannNichtreppen)
    		end	
    	end
    end
    
  • 1 comment

Facts

Date created
Jan 22, 2009
Category
Last update
Jul 03, 2011
Development stage
Release
Language
  • deDE
  • enUS
License
Public Domain
Curse link
AutoRepair 4.0
Downloads
36,012
Recent files

Authors