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 


how to attach samenameprocess by PID or max MEMused ?

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

Joined: 09 Mar 2012
Posts: 70

PostPosted: Thu Dec 26, 2019 1:57 am    Post subject: how to attach samenameprocess by PID or max MEMused ? Reply with quote

this is a game when i run exe,there are 5 samename process in task list.
how to attach samenameprocess by PID or max MEM used in ce ?


this code can not work corret because there are 5 samename game.exe process in task list
==============
getAutoAttachList().add("game.exe")
==============



2019-12-26_155447.jpg
 Description:
 Filesize:  7.56 KB
 Viewed:  2618 Time(s)

2019-12-26_155447.jpg



2019-12-26_154731.jpg
 Description:
 Filesize:  114.09 KB
 Viewed:  2618 Time(s)

2019-12-26_154731.jpg


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

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

PostPosted: Thu Dec 26, 2019 2:45 am    Post subject: Reply with quote

openProcess(pid)
_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Thu Dec 26, 2019 3:51 am    Post subject: Reply with quote

Example as DB said relatives to the case:

Code:
function openPID(PID)
 PID = tonumber(e.Text)
 if PID == "" then
  showMessage('PID empty or not found')
 else
  openProcess(PID)
 end
end

--- TEST
f = createForm()
f.setSize(200,50)
f.Caption = 'Test'
f.Position = 'poScreenCenter'

e = createEdit(f)
e.setPosition(10,10)
e.Width = 100

b = createButton(f)
b.setPosition(e.Left + e.Width + 10, 10)
b.Caption = 'Attach'

f.show()
b.onClick = openPID

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1532

PostPosted: Thu Dec 26, 2019 12:06 pm    Post subject: Reply with quote

A solution to your problem.
I'm using it for now.
You can use "ComboBox" for more .exe types.

Code:
if f then f.destroy() end --(thanks DB)

local f = createForm(true)
f.Position = poDesktopCenter
f.Width = 320
f.Height = 120
f.caption = "Game Process Memory Select"

local l1 = createLabel(f)
l1.Left = 120
l1.Top = 21
l1.Font.Style = "fsBold"
l1.Font.Size = 10
l1.caption = "Process..."

local b1 = createButton(f)
b1.Left = 10
b1.Top = 15
b1.caption = "Open Trainer"

local b2 = createButton(f)
b2.Left = 10
b2.Top = 80
b2.caption = "Hack1"
b2.Enabled = false

local b3 = createButton(f)
b3.Left = 120
b3.Top = 80
b3.caption = "Hack2"
b3.Enabled = false

local game = "chrome" --or Game
local mmry = "100000" --(example, process memory)

function onProcess()
local p = io.popen('tasklist /fi "IMAGENAME eq '..game..'.exe" /fi "MEMUSAGE gt '..mmry..'" /nh', 'r'); --300000
local procInfo = p:read('*a');
p:close();
local pid = procInfo:match('%d+');
pid = tonumber(pid);

if(pid == nil)then
messageDialog("Oyun bulunamadı, ilk önce oyunu başlatın!\nYou must start the game first!", mtWarning, mbOK)

else
openProcess(pid)
l1.Caption = (pid..' - '..game..' - ON!')
b2.Enabled = true
b3.Enabled = true
end
end

b1.OnClick = onProcess


Enjoy it!

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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