| View previous topic :: View next topic |
| Author |
Message |
Tom837 How do I cheat?
Reputation: 0
Joined: 25 Apr 2014 Posts: 6
|
Posted: Sat Apr 26, 2014 1:47 pm Post subject: Possible to Autorun Lua Script? |
|
|
Hi
Is it possible to run a Lua Script automatically when i attach a Process with Cheat Engine without clicking the "Execute script" Button?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25839 Location: The netherlands
|
Posted: Sat Apr 26, 2014 2:09 pm Post subject: |
|
|
yes, place the lua scriopt in the autorun folder and in there hook (redefine)
| Code: |
function onOpenProcess(processid)
|
in there you can do specific things to the newly opened process.
in 6.3 I recommend creating a timer, which executes a new function on process open. That way the code will run in the main thread. (which is required for gui access)
_________________
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 |
|
 |
Tom837 How do I cheat?
Reputation: 0
Joined: 25 Apr 2014 Posts: 6
|
Posted: Sat Apr 26, 2014 3:20 pm Post subject: |
|
|
| Dark Byte wrote: | yes, place the lua scriopt in the autorun folder and in there hook (redefine)
| Code: |
function onOpenProcess(processid)
|
in there you can do specific things to the newly opened process.
in 6.3 I recommend creating a timer, which executes a new function on process open. That way the code will run in the main thread. (which is required for gui access) |
Thank you for the fast replay.
I tryed this Method:
| Code: | function onOpenProcess(processid)
debugProcess(2)
end |
I wanna attach the Debugger at openprocess but Cheat Engine is crashing.
Like you said i have probably to add a Timer for that but unfortunately i dont rly know how exactly i should do this.
I would apprecciate a Code Sample.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25839 Location: The netherlands
|
Posted: Sat Apr 26, 2014 3:55 pm Post subject: |
|
|
something like this:
| Code: |
function dostuff(sender)
sender.destroy()
debugProcess(2)
end
originalOnOpenProcess=onOpenProcess;
function onOpenProcess(processid)
t=createTimer(nil)
t.OnTimer=dostuff
t.Interval=1
t.Enabled=true
if originalOnOpenProcess~=nil then
originalOnOpenProcess(processid)
end
end
|
_________________
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 |
|
 |
Tom837 How do I cheat?
Reputation: 0
Joined: 25 Apr 2014 Posts: 6
|
Posted: Sat Apr 26, 2014 5:32 pm Post subject: |
|
|
| Thank you very much Dark Byte, your sample works perfect.
|
|
| Back to top |
|
 |
|