Terraria Wiki

  • Discussions are now available on the Terraria Wiki.
  • Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.

READ MORE

Terraria Wiki
Register
(+)
m (Removed protection from "Terraria Wiki:Lua": This page is not a policy page, is not highly transcluded, and hasn't experienced any vandalism.)
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''[[wikipedia:Lua (programming language)|Lua]]''' is a programming language made available at Terraria Wiki via the [[mw:Extension:Scribunto|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 wiki templates by employing the "<nowiki>{{#invoke:}}</nowiki>" syntax.
+
'''[[wikipedia:Lua (programming language)|Lua]]''' is a programming language made available at the Terraria Wiki through the [[mw:Extension:Scribunto|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 {{tc|#invoke:}} parser function.
   
Lua source code is stored on pages called '''modules''' (eg. [[Module:Bananas]], a test script). The documentation for a module is stored at each module's {{code|/doc}} subpage (eg. [[Module:Bananas/doc]]).
+
Lua source code is stored on pages called '''modules''' which reside in their own [[mw:Manual:Namespace|namespace]] (e.g. [[Module:Bananas]], a test script). The documentation for a module is stored at each module's {{code|/doc}} subpage (e.g. [[Module:Bananas/doc]]).
   
  +
The {{tc|#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 <code><nowiki>{{#invoke:Bananas|hello}}</nowiki></code> to print the text "Hello, world!".
 
 
== Examples ==
 
* Use {{tc|#invoke:Bananas|hello}} to print the text "Hello, world!".
 
* See [[Module:BananasArgs]] for extended basic code examples.
 
* See [[Module:BananasArgs]] for extended basic code examples.
   
 
== See also ==
 
== See also ==
* [[wikipedia:Lua|Lua documentation at Wikipedia]]
+
* [[wikipedia:Wikipedia:Lua|Lua documentation at Wikipedia]]
  +
* [https://www.lua.org/pil/contents.html Online version of Programming in Lua (first edition)]
  +
 
{{Help}}
   
  +
[[de:Terraria Wiki:Lua]]
{{help}}
 
  +
[[ru:Terraria Wiki:Lua]]

Revision as of 22:02, 28 May 2021

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 Template:Tc 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 /doc subpage (e.g. Module:Bananas/doc).

The Template:Tc 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 Template:Tc to print the text "Hello, world!".
  • See Module:BananasArgs for extended basic code examples.

See also