Quantcast
WoWInterface - View Single Post - Print amount of money for repair
View Single Post
09-28-21, 02:32 AM   #1
darhanger
A Fallenroot Satyr
 
darhanger's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2017
Posts: 20
Print amount of money for repair

Wanna print massage in chat when function executed. Also wanna make printing with gold/silver/cooper logos in chat.

Lua Code:
  1. if MerchantWindow then
  2.   local Cost, NeedRapair = GetRepairAllCost()
  3.    local function CalculateCost()
  4.    local gold = floor(Cost / 10000)
  5.    local silver = mod(floor(Cost / 100), 100)
  6.    local cooper = mod(floor(Cost), 100)
  7.         return format("%gold, %silver, %bronze", gold, silver, cooper)
  8.    end;      
  9.    if NeedRapair
  10.     and GetMoney() > (Cost * 4) then
  11.             RepairAllItems()
  12.             print("All Items Repaired"..CalculateCost())
  13.         end
  14.     end
  15. end
  Reply With Quote