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 


Sound Alerts - need help

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

Joined: 29 Apr 2016
Posts: 1

PostPosted: Fri Apr 29, 2016 9:48 am    Post subject: Sound Alerts - need help Reply with quote

So I want a message box, a warning sound is more preferred, to pop up when my health decreases to a certain level, for example 20 or lower. I found the address with cheat engine, now how can i associate this address to a script, by getting the value from the specified adress check if the value is below 20, and if it is, the computer will beep. Any help with this, preferibally a written code, i tried to do it i have very basic coding skills and I wasn't capable. Any help apreiciated. Please give instructions on how to write this if you can Smile Very Happy
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4300

PostPosted: Fri Apr 29, 2016 6:44 pm    Post subject: Reply with quote

Code:
createTimer().OnTimer = function(timer)
  if readInteger(0x003E0000) < 20 then beep() end
end

If you don't want it to continuously beep, declare a boolean within the scope of the timer and use that in the if statement. For example, set it to false when you play the beep sound and set it to true when your health is above 20.

For testing purposes, I'd recommend assigning the table returned by the function createTimer to some global variable so you can enable/disable/destroy it at will.

If you want to also display a message box, look into the messageDialog function in main.lua.

_________________
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
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