Tercio@0: Tercio@0: Tercio@0: Tercio@0: do Tercio@0: local f = CreateFrame ("frame", "GoldPriceFrame", UIParent) Tercio@0: f:RegisterEvent ("TOKEN_MARKET_PRICE_UPDATED") Tercio@0: f:Hide() Tercio@0: Tercio@0: function f:comma_value (n) Tercio@0: n = floor (n) Tercio@0: local left,num,right = string.match (n,'^([^%d]*%d)(%d*)(.-)$') Tercio@0: return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right Tercio@0: end Tercio@0: Tercio@0: f:SetScript ("OnEvent", function (self, event) Tercio@0: Tercio@0: local price = C_WowTokenPublic.GetCurrentMarketPrice() Tercio@0: price = floor (price / 10000) Tercio@0: Tercio@0: print ("|cFFFF9900Token Price|r: ", f:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") Tercio@0: end) Tercio@0: end Tercio@0: Tercio@0: SLASH_GoldPrice1, SLASH_GoldPrice2 = "/gold", "/token" Tercio@0: function SlashCmdList.GoldPrice (msg, editbox) Tercio@0: if (GoldPriceFrame.LastQuerry and GoldPriceFrame.LastQuerry+15 > GetTime()) then Tercio@0: local price = C_WowTokenPublic.GetCurrentMarketPrice() Tercio@0: price = floor (price / 10000) Tercio@0: return print ("|cFFFF9900Token Price|r: ", GoldPriceFrame:comma_value (price) .. "|TInterface\\MoneyFrame\\UI-GoldIcon:0:0:2:0|t") Tercio@0: end Tercio@0: GoldPriceFrame.LastQuerry = GetTime() Tercio@0: C_WowTokenPublic.UpdateMarketPrice() Tercio@0: end Tercio@0: Tercio@0: