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 


Can a lua script automatically run when a value changes?

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

Joined: 29 Nov 2021
Posts: 2

PostPosted: Mon Nov 29, 2021 7:53 pm    Post subject: Can a lua script automatically run when a value changes? Reply with quote

What im interested in is in a lua script that's changing a value from a address, that value is by default changing all the time.
When it reaches a certain float number, the script should be able to automatically detect and reverse its value to its original state, or just to a number.

That's about it. Is this scenario possible in CE?

Freezing a value is not always a option, so I need to somehow have a automatic process for that.

Thanks & cheers.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 421

Joined: 09 May 2003
Posts: 24034
Location: The netherlands

PostPosted: Tue Nov 30, 2021 12:14 am    Post subject: Reply with quote

'easiest' is freeze the record and then change the value to
Code:

[value > 100 and value or 1]


this example will allow the value to change until it reaches 100 and then changes it to 1


---
alternatively use a timer or a codeinjection at the spot that changes the value

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
BlackNoxis
How do I cheat?
Reputation: 0

Joined: 29 Nov 2021
Posts: 2

PostPosted: Tue Nov 30, 2021 12:56 pm    Post subject: Reply with quote

Apparently the application hates freezing and instantly dies.

But it's alright, timer worked!
The examples from the wiki Lua:Class:Timer are all that I needed. Should've looked earlier Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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