Posted: Tue Feb 14, 2023 11:15 am Post subject: Error when setting interval
Code:
local function TriggerBot()
if readInteger("agame.exe+61B82C") == 2 then
mouse_event(MOUSEEVENTF_LEFTDOWN, nil, nil, nil, nil)
mouse_event(MOUSEEVENTF_LEFTUP, nil, nil, nil, nil)
end
end
someTimer = createTimer()
someTimer.Interval = 100
someTimer.OnTimer = timer_tick
the line
Code:
someTimer.Interval = 100
gives me the error
Quote:
Error:[string "local function TriggerBot()..."]:8: attempt to index global 'someTimer' (a nil value)
and i searched for the error and didnt find any solution.
If a global (local) or "nil" is set within the same CE window, clearing the lua window will not ignore these locales and will still work.
Turn the CE off and then back on to try the code. So the previous assigned locals won't bother you.
Code:
local function TriggerBot()
if readInteger("agame.exe+61B82C") == 2 then
mouse_event(MOUSEEVENTF_LEFTDOWN, nil, nil, nil, nil)
mouse_event(MOUSEEVENTF_LEFTUP, nil, nil, nil, nil)
end
end
if someTimer then someTimer.Destroy() someTimer=nil end
someTimer = createTimer()
someTimer.Interval = 100
someTimer.OnTimer = timer_tick
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum