View previous topic :: View next topic |
Author |
Message |
johnkittz Advanced Cheater Reputation: 0
Joined: 17 May 2016 Posts: 95 Location: orderandhacks
|
Posted: Mon Nov 21, 2016 9:03 pm Post subject: [HELP] Return Process name+PID LUA |
|
|
I'm wondering how I could return the process name and the current PID with my trainer i also would like to know how to make a text which says "Game Not Detected" then switching once connected to game to "Game Detected"
is there any way to change the color of the text so the color changes from white to red when connected?
_________________
Another Day, Another Hack. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Nov 21, 2016 9:33 pm Post subject: |
|
|
Code: | function getProcessNameFromID(processId)
local processName = nil
local list = createStringlist()
getProcesslist(list)
for i = 0, list.Count-1 do
local id, name = list.String[i]:match("(.*)-(.*)")
if processId == tonumber(id, 16) then
processName = name
break
end
end
return processName
end
local id = getOpenedProcessID()
local name = getProcessNameFromID(id)
print(name) |
Code: | if readInteger("game.exe") == nil then
UDF1.CELabel1.Caption = "Game Not Detected"
UDF1.CELabel1.Font.Color = 0x0000FF
else
UDF1.CELabel1.Caption = "Game Detected"
UDF1.CELabel1.Font.Color = 0x009900
end |
Code: | function onOpenProcess(processId)
local name = getProcessNameFromID(processId)
UDF1.CELabel1.Caption = "Detected " .. name
end |
|
|
Back to top |
|
|
johnkittz Advanced Cheater Reputation: 0
Joined: 17 May 2016 Posts: 95 Location: orderandhacks
|
Posted: Mon Nov 21, 2016 10:05 pm Post subject: |
|
|
Zanzer wrote: | Code: | function getProcessNameFromID(processId)
local processName = nil
local list = createStringlist()
getProcesslist(list)
for i = 0, list.Count-1 do
local id, name = list.String[i]:match("(.*)-(.*)")
if processId == tonumber(id, 16) then
processName = name
break
end
end
return processName
end
local id = getOpenedProcessID()
local name = getProcessNameFromID(id)
print(name) |
Code: | if readInteger("game.exe") == nil then
UDF1.CELabel1.Caption = "Game Not Detected"
UDF1.CELabel1.Font.Color = 0x0000FF
else
UDF1.CELabel1.Caption = "Game Detected"
UDF1.CELabel1.Font.Color = 0x009900
end |
Code: | function onOpenProcess(processId)
local name = getProcessNameFromID(processId)
UDF1.CELabel1.Caption = "Detected " .. name
end |
|
Nice! It works! now im just wondering how to return the PID
_________________
Another Day, Another Hack. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Nov 21, 2016 10:07 pm Post subject: |
|
|
Code: | local id = getOpenedProcessID() |
|
|
Back to top |
|
|
johnkittz Advanced Cheater Reputation: 0
Joined: 17 May 2016 Posts: 95 Location: orderandhacks
|
Posted: Tue Nov 22, 2016 2:11 am Post subject: |
|
|
Zanzer wrote: | Code: | local id = getOpenedProcessID() |
|
Thanks so much for the code man! You'll definitely be credited in my trainer!
_________________
Another Day, Another Hack. |
|
Back to top |
|
|
johnkittz Advanced Cheater Reputation: 0
Joined: 17 May 2016 Posts: 95 Location: orderandhacks
|
Posted: Tue Nov 22, 2016 11:39 pm Post subject: |
|
|
this wont work inside a exe trainer it remains red and showing not detected even when attached
_________________
Another Day, Another Hack. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Wed Nov 23, 2016 5:03 am Post subject: |
|
|
did you rename the onOpenProcess function to something else?
Or did you remove the getAutoAttachList().add( ... line from your trainer ?
Also, this code works as well
Code: |
name=getProcessList()[processId]
|
_________________
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 |
|
|
johnkittz Advanced Cheater Reputation: 0
Joined: 17 May 2016 Posts: 95 Location: orderandhacks
|
Posted: Wed Nov 23, 2016 12:06 pm Post subject: |
|
|
No didn't remove ANY lines from my trainer should I remove the AutoAttach line? Or rename OnOpenProcess?
_________________
Another Day, Another Hack. |
|
Back to top |
|
|
|