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 


I want Lua Scripting Check Status Game (Check Process Game)

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

Joined: 17 Jul 2015
Posts: 2

PostPosted: Fri Jun 02, 2017 10:45 pm    Post subject: I want Lua Scripting Check Status Game (Check Process Game) Reply with quote

Ex.
Open Game = (Lable CE Status): YES
No Find Game = (Lable CE Status): NO

_________________
*-*
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sat Jun 03, 2017 11:31 am    Post subject: Reply with quote

That's fairly basic if you just need to check that the process exists and set a label here's one way

Code:

-- set default caption assuming it won't be found
CETrainer.CELabel1.Caption = "Did not find 'whatever.exe' Process"
local pl = getProcessList()
for pid, name in pairs(pl) do
  -- if found then set the caption
  if name == "whatever.exe" then
    CETrainer.CELabel1.Caption = "Found 'whatever.exe' process"
    break -- stop looking/looping
  end
end


here's an example ct that sets two labels based on looking for "nonexistent.exe" and "System".
https://www.dropbox.com/s/n957fbmwgkh7ncu/label%20based%20on%20process%20existing.CT?dl=0

Of course if you want it to be updated constantly then you'd need a timer to recheck it... though you could also just modify the default code that uses the autoattach list so that when it finds the process and attaches to it you change the label from saying "... waiting for <whatever.exe>" to "Ready!" or something. Should be as simple as
Code:

CETrainer.CELabel1.Caption = "... waiting for process"
function onOpenProcess(processid)
  --call reinitializeSymbolhandler() to force the open to complete
  reinitializeSymbolhandler()
  CETrainer.CELabel1.Caption = "Ready!"
end


Though that won't update if you close the game and I don't think there's a simple "onProcessClosed" function that you can create either...
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