|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri Feb 03, 2017 8:05 pm Post subject: Filtering process name list |
|
|
Hi, from this topic : http://forum.cheatengine.org/viewtopic.php?p=5716275#5716275
I try to filtering process name list :
Code: | f = createForm()
control_setSize(f, 400,400)
list = createListBox(f)
Items = listbox_getItems(list)
local name = "svchost.exe"
TempTable = {}
function GetTheProcessList()
local SL=createStringlist()
getProcesslist(SL)
for i=0,strings_getCount(SL)-1 do
local entry = strings_getString(SL,i)
local processname = entry:sub(10,255)
local PID = tonumber('0x'..entry:sub(1,8))
TempTable[i] = {PID, processname}
end
return TempTable
end
function AddTheProcessList()
name = "firefox.exe"
GetTheProcessList()
index = 0
for y in pairs (TempTable) do
index = index+1
end
for i=0, index-1 do
if TempTable[i][2] == name
local TempText = "Process ID : "..TempTable[i][1].." Process Name : "..TempTable[i][2]
strings_add(Items, TempText)
else
showMessage("Game not found")
f.hide()
return -- TempTable
-- if TempTable[i]~='' and TempTable[i]~= nil then
-- local TempText = "Process ID : "..TempTable[i][1].." Process Name : "..TempTable[i][2]
-- strings_add(Items, TempText)
end
end
end |
But...
Code: | //..
name = "firefox.exe" --- or "svchost.exe (try to listing not only one process name with same name)
if TempTable[i][2] == name
local TempText = "Process ID : "..TempTable[i][1].." Process Name : "..TempTable[i][2]
strings_add(Items, TempText)
else
showMessage("Game not found")
f.hide()
//..
----- this nothing show as result.
-- but if
if TempTable[i][2] ~= name
..
..
----- It's show all results except "svchost.exe"
|
Is there something wrong and how to fix it ?
Thanks
|
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Sat Feb 04, 2017 3:40 am Post subject: |
|
|
I might have went to far with this and this might not even be what your asking for? But still wrote it up after trying to execute the code you posted.
Description: |
|
Download |
Filename: |
Select & Sort.CT |
Filesize: |
1.92 KB |
Downloaded: |
500 Time(s) |
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Feb 04, 2017 5:13 am Post subject: |
|
|
Nah, akumakuja28
That is exactly what I want, with your CT file I just need add listbox Items with a specific process name I wish to open, or by your permission I can modifying your script with add a textbox to allow user manually input the specific process name wish to open and attach.
Example :
Code: | ..
drop.Items.Add('svchost.exe')
.. |
Actually I've tried to filtering process names list for specific process name only to add to listbox before you post your CT file..
Code: | Items = listbox_getItems(list)
TempTable = {}
filterTable = {}
function GetTheProcessList()
local SL=createStringlist()
getProcesslist(SL)
local filtername = "svchost.exe"
for i=0,strings_getCount(SL)-1 do
local entry = strings_getString(SL,i)
local processname = entry:sub(10,255)
local PID = tonumber('0x'..entry:sub(1,8))
TempTable[i] = {PID, processname}
if processname == filtername then
filterTable[i] = {PID, processname}
print(PID, processname); end --- print result is good, process name has filtered
end
return TempTable
-- return filterTable
end
function AddTheProcessList() --- problem here, nothing add to listbox from filtered table
GetTheProcessList()
for i,v in ipairs(filterTable) do
strings_add(Items, processname)
end
end |
That's the problem, nothing add to listbox from filtered process name table. Anyhow, I might try with reference to the existing logic in your script and try to implement it in my script.
Thanks and regard
Description: |
Output for filtered process name |
|
Filesize: |
20.67 KB |
Viewed: |
5511 Time(s) |
|
|
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Sat Feb 04, 2017 6:24 am Post subject: |
|
|
Go ahead and edit away thanks for asking tho. Hope it helped yah out.
Just know tht the script is far from perfect it can be simplified a bit more.
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Sat Feb 04, 2017 6:33 am Post subject: |
|
|
No problem and thanks
|
|
Back to top |
|
|
|
|
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
|
|