Lua documentation

Lua documentation #

Lua has a reference manual, but it has different versions for various releases of the language. To verify which exact version of the documentation you should be looking at, check which Lua version is used by DFHack via this code snippet, either via a script or a :lua command in the console:

print(_VERSION)
Lua 5.3

The script returns Lua 5.3, so the appropriate version of the documentation in this case is Lua 5.3 Reference Manual. If your output is different, change the Lua version number in the documentation link appropriately.

If you are new to programming in general, you might want to take a look at parts of the manual such as values and types, control structures (if-elseif-else, while), for statement, logical operators and format string function.