diff --git a/TradeSkillMaster/Core/Groups.lua b/TradeSkillMaster/Core/Groups.lua index bd38ca5..ce8d789 100644 --- a/TradeSkillMaster/Core/Groups.lua +++ b/TradeSkillMaster/Core/Groups.lua @@ -1315,6 +1315,7 @@ function TSM:ImportGroup(importStr, groupPath) local items = {} local currentSubPath = "" + local itemID, randomEnchant = nil, nil for _, str in ipairs(TSMAPI:SafeStrSplit(importStr, ",")) do str = str:trim() local noSpaceStr = gsub(str, " ", "") -- forums like to add spaces @@ -1327,7 +1328,7 @@ function TSM:ImportGroup(importStr, groupPath) elseif strfind(noSpaceStr, "p") then itemString = gsub(noSpaceStr, "p", "battlepet") elseif strfind(noSpaceStr, ":") then - local itemID, randomEnchant = (":"):split(noSpaceStr) + itemID, randomEnchant = (":"):split(noSpaceStr) if not tonumber(itemID) or not tonumber(randomEnchant) then return end itemString = "item:"..tonumber(itemID)..":0:0:0:0:0:"..tonumber(randomEnchant) end @@ -1336,8 +1337,13 @@ function TSM:ImportGroup(importStr, groupPath) currentSubPath = subPath elseif itemString then items[itemString] = currentSubPath - local item = Item:CreateFromID(tonumber(noSpaceStr)) - item:Query() + itemID = itemID or noSpaceStr + if Item then + local item = Item:CreateFromID(tonumber(itemID)) + item:Query() + else + TSMAPI:GetSafeItemInfo(tonumber(itemID)) + end else return end diff --git a/TradeSkillMaster/Core/Options.lua b/TradeSkillMaster/Core/Options.lua index 9028847..1390aa2 100644 --- a/TradeSkillMaster/Core/Options.lua +++ b/TradeSkillMaster/Core/Options.lua @@ -943,8 +943,12 @@ function private:LoadProfilesPage(container) -- check if item is cached local _,_,itemID = itemString:find("item:(%d+)") if itemID then - local item = Item:CreateFromID(itemID) - item:Query() + if Item then + local item = Item:CreateFromID(itemID) + item:Query() + else + TSMAPI:GetSafeItemInfo(tonumber(itemID)) + end end end diff --git a/TradeSkillMaster/GUI/BuildPage.lua b/TradeSkillMaster/GUI/BuildPage.lua index 8a38cfd..734d1fe 100644 --- a/TradeSkillMaster/GUI/BuildPage.lua +++ b/TradeSkillMaster/GUI/BuildPage.lua @@ -303,6 +303,7 @@ local Add = { else TSM:Print(L["Invalid custom price."].." "..err) self:SetFocus() + return end else args.callback(self, event, value) diff --git a/TradeSkillMaster/TradeSkillMaster.lua b/TradeSkillMaster/TradeSkillMaster.lua index 0dfb7bb..f321a6b 100644 --- a/TradeSkillMaster/TradeSkillMaster.lua +++ b/TradeSkillMaster/TradeSkillMaster.lua @@ -239,8 +239,12 @@ function TSM:OnInitialize() -- check if item is cached local _,_,itemID = itemString:find("item:(%d+)") if itemID then - local item = Item:CreateFromID(itemID) - item:Query() + if Item then + local item = Item:CreateFromID(itemID) + item:Query() + else + TSMAPI:GetSafeItemInfo(tonumber(itemID)) + end end if strfind(itemString, " ") then local newItemString = gsub(itemString, " ", "") diff --git a/TradeSkillMaster_Auctioning/modules/Util.lua b/TradeSkillMaster_Auctioning/modules/Util.lua index c8e1a34..06a803f 100644 --- a/TradeSkillMaster_Auctioning/modules/Util.lua +++ b/TradeSkillMaster_Auctioning/modules/Util.lua @@ -221,6 +221,29 @@ function Util:groupTree(grpInfo, src, all, ah) end if newgrp[itemString] < 0 then newgrp[itemString] = nil + else + -- Get the group's auction operation + local operations = TSMAPI:GetItemOperation(itemString, "Auctioning") + if operations and operations[1] then + local operation = TSM.operations[operations[1]] + if operation then + -- Get the prices + local prices = TSM.Util:GetItemPrices(operation, itemString) + local marketValue = TSMAPI:GetItemValue(itemString, "DBMarket") + local currentMinPrice = TSMAPI:GetItemValue(itemString, "DBMinBuyout") + + -- Compare the prices + if prices.minPrice and prices.maxPrice and prices.normalPrice then + if marketValue and currentMinPrice then + if prices.minPrice > currentMinPrice then + -- Handle the case where the prices do not meet the criteria + -- For example, you can remove the item from the group + newgrp[itemString] = nil + end + end + end + end + end end end end diff --git a/TradeSkillMaster_Crafting/Modules/Cost.lua b/TradeSkillMaster_Crafting/Modules/Cost.lua index f9d2246..c066906 100644 --- a/TradeSkillMaster_Crafting/Modules/Cost.lua +++ b/TradeSkillMaster_Crafting/Modules/Cost.lua @@ -110,11 +110,12 @@ function Cost:GetLowestCraftPrices(itemString, intermediate) if not spellIDs then return end local lowestCost, cheapestSpellID local soh = "item:76061:0:0:0:0:0:0" -- Spirit of Harmony + local fb = "item:800405:0:0:0:0:0:0" -- Fel Blood for _, spellID in ipairs(spellIDs) do if TSM.db.realm.crafts[spellID] then - if intermediate and (TSM.db.realm.crafts[spellID].mats[soh] or TSM.db.realm.crafts[spellID].hasCD) then + if intermediate and (TSM.db.realm.crafts[spellID].mats[soh] or TSM.db.realm.crafts[spellID].mats[fb] or TSM.db.realm.crafts[spellID].hasCD) then break - end --exclude spells using SOH or have cooldown from intermediate crafts + end --exclude spells using SOH and FB or have cooldown from intermediate crafts local cost = Cost:GetCraftCost(spellID) if cost and (not lowestCost or cost < lowestCost) then -- exclude spells with cooldown if option to ignore is enabled or more than one way to craft and not soulbound e.g. BoE @@ -144,4 +145,4 @@ function Cost:GetLowestCraftPrices(itemString, intermediate) end return cheapestSpellID, lowestCost, buyout, profit -end \ No newline at end of file +end diff --git a/TradeSkillMaster_Mailing/Modules/Inbox.lua b/TradeSkillMaster_Mailing/Modules/Inbox.lua index c64a132..321b29f 100644 --- a/TradeSkillMaster_Mailing/Modules/Inbox.lua +++ b/TradeSkillMaster_Mailing/Modules/Inbox.lua @@ -711,7 +711,7 @@ function Inbox:UI_ERROR_MESSAGE(event, msg) return end - TSMAPI:CreateTimeDelay("mailWaitDelay", 0.3, private.AutoLoot) + TSMAPI:CreateTimeDelay("mailWaitDelay", math.max(5/GetFramerate(), 0.3), private.AutoLoot) end end