Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How can I run +1 only once?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
davixk3
How do I cheat?
Reputation: 0

Joined: 31 Mar 2020
Posts: 7
Location: Brasil

PostPosted: Tue Mar 31, 2020 9:19 pm    Post subject: How can I run +1 only once? Reply with quote

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


[Disable]
if hpt then hpt.destroy(); hpt=nil end
[/quote]
_________________
Zero creative.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Tue Mar 31, 2020 10:37 pm    Post subject: Reply with quote

Code:
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.
Back to top
View user's profile Send private message
davixk3
How do I cheat?
Reputation: 0

Joined: 31 Mar 2020
Posts: 7
Location: Brasil

PostPosted: Wed Apr 01, 2020 12:37 am    Post subject: Reply with quote

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.

_________________
Zero creative.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Wed Apr 01, 2020 9:52 am    Post subject: Reply with quote

Code:
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.
Back to top
View user's profile Send private message
davixk3
How do I cheat?
Reputation: 0

Joined: 31 Mar 2020
Posts: 7
Location: Brasil

PostPosted: Wed Apr 01, 2020 3:15 pm    Post subject: Reply with quote

It worked! Thank you very much helped me a lot.
_________________
Zero creative.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites