View previous topic :: View next topic |
Author |
Message |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
Posted: Sat Dec 23, 2017 1:28 am Post subject: Need Cheat Engine to PROPERLY STOP ALL scripts on Attach! |
|
|
This must be fixed. If I use LUA and game crashes when I attach old scripts still run and cause issues like freezes or brake EVERYTHING. This is only fixable by Closing CE and opening again. Anyway this to be fixed without having to CLOSE open CE This is really annoying bug.
_________________
I am the forgotten one the dead one. |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4699
|
Posted: Sat Dec 23, 2017 9:54 am Post subject: |
|
|
That's your problem. There are circumstances where Lua code should be running regardless of what process CE is attached to. If you want something to stop when you attach CE to another process, you can use onOpenProcess among other things.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Sat Dec 23, 2017 11:37 am Post subject: |
|
|
best just let your timer check the currently opened processid and check if it has changed, if so just destroy the timer and exit
this can not be done automatically for you as stated by ParkourPenguin, some scripts you may want to keep running (e.g gui) and some scripts really should not execute their disable code on exitn as that writes wrong data.
it's up to the script writer to handle that situation
_________________
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 |
|
 |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
Posted: Sat Dec 23, 2017 2:21 pm Post subject: |
|
|
Ok lets say I am runnig a "GAMEPROCESS1.EXE"
How to make condition for lua script to stop work if proccess is NOT attached or changed?
(EG CRASHES, CLOSED OR Cheat Engine Attached to another process)
_________________
I am the forgotten one the dead one. |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Sat Dec 23, 2017 3:19 pm Post subject: |
|
|
something like this:
Code: |
attachedpid=0
function checkIfStillAttached()
local currentpid=getOpenedProcessID()
local result=true
if (attachedpid ~= 0) and (attachedpid~=currentpid) then
--destroy all known timers and threads (you need to fill this in yourself)
result=false
end
attachedpid=currentpid
return result
end
function everytimeryouhave(t)
if (checkIfStillAttached()==false) then return end --no need to destroy t as
--your normal timer code
end
|
in every timer first call checkIfStillAttached() and if that returns false then exit.
make sure you keep track of all the timers you have created (and check if they still exist by making them nil when not needed anymore) and destroy them in the checkIfStillAttached function
_________________
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 |
|
 |
Meiyoh Master Cheater
Reputation: 1
Joined: 14 Mar 2015 Posts: 402
|
Posted: Sun Dec 24, 2017 12:42 pm Post subject: |
|
|
Thanks my friend. I will remember this and use it.
_________________
I am the forgotten one the dead one. |
|
Back to top |
|
 |
|