For those who use MSBT 5.4.78, you might have noticed that the item count is not displaying total count correctly. As an example, If I have 20 Relics of Ulduar, and if I loot 3, MSBT's "%t" will not show 23, but 26. To correct this, just go under MSBT folder (under Interface/Addons) and edit line 102 of MSBTLoot.lua :
local numTotal = numItems + numLooted
becomes local numTotal = numItems
For those who use MSBT 5.4.78, you might have noticed that the item count is not displaying total count correctly. As an example, If I have 20 Relics of Ulduar, and if I loot 3, MSBT's "%t" will not show 23, but 26. To correct this, just go under MSBT folder (under Interface/Addons) and edit line 102 of MSBTLoot.lua :
local numTotal = numItems + numLooted
becomes local numTotal = numItems
Hoping that this will benefit somebody.
if I may add, whenever you loot an item that doesn't exist in your inventory the numTotal is 0. to fix this issue I suggest an edit to the following lines
local numItems = GetItemCount(itemLink) or 1
local numTotal = numItems + numLooted
becomes
local iCount = GetItemCount(itemLink)
local numItems = iCount > 0 and iCount or numLooted
local numTotal = numItems
if I may add, whenever you loot an item that doesn't exist in your inventory the numTotal is 0. to fix this issue I suggest an edit to the following lines
local numItems = GetItemCount(itemLink) or 1
local numTotal = numItems + numLooted
becomes
local iCount = GetItemCount(itemLink)
local numItems = iCount > 0 and iCount or numLooted
local numTotal = numItems
Hey,
I had a problem with having multiple stacks of an item, it wasn't adding multiple stacks.
Here is my contribution :
-- Get the number of items already existing in inventory and add the amount
-- looted to it if the item wasn't the result of a conjure.
local numLooted = parserEvent.amount or 1
local numItems = GetItemCount(itemLink) or 0
local numTotal = numItems + numLooted
BECOMES
-- Get the total count of the item in the inventory before the loot.
local numLooted = parserEvent.amount or 1
local numItemsBefore = GetItemCount(itemLink, false, false) - numLooted
-- Make sure we don't show an incorrect total count.
if numItemsBefore < 0 then
numItemsBefore = 0
end
local numTotal = numItemsBefore + numLooted
My version of fixing the miscount for this addon is making the addon subtract 1 anytime you already have more than 1 item in the bag. My experience with the bug is that it only occured when you had an item already looted and looted more - the total count would be higher by +1.
MSBTLoot.lua lines 105-116 now become:
I only edited 2 lines, but posting the whole function is easier to read.
local eventSettings = MSBTProfiles.currentProfile.events.NOTIFICATION_LO OT
if (eventSettings and not eventSettings.disabled) then
local message = eventSettings.message
message = string_gsub(message, "%%e", itemName)
message = string_gsub(message, "%%a", numLooted)
if numTotal > 1 then
message = string_gsub(message, "%%t", numTotal - 1)
end
message = string_gsub(message, "%%t", numTotal)
DisplayEvent(eventSettings, message, itemTexture)
end
end
Edited: April 17, 2025
Reason: Remove quoted text/images to make post shorter