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 


getProcessIDFromProcessName - How to call

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Fixxxer
How do I cheat?
Reputation: 0

Joined: 29 Apr 2013
Posts: 7

PostPosted: Fri Oct 04, 2013 5:15 pm    Post subject: getProcessIDFromProcessName - How to call Reply with quote

Hi,

I decided to try something new and create a process listbox Razz
I found many examples but I would like an explanation why my approach does not work.

Code:
   
  processList = createStringlist()
     processList=getProcesslist()
     for i = 0, strings_getCount(processList) - 1 do
        process = strings_getString(processList, i)
        pid = getProcessIDFromProcessName(process)  <--wrong call????
        strings_add(items,process.."-"..pid)
     end


I get the error attempt to concatenate global 'pid' (a nil value)
So I understand the the getProcessIDFromProccessName didn't work???

Thanks in advance

Edit: One guess would be that the getProcessIDFromProcessName does not return string or number therefore the concatenation fails?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Oct 04, 2013 5:48 pm    Post subject: Reply with quote

You don't need to call createStringList, getProcesslist creates it for you

The problem is that the processlist is build up as pid-processname
So, first strip the processid from the list , or just use that

_________________
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
Fixxxer
How do I cheat?
Reputation: 0

Joined: 29 Apr 2013
Posts: 7

PostPosted: Fri Oct 04, 2013 6:17 pm    Post subject: Reply with quote

I see, reading the description thought that only returns the process name, and you have to find the PID from the getProcessIDFromProcessName
but now I figured out that it would be ambiguous to do that, since there might be the same process name a lot of times.
Thanks again
(I think not for the last time:D)
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