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 


Lua AutoAttach Question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
The0neThe0nly
Expert Cheater
Reputation: 0

Joined: 08 Dec 2009
Posts: 119
Location: In a box

PostPosted: Thu Dec 27, 2012 1:56 pm    Post subject: Lua AutoAttach Question Reply with quote

I want to make a trainer that automatically pauses the process when it is attached.

How do I do this in Lua?
Back to top
View user's profile Send private message
Phenax
Newbie cheater
Reputation: 0

Joined: 29 Mar 2009
Posts: 16

PostPosted: Thu Dec 27, 2012 2:41 pm    Post subject: Reply with quote

Maybe

Code:

stringlist_add(getAutoAttachList(), 'process.exe')

function onOpenProcess(processid)
   pause()
end
Back to top
View user's profile Send private message
The0neThe0nly
Expert Cheater
Reputation: 0

Joined: 08 Dec 2009
Posts: 119
Location: In a box

PostPosted: Thu Dec 27, 2012 6:11 pm    Post subject: Reply with quote

Phenax wrote:
Maybe

Code:

stringlist_add(getAutoAttachList(), 'process.exe')

function onOpenProcess(processid)
   pause()
end


I actually missed onOpenProcess when I was looking through main.lua

But, the processid constantly changes.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 199

Joined: 25 Jan 2006
Posts: 8518
Location: 127.0.0.1

PostPosted: Fri Dec 28, 2012 8:30 am    Post subject: Reply with quote

onOpenProcess is a callback handler. You do not call it yourself. CE invokes it when it attaches to a process which allows you to handle things in the script as soon as attaching has happened.

With the example that Phenax posted, just change 'process.exe' to the name of your target process. Then when your trainer attaches to the game automatically, it will call onOpenProcess itself.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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