Code: Select all
Val = 0
function CETrainer_CEToggleBox1Click(sender)
local timer = createTimer(getMainForm())
timer.Interval = 1000
timer.OnTimer = function(timer)
writeInteger("Castles.exe+311B0A", 120)
writeInteger("Catles.exe+311D0D", 120)
sleep(100)
writeInteger("Castles.exe+311B0A", 0)
writeInteger("Castles.exe+311D0D", 0)
end
if (Val == 0) then
DoneState = false
Val = 1
else
DoneState = true
Val = 0
end
if DoneState == true then
timer.destroy()
end
end
end
But when I toggle on the script the timer runs once, and then stops. I want it to run continuously until the button toggle is turned off. I don't make trainers very often, so any code help would be appreciated.