Hello, how is everything ? I'm new to the Scripting business. Recently I've been writing new scripts on OTserves. But something I think is super cool is the HUD that analyzes what we take, how much we take, how much we gain or lose. However I am having problems adding the ItemID of the object or setItem Size. If anyone can help me, I am too grateful.

PHP Code:
HUDPing HUD.New(2010"Ping:"titleColor.rtitleColor.gtitleColor.b)
HUD.New(7030"BrutaMinaHUD 0.2"HUDColor.rHUDColor.gHUDColor.b)

HUDLootList HUD.New(1050"Loot List:"titleColor.rtitleColor.gtitleColor.b)
HUDSuppliesList HUD.New(1090"Supplies List:"titleColor.rtitleColor.gtitleColor.b)
HUD.img HUD.New (05140""itemColor.ritemColor.gitemColor.b)

HUDEarned HUD.New(1070"Earned:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)
HUDWasted HUD.New(10110"Spent:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)
HUDProfit HUD.New(10150"Profit:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)


HUDExp HUD.New(10170"Experience:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)
HUDTime HUD.New(10190"Time:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)
HUDStamina HUD.New(10210"Stamina:"itemTotalColor.ritemTotalColor.gitemTotalColor.b)

offset 0
offset2 
0

Experience 
HUD.New(140170""countTotalColor.rcountTotalColor.gcountTotalColor.b)
Timer HUD.New(140190""countTotalColor.rcountTotalColor.gcountTotalColor.b)
Stamina HUD.New(140210""countTotalColor.rcountTotalColor.gcountTotalColor.b)
Ping HUD.New(5010""countTotalColor.rcountTotalColor.gcountTotalColor.b)
 
TotalLoot HUD.New(14070""countTotalColor.rcountTotalColor.gcountTotalColor.b)
TotalSupplies HUD.New(140110""countTotalColor.rcountTotalColor.gcountTotalColor.b)
TotalProfit HUD.New(140150""countTotalColor.rcountTotalColor.gcountTotalColor.b)

HUDSupplies = {}
HUDSuppliesNames = {}
HUDLoot = {}

SessionStart os.time()
ExperienceStart Self.Experience()

DepotIDs = {3497349834993500}
LootNumbers = {}
SuppliesNumbers = {}


-- 
Remake to read loot list from backpacks ?
-- 
Container:GetItemData(spot)
-- function 
Container:ItemCount()

--
LootIDs = {}
--
SuppliesIDs = {}

--[[
local containers Container.GetAll()
for 
j=#containers do
    
local c Container.New(containers[j])
    
local ContainerName string.gmatch(c:Name(), "%S+")
    
local IsContainer false
    
for k in ContainerName do
        if 
== "Backpack" or == "Bag" then
            IsContainer 
true
        end
    end
    
if IsContainer then
        
if ~= 1 then
            local itemsNumber 
c:ItemCount()
            print(
itemsNumber)
            for 
i=0itemsNumber do
                
local item c:GetItemData(i)
                --print(
item.id)
                
local isNextBackpack false
                local itemName 
string.gmatch(Item.GetName(item.id), "%S+")
                print(
Item.GetName(item.id))
                
local notBackpack true
                
for k in itemName do
                    if 
== "Backpack" or == "Bag" then
                        notBackpack 
false
                    end
                end
                
if (not table.contains(LootNumbersitem.id)) and notBackpack then
                    table
.insert(LootNumbersitem.id)
                    --print(
"x")
                    
LootIDs[item.id] = { id item.idvamount c:CountItemsOfID(item.id), samount 0}
                    --print(
"x2")
                    
HUDLoot[item.id] = HUD.New(140250+(#LootIDs * 15)+50, item.id.." (".."x"..")", R2, G2, B2)
                    
--HUDLoot[item.id] = HUD.New(140250"x"R2G2B2)
                    print(
item.id)
                else
                    --
HUDLoot[item.id]:SetText(c:CountItemsOfID(item.id).." lol")
                
end
            end
        end
    end
end
]]--

io.input("..\\Settings\\"..fileName..".xbst")
LootIDs = {}
SuppliesIDs = {}

local suppliesLines = {}
local lootLines = {}
for 
line in io.lines() do
    if 
string.find(line:lower(), "action="then
        table
.insert(lootLinesline:lower())
    elseif 
string.find(line:lower(), "item id="then
        table
.insert(suppliesLinesline:lower())
    
end
end

local numbers 
= {}
for 
i=1#lootLines do
    
table.insert(numbersstring.match(lootLines[i], "%d+"))
end

for i=1#numbers do
    
--if tonumber(numbers[i]) ~= 3031 then
    LootIDs
[#LootIDs + 1] = { id = tonumber(numbers[i]), vamount = 0, samount = 0, hud = false}
    
--end
end

local numbersSupplies 
= {16141}
for 
i=1#suppliesLines do
    
table.insert(numbersSuppliesstring.match(suppliesLines[i], "%d+"))
end

for i=1#numbersSupplies do
    
SuppliesIDs[#SuppliesIDs + 1] = { id = tonumber(numbersSupplies[i]), vamount = 0, samount = 0, mamount = 0, uamount = 0, hud = false}
end

-- Maybe -- add start values = -and if -1 then do first check for all items amount to not count those looted before hud started

local Wasted 
0
local Looted 
0

local HUDsL 
0
HUD
.CountLoot = function(c)
    
local LootPrice 0
    
for i=1#LootIDs do
        
local TempAmount 0
        local containers 
Container.GetAll()
        for 
j=#containers do
            
local c Container.New(containers[j])
            
local ContainerName string.gmatch(c:Name(), "%S+")
            
local IsContainer false
            
for k in ContainerName do
                if 
== "Backpack" or == "Bag" or == "Box" or == "box" then
                    IsContainer 
true
                end
            end
            
if IsContainer then
                
if ~= 1 then
                    TempAmount 
TempAmount c:CountItemsOfID(LootIDs[i].id)
                
end
            end
        end
        
if TempAmount LootIDs[i].vamount then -- Next Backpack
            LootIDs
[i].samount LootIDs[i].samount LootIDs[i].vamount
            LootIDs
[i].vamount TempAmount
        
else
            
LootIDs[i].vamount TempAmount
        end
        local TempPrice 
LootIDs[i].samount LootIDs[i].vamount
        
if LootIDs[i].hud then
            HUDLoot
[LootIDs[i].id]:SetText(TempPrice.." ("..(TempPrice ItemValue(LootIDs[i].id)).." gp)")
        elseif 
LootIDs[i].vamount and not LootIDs[i].hud then
            offset 
offset 15
            HUDsL 
HUDsL 1
            LootIDs
[i].hud true
            HUD
.New(2050+(HUDsL 15), string.sub(Item.GetName(LootIDs[i].id), 115), itemColor.ritemColor.gitemColor.b)
            
HUDLoot[LootIDs[i].id] = HUD.New(12050+(HUDsL 15), "0"countColor.rcountColor.gcountColor.b)
            
HUD.img HUD.New (1050+(HUDsL 15), ""itemColor.ritemColor.gitemColor.b)
            
HUD.img:SetItemSize(05)
            
            
HUD.ChangePosition()
        
end

        LootPrice 
LootPrice + (LootIDs[i].samount LootIDs[i].vamount) * ItemValue(LootIDs[i].id)
    
end
    Looted 
LootPrice
    TotalLoot
:SetText(LootPrice .. " gp")
end

local HUDsS 
0
HUD
.CountWaste = function(c)
    
local SuppliesWasted 0
    
for i=1#SuppliesIDs do
        
local TempAmount Self.ItemCount(SuppliesIDs[i].id)
        if 
TempAmount SuppliesIDs[i].vamount then -- Refilled -- !! ONLY IF CLOSE TO NPC OR IN DEPO !!
            
SuppliesIDs[i].samount SuppliesIDs[i].samount SuppliesIDs[i].uamount
            SuppliesIDs
[i].mamount TempAmount
            SuppliesIDs
[i].vamount TempAmount
        
else -- Supply used
            SuppliesIDs
[i].vamount TempAmount
            SuppliesIDs
[i].uamount SuppliesIDs[i].mamount TempAmount
        end
        local TempPrice 
SuppliesIDs[i].samount SuppliesIDs[i].uamount
        
if SuppliesIDs[i].hud then
            HUDSupplies
[SuppliesIDs[i].id]:SetText(TempPrice.." ("..(TempPrice ItemPrice(SuppliesIDs[i].id)).." gp)")
        elseif 
SuppliesIDs[i].uamount and not SuppliesIDs[i].hud then
            offset2 
offset2 15
            HUDsS 
HUDsS 1
            SuppliesIDs
[i].hud true
            HUDSuppliesNames
[SuppliesIDs[i].id] = HUD.New(20110+(HUDsS 15), string.sub(Item.GetName(SuppliesIDs[i].id), 115), itemColor.ritemColor.gitemColor.b)
            
HUDSupplies[SuppliesIDs[i].id] = HUD.New(120110+(HUDsS 15), "0"countColor.rcountColor.gcountColor.b)
            
HUD.img HUD.New (10110+(HUDsS 15), ""itemColor.ritemColor.gitemColor.b)
            
HUD.img:SetItemSize(10)
            
            
HUD.ChangePosition()
        
end
        SuppliesWasted 
SuppliesWasted + (SuppliesIDs[i].samount SuppliesIDs[i].uamount) * ItemPrice(SuppliesIDs[i].id)
    
end
    Wasted 
SuppliesWasted
    TotalSupplies
:SetText(SuppliesWasted .. " gp")
end

HUD
.ChangePosition = function()
    
local countTrues 0
    
for i=1#SuppliesIDs do
        
if SuppliesIDs[i].hud then
            HUDSuppliesNames
[SuppliesIDs[i].id]:SetPosition(20110 + (countTrues 15) + offset)
            
HUDSupplies[SuppliesIDs[i].id]:SetPosition(120110 + (countTrues 15) + offset)
            
countTrues countTrues 1
        end
    end
    HUDSuppliesList
:SetPosition(1090 offset)
    
HUDExp:SetPosition(10170 offset offset2)
    
HUDTime:SetPosition(10190 offset offset2)
    
HUDStamina:SetPosition(10210 offset offset2)
    
Experience:SetPosition(110170 offset offset2)
    
Timer:SetPosition(110190 offset offset2)
    
Stamina:SetPosition(110210 offset offset2)
    
HUDEarned:SetPosition(1070 offset)
    
TotalLoot:SetPosition(11070 offset)
    
HUDWasted:SetPosition(10110 offset offset2)
    
TotalSupplies:SetPosition(110110 offset offset2)
    
HUDProfit:SetPosition(10150 offset offset2)
    
TotalProfit:SetPosition(110150 offset offset2)
end

local HUDUpdateStart 
true
Module
.New('HUD-Update', function(module)
    if 
HUDUpdateStart then
        
-- Timer
        local TimeDifference 
os.difftime(os.time(), SessionStart)
        
string.format("%02.f"math.floor(TimeDifference/3600));
        
string.format("%02.f"math.floor(TimeDifference/60 - (h*60)));
        
Timer:SetText(h.."h "..m.."m")
        -- 
Ping
        Ping
:SetText(Self.Ping() .. " ms")
        if 
Self.Ping() >= 120 then
                Ping
:SetTextColor(255400)
            elseif 
Self.Ping() <= 120 then
                Ping
:SetTextColor(255255255)
        
end     
        
-- Stamina
        _G
['refreshHUD'] = Module.New("refreshHUD", function(module)
            
stam math.floor(Self.Stamina()/60)
            
stam2 math.floor(((Self.Stamina()/60-stam)*60))
            
Stamina:SetText(stam.."h "..stam2.."m")
            if 
Self.Stamina() <= 2400 then
                Stamina
:SetTextColor(21010530)
            elseif 
Self.Stamina() <= 840 then
                Stamina
:SetTextColor(25500)
            
end
        end
)
        -- 
Check NPC
        local noNPC 
true
        local spectators 
Self.GetSpectators()
        for 
_cid in ipairs(spectators) do
            if 
cid:isNpc() then
                noNPC 
false
                
break
            
end
        end

        
-- Count
        local DepotPos 
= {}
        for 
1#DepotIDs do
            
local dps Map.GetUseItems(DepotIDs[i])
            for 
1#dps do
                
table.insert(DepotPosdps[j])
            
end
        end
        local MainC 
Container.GetFirst()
        if 
tostring(#DepotPos) == '0' and MainC:isOpen() and noNPC then
            
HUD.CountLoot() -- Count Loot
            HUD
.CountWaste() -- Count Waste
        end
        
        
-- Experience
        Experience
:SetText(Self.Experience() - ExperienceStart)
        
        -- 
Profit
        local Profit 
Looted Wasted
        
if Profit 0 then
            HUDProfit
:SetText("Loss:")
            
Profit math.abs(Profit)
        else
            
HUDProfit:SetText("Profit:")
        
end
        TotalProfit
:SetText(Profit  .. " gp" .. " (" .. (math.floor(Profit / (TimeDifference/3600))) .. " gp/h)")
        
        
module:Delay(1000)
    
end
end