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 


Need Cheat Engine to PROPERLY STOP ALL scripts on Attach!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Meiyoh
Master Cheater
Reputation: 1

Joined: 14 Mar 2015
Posts: 402

PostPosted: Sat Dec 23, 2017 1:28 am    Post subject: Need Cheat Engine to PROPERLY STOP ALL scripts on Attach! Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4699

PostPosted: Sat Dec 23, 2017 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Sat Dec 23, 2017 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Meiyoh
Master Cheater
Reputation: 1

Joined: 14 Mar 2015
Posts: 402

PostPosted: Sat Dec 23, 2017 2:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Sat Dec 23, 2017 3:19 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Meiyoh
Master Cheater
Reputation: 1

Joined: 14 Mar 2015
Posts: 402

PostPosted: Sun Dec 24, 2017 12:42 pm    Post subject: Reply with quote

Thanks my friend. I will remember this and use it.
_________________
I am the forgotten one the dead one.
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 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