<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ALuaCall%2Fdoc</id>
	<title>Module:LuaCall/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ALuaCall%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:LuaCall/doc&amp;action=history"/>
	<updated>2026-05-13T22:18:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://www.thegoonshow.co.uk/wiki/index.php?title=Module:LuaCall/doc&amp;diff=97&amp;oldid=prev</id>
		<title>Kurt: Created page with &quot;{{Module rating|alpha}}  This module allows you to call any one single preinstalled Lua function, so that you don't need to write a module for one desired feature.  ==Usage==  ===Main=== {{tlc|#invoke:LuaCall|main|{{var|arbitrary variables}}|{{var|parameters}}|{{var|functioncall}}}}  The {{var|arbitrary variables}} are any key of your choice &lt;code&gt;=&lt;/code&gt; any value of your choice. Values are interpreted as strings unless {{code|tonumber(value)|lua}} isn't {{code|nil|lua...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:LuaCall/doc&amp;diff=97&amp;oldid=prev"/>
		<updated>2022-07-20T12:48:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Module rating|alpha}}  This module allows you to call any one single preinstalled Lua function, so that you don&amp;#039;t need to write a module for one desired feature.  ==Usage==  ===Main=== {{tlc|#invoke:LuaCall|main|{{var|arbitrary variables}}|{{var|parameters}}|{{var|functioncall}}}}  The {{var|arbitrary variables}} are any key of your choice &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; any value of your choice. Values are interpreted as strings unless {{code|tonumber(value)|lua}} isn&amp;#039;t {{code|nil|lua...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Module rating|alpha}}&lt;br /&gt;
&lt;br /&gt;
This module allows you to call any one single preinstalled Lua function, so that you don't need to write a module for one desired feature.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Main===&lt;br /&gt;
{{tlc|#invoke:LuaCall|main|{{var|arbitrary variables}}|{{var|parameters}}|{{var|functioncall}}}}&lt;br /&gt;
&lt;br /&gt;
The {{var|arbitrary variables}} are any key of your choice &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; any value of your choice. Values are interpreted as strings unless {{code|tonumber(value)|lua}} isn't {{code|nil|lua}}, i.e. numbers should be converted to the numeric type. No effort is made to interpret tables.&lt;br /&gt;
&lt;br /&gt;
The {{var|parameters}} all begin with &amp;lt;code&amp;gt;reserved_&amp;lt;/code&amp;gt;, which arbitrary variable should use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;reserved_return&amp;lt;/code&amp;gt; sets which output from the function you want, and defaults to 1. For example, setting it to 2 for mw.ustring.gsub will return the number of replacements made.&lt;br /&gt;
* &amp;lt;code&amp;gt;reserved_debug&amp;lt;/code&amp;gt; - nonzero value forces display of a not particularly useful debug text&lt;br /&gt;
&lt;br /&gt;
The {{var|functioncall}} is written as &amp;lt;code&amp;gt;{{var|some.function.name}}({{var|a,b,c}})&amp;lt;/code&amp;gt; where {{var|some.function.name}} means something in the [[mw:Extension:Scribunto/Lua reference manual|Extension:Scribunto/Lua reference manual]] and {{var|a,b,c}} are the arbitrary variable names you've chosen.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===Main===&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|a=test&amp;amp;nbsp;|b=7|string.rep(a,b)}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|pattern=(%a)|replace=%1.|string=I can't get no satisfaction|mw.ustring.gsub(string,pattern,replace)|reserved_return=1}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|pattern=(%a)|replace=%1.|string=I can't get no satisfaction|mw.ustring.gsub(string,pattern,replace)|reserved_return=2}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|value=1.4512|math.ceil(value)}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|value=1.4512|math.modf(value)}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|value=1.4512|math.modf(value)|reserved_return=2}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|main|mw.text.nowiki(s)|s={{URL|1=https://www.Amazon.com/}}}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===Call===&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|call|string.format|%04x|127}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|call|math.modf|1.4512}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
*{{demo inline|&amp;lt;nowiki&amp;gt;{{#invoke:LuaCall|call|math.modf|1.4512|return=2}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
The module '''may''' generate script errors — whenever your call is not valid Lua code, you see the error you would normally have. For example,&lt;br /&gt;
&lt;br /&gt;
{{demo inline|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{{#invoke:LuaCall|main|value=1.4512|math.fmod(value)}}&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
because the second value is lacking. No effort is made to trap these.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Template categories below this line, please --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kurt</name></author>
	</entry>
</feed>