Difference between revisions of "Lua:inMainThread"
Jump to navigation
Jump to search
m (Syntax Highlighting.) |
|||
| Line 14: | Line 14: | ||
===Examples=== | ===Examples=== | ||
| − | < | + | <syntaxhighlight lang="lua" line> |
if inMainThread() then | if inMainThread() then | ||
print("Running in the main thread") | print("Running in the main thread") | ||
| Line 20: | Line 20: | ||
print("Not running in the main thread") | print("Not running in the main thread") | ||
end | end | ||
| − | </ | + | </syntaxhighlight> |
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
Revision as of 20:47, 26 June 2026
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