Difference between revisions of "Lua:getProcesslist"

From Cheat Engine
Jump to navigation Jump to search
m (Added CodeBox Template.)
m (Syntax Highlighting.)
Line 19: Line 19:
  
 
=== Example ===
 
=== Example ===
<pre>
+
<syntaxhighlight lang="lua" line>
 
-- Without Strings object
 
-- Without Strings object
 
local plist = getProcesslist()
 
local plist = getProcesslist()
Line 30: Line 30:
 
getProcesslist(strObj)
 
getProcesslist(strObj)
 
print(strObj:ToTable())
 
print(strObj:ToTable())
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
 
{{Process}}
 
{{Process}}

Revision as of 19:10, 25 June 2026

<> Lua API Reference

function getProcesslist(Strings OPTIONAL) : table - Strings

Returns a table with the process list (PID → name) if Strings is not set. If Strings is provided, it fills the given Strings object with the system's process list.

Format: %x - pidname

Function Parameters

Parameter Type Description
Strings Strings Optional. If provided, fills this Strings object with the process list.

Example

 1 -- Without Strings object
 2 local plist = getProcesslist()
 3 for pid, name in pairs(plist) do
 4   print(string.format("0x%X - %s", pid, name))
 5 end
 6 
 7 -- Using Strings object
 8 local strObj = Strings.create()
 9 getProcesslist(strObj)
10 print(strObj:ToTable())

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Process Open / Creation

Process Lists / Modules

Process Control / Target State