Lua:inMainThread

From Cheat Engine
Revision as of 20:47, 26 June 2026 by Leunsel (talk | contribs) (Syntax Highlighting.)
Jump to navigation Jump to search

⚠️ Version Notice

This function requires Cheat Engine 6.4+.

<> Lua API Reference

function inMainThread() : boolean

Returns true if the current code is running inside the main thread.

This function is available in Cheat Engine 6.4 and later.

Function Parameters

This function has no parameters.

Returns

boolean — True if the current code is running inside the main thread, otherwise false.

Examples

1 if inMainThread() then
2   print("Running in the main thread")
3 else
4   print("Not running in the main thread")
5 end

Main Pages

Core Lua documentation entry points

Lua
Script Engine