helpers: add GetItemIDFromLink function

This commit is contained in:
DBFBlackbull
2025-08-02 16:56:20 +02:00
committed by GitHub
parent 8311f4551f
commit 4e82892261
3 changed files with 25 additions and 9 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
local _G = ShaguTweaks.GetGlobalEnv()
local T = ShaguTweaks.T
local GetItemIDFromLink = ShaguTweaks.GetItemIDFromLink
local module = ShaguTweaks:register({
title = T["Sell Junk"],
@@ -85,8 +86,8 @@ module.enable = function(self)
-- get value
local _, icount = GetContainerItemInfo(bag, slot)
local _, _, id = string.find(GetContainerItemLink(bag, slot), "item:(%d+):%d+:%d+:%d+")
local price = ShaguTweaks.SellValueDB[tonumber(id)] or 0
local itemID = GetItemIDFromLink(GetContainerItemLink(bag, slot))
local price = ShaguTweaks.SellValueDB[itemID] or 0
if this.price then
this.price = this.price + ( price * ( icount or 1 ) )
this.count = this.count + 1