Posted: Tue Mar 31, 2020 9:19 pm Post subject: How can I run +1 only once?
How can I run +1 only once? Example: the condition is met, but does not stop increasing the value by 1 when the condition is met. I only need to raise it once. What do I do?
Code:
{$lua}
[Enable]
function hpteste()
if readInteger("NeoRAGEx 5.0.exe+167CF8") == 6488085 then
writeInteger("NeoRAGEx 5.0.exe+167DC0",
readInteger("NeoRAGEx 5.0.exe+167DC0")+1)
end
end
if hpt then hpt.destroy(); hpt=nil end
hpt = createTimer()
hpt.interval = 1
hpt.ontimer = hpteste
function hpteste(timer)
if readInteger("NeoRAGEx 5.0.exe+167CF8") == 6488085 then
writeInteger("NeoRAGEx 5.0.exe+167DC0",
readInteger("NeoRAGEx 5.0.exe+167DC0")+1)
timer.Enabled = false
end
end
_________________
I don't know where I'm going, but I'll figure it out when I get there.
It worked, but only once. is it possible to do this whenever the value is == 6488085 always repeat that +1? example: when the value is == 6488085, it increases to +1 only once. I need it to actually increase once, but always increase once when the value is == 6488085
only +1 every == 6488085
If you can help me, I appreciate it. _________________
local oldValue = readInteger("NeoRAGEx 5.0.exe+167CF8")
function hpteste(timer)
local newValue = readInteger("NeoRAGEx 5.0.exe+167CF8")
if newValue == 6488085 and newValue ~= oldValue then
writeInteger("NeoRAGEx 5.0.exe+167DC0",
readInteger("NeoRAGEx 5.0.exe+167DC0")+1)
end
oldValue = newValue
end
_________________
I don't know where I'm going, but I'll figure it out when I get there.
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