MxW_Addon/Function/TSM.lua

27 lines
736 B
Lua
Raw Normal View History

2018-01-05 06:40:15 -05:00
-- MxW (MxW Addon)
-- By mikx
2020-11-13 14:41:52 -05:00
-- https://git.mikx.xyz/mikx/MxW_Addon
2018-01-05 06:40:15 -05:00
-- Licensed under the GNU General Public License 3.0
-- See included License file for more informations.
-- TSM.lua
-- TradeSkillMaster Functions
local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
local TSMVERSION = GetAddOnMetadata("TradeSkillMaster", "Version")
MX.TSM = MX.TSM or {}
-- GetItemValue(itemID, priceSource)
-- Return itemID value as a int using priceSource
function MX.TSM:GetItemValue(itemID, priceSource)
2020-11-13 14:41:52 -05:00
local itemLink = "i:" .. tostring(itemID);
return TSM_API.GetCustomPriceValue(priceSource, itemLink)
2018-01-05 06:40:15 -05:00
end
2020-11-30 11:41:27 -05:00
function MX.TSM:GetItemQuantity(itemID)
local itemLink = "i:" .. tostring(itemID);
return TSM_API.GetPlayerTotals(itemLink)
end