RTGame:Lua: Difference between revisions

Lua usage on the RTGame Wiki
No edit summary
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:


'''Lua''' is a programming language that is integrated into the Star Citizen Wiki with [[mw:Extension:Scribunto|Scribunto]]. Lua source code is run from Modules in their own namespace, and invoked with <code><nowiki>{{#invoke:Module|function}}</nowiki></code>; this should be done with a wrapper template. For example, if we have a module named "foo", then we should have a template called "Template:Foo" consisting of <code><nowiki>{{#invoke:Foo|main}}</nowiki></code> to call the module, and use <code><nowiki>{{Foo}}</nowiki></code> to use the module on pages.
'''Lua''' is a programming language that is integrated into the RTGame Wiki with [[mw:Extension:Scribunto|Scribunto]]. Lua source code is run from Modules in their own namespace, and invoked with <code><nowiki>{{#invoke:Module|function}}</nowiki></code>; this should be done with a wrapper template. For example, if we have a module named "foo", then we should have a template called "Template:Foo" consisting of <code><nowiki>{{#invoke:Foo|main}}</nowiki></code> to call the module, and use <code><nowiki>{{Foo}}</nowiki></code> to use the module on pages.


For certain complex templates, Lua runs many times more efficiently than standard wikitext. It can also perform operations not available otherwise in wikitext. Unlike JavaScript, it is available to all readers, and does not need to be enabled. It is also run during parsing, rather than after.
For certain complex templates, Lua runs many times more efficiently than standard wikitext. It can also perform operations not available otherwise in wikitext. Unlike JavaScript, it is available to all readers, and does not need to be enabled. It is also run during parsing, rather than after.
Line 9: Line 9:
* [[Special:PrefixIndex/Module:]], for a list of all current modules
* [[Special:PrefixIndex/Module:]], for a list of all current modules
* [[:Category:Lua-based templates]], for an index of templates that directly invoke Lua
* [[:Category:Lua-based templates]], for an index of templates that directly invoke Lua


{{Credit_SC}}
{{Credit_SC}}
{{Wiki navplate}}
{{Wiki navplate}}
{{SHORTDESC|Lua usage on the RTGame Wiki}}
{{SHORTDESC|Lua usage on the RTGame Wiki}}
[[Category:Policies]]
[[Category:Policies]]

Latest revision as of 20:52, 7 May 2021

Lua is a programming language that is integrated into the RTGame Wiki with Scribunto. Lua source code is run from Modules in their own namespace, and invoked with {{#invoke:Module|function}}; this should be done with a wrapper template. For example, if we have a module named "foo", then we should have a template called "Template:Foo" consisting of {{#invoke:Foo|main}} to call the module, and use {{Foo}} to use the module on pages.

For certain complex templates, Lua runs many times more efficiently than standard wikitext. It can also perform operations not available otherwise in wikitext. Unlike JavaScript, it is available to all readers, and does not need to be enabled. It is also run during parsing, rather than after.

See also


Note: A portion of the text above is originated from the Star Citizen Wiki under CC BY-SA 4.0 license.