Couple of fixes and a new feature for bank/GB (#25)
* Exclude crafting spells using Fel Blood Updated cost calculation to exclude spells using Fel Blood in crafting. * Epoch lua error fix * Slow mail loot when low FPS to avoid double looting * Allowing withdrawing items from bank/GB using "AH shortfall" to withdraw based on post cap and now ALSO minPrice of those items has to be above current DBMinBuyout. * Fixing an infinite loop bug with invalid custom price of Default Craft Value Method --------- Co-authored-by: Szyler <Szyler@Szyler.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -303,6 +303,7 @@ local Add = {
|
||||
else
|
||||
TSM:Print(L["Invalid custom price."].." "..err)
|
||||
self:SetFocus()
|
||||
return
|
||||
end
|
||||
else
|
||||
args.callback(self, event, value)
|
||||
|
||||
@@ -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, " ", "")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user