Difference between revisions of "Lua:getThreadlist"

From Cheat Engine
Jump to navigation Jump to search
(Created page with 'Category:Lua '''function''' getThreadlist(''StringList'') Fills a StringList object with the threadlist of the currently opened process. ===Function Parameters=== {|width=…')
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' getThreadlist(''StringList'')
+
{{CodeBox|'''function''' getThreadlist(''List'') ''':''' void}}
  
Fills a StringList object with the threadlist of the currently opened process.
+
Fills a List object with the thread list of the currently opened process.
  
 +
The thread IDs are added to the list as hexadecimal strings using the format ''%x''.
  
 
===Function Parameters===
 
===Function Parameters===
{|width="85%" cellpadding="10%" cellpadding="5%" cellspacing="0" border="0"
+
{|width="85%" cellpadding="10%" cellspacing="0" border="0"
 
!align="left"|Parameter
 
!align="left"|Parameter
 
!align="left"|Type
 
!align="left"|Type
 
!style="width: 80%;background-color:white;" align="left"|Description
 
!style="width: 80%;background-color:white;" align="left"|Description
 
|-
 
|-
|StringList
+
|List
|[[Lua:Class:Stringlist|Stringlist]]
+
|List
|The StringList to fill
+
|The list object that will be filled with the thread IDs of the currently opened process.
 
|}
 
|}
  
== Examples ==
+
===Returns===
 +
void — This function does not return any value.
 +
 
 +
===Examples===
 
<pre>
 
<pre>
local l = createStringlist()
+
local list = createStringlist()
getThreadlist(l)
+
 
for i = 1, l.Count do
+
getThreadlist(list)
print(l[i - 1])
+
 
 +
for i = 0, list.Count - 1 do
 +
  print("Thread ID: " .. list[i])
 
end
 
end
 +
 +
list.destroy()
 
</pre>
 
</pre>
 
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
 
=== Related Functions ===
 
* [[Lua:getCPUCount|getCPUCount]]
 

Revision as of 04:50, 21 June 2026

<> Lua API Reference

function getThreadlist(List) : void

Fills a List object with the thread list of the currently opened process.

The thread IDs are added to the list as hexadecimal strings using the format %x.

Function Parameters

Parameter Type Description
List List The list object that will be filled with the thread IDs of the currently opened process.

Returns

void — This function does not return any value.

Examples

local list = createStringlist()

getThreadlist(list)

for i = 0, list.Count - 1 do
  print("Thread ID: " .. list[i])
end

list.destroy()

Main Pages

Core Lua documentation entry points

Lua
Script Engine