Lua is a programming language made available at the Terraria Wiki through the Scribunto MediaWiki extension. It is a powerful scripting language that can extend the functionality of wiki templates beyond the capabilities usually ascribed to wiki code alone. It is embedded into wikitext via the {{#invoke:}}
parser function.
Lua source code is stored on pages called modules which reside in their own namespace (e.g. Module:Bananas, a test script). The documentation for a module is stored at each module's
subpage (e.g. Module:Bananas/doc).
/doc
The {{#invoke:}}
parser function is rarely used in articles directly. Instead, it is usually included in templates, a list of which can be found in the Category:Templates using Lua.
Examples[]
- Use
{{#invoke:Bananas|hello}}
to print the text "Hello, world!". - See Module:BananasArgs for extended basic code examples.
See also[]
- Lua documentation at Wikipedia
- Lua 5.1 Manual (this wiki is currently running Lua 5.1.5 as seen in Special:Version).
- Other Lua versions' manuals (the coding advice could be helpful):
- Programming in Lua books, by Roberto Ierusalimschy, Lua's chief architect. When you buy a copy of any of these books, you help to support the Lua project.
- The Lua project on github.
- PDF versions of Programming in Lua — e1 (Lua 5.0), e2 (Lua 5.1), e3 (Lua 5.2), e4 (Lua 5.3)
- Online version of Programming in Lua (first edition)