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 


[HELP] Open Process By PID

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

Joined: 27 Oct 2015
Posts: 59

PostPosted: Wed Jun 09, 2021 9:07 am    Post subject: [HELP] Open Process By PID Reply with quote

Hello everybody, I'm going to reopen a thread where I didn't really get my answer. I have a game where I need to open Multiple Instance's of.

Example:
Game.exe [PID]
Game.exe [PID]
Game.exe [PID]
Game.exe [PID]

Since the trainer will not be able to tell which game to attach to I would love to be able to attach to the process by PID.

I had a couple ideas I can shoot the way I would like to maybe have it or whichever way is the most simple.

The better route - I would love to have this if possible, if not the easier route would do just fine
Method 1: Using "CEListView1" List all processes with the name of "Game.exe" with the "PID" next to it so this way I do not have to open task manager to
determine which PID I would like to connect to, And finally have a button to attach.

Easier route
Method 2: Have a textbox to enter the PID, A button for attaching


Would somebody be able to kindly help me with this? I would really appreciate it!



PS: I searched around and came along this thread here, but it didn't really answer what I need.

https://www.cheatengine.org/forum/viewtopic.php?t=612970&start=0&postdays=0&postorder=asc&highlight=&sid=7c055f9d0c014efd42a04bcbcc3135cd
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Jun 09, 2021 2:12 pm    Post subject: Reply with quote

Cheat Engine's Lua has a call to attach to a process id:
Code:

openProcess(processid) : causes cheat engine to open the given processed

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ZxPwds
Advanced Cheater
Reputation: 0

Joined: 27 Oct 2015
Posts: 59

PostPosted: Wed Jun 09, 2021 5:13 pm    Post subject: Reply with quote

atom0s wrote:
Cheat Engine's Lua has a call to attach to a process id:
Code:

openProcess(processid) : causes cheat engine to open the given processed


so your saying that this should connect to the PID 2130?

Code:
function Form1_CEButton1Click(sender)
openProcess("2130")
end



I tried it didn't work.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Jun 09, 2021 5:35 pm    Post subject: Reply with quote

Just pass the number, not as a string.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ZxPwds
Advanced Cheater
Reputation: 0

Joined: 27 Oct 2015
Posts: 59

PostPosted: Thu Jun 10, 2021 7:57 am    Post subject: Reply with quote

atom0s wrote:
Just pass the number, not as a string.

thank you, Can I put a CETextBox in the () ?

because it's not working.



Code:
function Form1_btnAttachPIDClick(sender)
openProcess(txtEnterPID.text)
end


i tried

Code:
function Form1_btnAttachPIDClick(sender)
openProcess(txtEnterPID) -- without the .text
end


And if this is correct, Can you please help me make an indicator of it being connected?
Sorry I'm not very good at lua.
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Thu Jun 10, 2021 9:36 am    Post subject: Reply with quote

Code:
openProcess(tonumber(txtEnterPID.text))

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
ZxPwds
Advanced Cheater
Reputation: 0

Joined: 27 Oct 2015
Posts: 59

PostPosted: Thu Jun 10, 2021 10:01 am    Post subject: Reply with quote

DaSpamer wrote:
Code:
openProcess(tonumber(txtEnterPID.text))


not sure why getting this error

Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Jun 10, 2021 10:29 am    Post subject: Reply with quote

PowerlevelBox.txtEnterPID.text
_________________
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
ZxPwds
Advanced Cheater
Reputation: 0

Joined: 27 Oct 2015
Posts: 59

PostPosted: Thu Jun 10, 2021 3:48 pm    Post subject: Reply with quote

Dark Byte wrote:
PowerlevelBox.txtEnterPID.text


Once again thank you DarkByte. That worked perfectly.
This just made my life 10x easier.

is it possible to open a process list like this?
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Thu Jun 10, 2021 4:35 pm    Post subject: Reply with quote

https://forum.cheatengine.org/viewtopic.php?p=5480782
_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
ZxPwds
Advanced Cheater
Reputation: 0

Joined: 27 Oct 2015
Posts: 59

PostPosted: Thu Jun 10, 2021 5:36 pm    Post subject: Reply with quote

DaSpamer wrote:
https://forum.cheatengine.org/viewtopic.php?p=5480782


Perfect thank you guys
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