add item count support for inbag/noinbag conditional, fix macro frame whitelist and error log on macro frame

This commit is contained in:
Jrc13245
2026-03-21 12:03:46 -04:00
parent 0e6371692e
commit 5bb8ebe9b7
3 changed files with 19 additions and 4 deletions
+2 -1
View File
@@ -687,12 +687,13 @@ function CleveRoids.GetLiveItemCount(itemName)
-- Escape Lua pattern special chars in item name to avoid crashes
local escaped = string.gsub(itemName, "([%(%)%.%%%+%-%*%?%[%]%^%$])", "%%%1")
local pattern = "%[" .. escaped .. "%]"
local lowerPattern = string.lower(pattern)
local total = 0
for bag = 0, 4 do
local slots = GetContainerNumSlots(bag) or 0
for slot = 1, slots do
local link = GetContainerItemLink and GetContainerItemLink(bag, slot)
if link and string.find(link, pattern) then
if link and string.find(string.lower(link), lowerPattern) then
local _, count = GetContainerItemInfo(bag, slot)
total = total + (count or 0)
end