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 


Select the maximum memory as the currently valid process.[S]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 644

PostPosted: Wed Jul 31, 2019 8:33 am    Post subject: Select the maximum memory as the currently valid process.[S] Reply with quote

As the research period was extended, there was a need to ask.
Uncle Google is not very descriptive. Smile

Only for the current memory question: there is garbage collection Sad

So instead of "Name" and "ID",
Is it possible to select the most memory consuming process?
So: How do I get a list of Windows CPU memory.
And how do I select the highest memory from this list as the current process?

Thanks in advance for the help.

_________________
Hi Hitler Take control of your trainer
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by Aylin on Wed Jul 31, 2019 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
FreeER
Grandmaster Cheater Supreme
Reputation: 42

Joined: 09 Aug 2013
Posts: 1089

PostPosted: Wed Jul 31, 2019 10:28 am    Post subject: This post has 1 review(s) Reply with quote

I played around with this concept awhile back:
https://github.com/FreeER/CE-Examples/blob/master/attachToMostMemoryProcess.lua

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 644

PostPosted: Wed Jul 31, 2019 10:58 am    Post subject: Reply with quote

FreeER wrote:
I played around with this concept awhile back:
https://github.com/FreeER/CE-Examples/blob/master/attachToMostMemoryProcess.lua


It worked great. Thanks.
I should try that in the game. Smile

I have 2 questions:
1) Selects the 2nd highest memory in the task manager. Why is that?
2) Is it necessary to limit it to "Chrome.exe"?
Can we do this in more than one browser option?


But please archive this work in "CE Lua Lessons".
easier to find.

Thanks again and +1.



12.JPG
 Description:
 Filesize:  166.26 KB
 Viewed:  1999 Time(s)

12.JPG



_________________
Hi Hitler Take control of your trainer
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 MSN Messenger
FreeER
Grandmaster Cheater Supreme
Reputation: 42

Joined: 09 Aug 2013
Posts: 1089

PostPosted: Wed Jul 31, 2019 2:37 pm    Post subject: Reply with quote

2. you can just call tasklist and it will give everything, I don't believe it has an option to give it multiples of the same filter type so you'd just have to filter it yourself, the first thing in the info is the process name.

1. /shrug maybe an off by one issue in the getMemory function, I didn't really use it myself, someone else had asked for it so I wrote that and haven't looked at it since lol

hm, testing it myself I did notice it failing to get the pid and memory correctly in some cases causing an error when it tried to do math with a nil value, using local name, pid, mem = info:match('(%S+)%s+(%d+)%s+%S+%s+%d+%s+(.+)') instead fixed that and in my testing it was able to get the largest chrome process. It's also possible that tasklist and task manager calculate the memory values differently for some reason... wouldn't put it past Windows lol

_________________
https://github.com/FreeER/ has a few CE related repos
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