Function works fine, variables read and write normally. Tested with print() and in game.
t_maxStack.destroy()
line placed anywhere above '[DISABLE]' will allow script to save with no error.Tried moving lua tag after enable and the asm tag just before disable with a separate lua tag in the disable followed by destroy line and get same error.
Code provided below. playerBase is a registered symbol set by another script.
Code: Select all
{$STRICT}
{$lua}
[ENABLE]
if syntaxcheck then return end
-- Function --
setItemMax = function()
local addrItem1 = '[[[["playerBase"+18]+30]+8]+8]+B8'
local addrItem1Max = '[[[[[["playerBase"+18]+30]+8]+8]+B0]+8]+80'
local numItem1 = readPointer(addrItem1)
local numItem1Max = readInteger(addrItem1Max)
if numItem1 == 0 then return else writeInteger(addrItem1,numItem1Max) end
end
-- Timer --
t_maxStack = createTimer()
t_maxStack.Interval(100)
t_maxStack.OnTimer = setItemMax()
[DISABLE]
t_maxStack.destroy()