<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.stiles.casa/index.php?action=history&amp;feed=atom&amp;title=Module%3AExample%2Fsandbox</id>
	<title>Module:Example/sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.stiles.casa/index.php?action=history&amp;feed=atom&amp;title=Module%3AExample%2Fsandbox"/>
	<link rel="alternate" type="text/html" href="https://wiki.stiles.casa/index.php?title=Module:Example/sandbox&amp;action=history"/>
	<updated>2026-05-18T11:04:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.stiles.casa/index.php?title=Module:Example/sandbox&amp;diff=5757&amp;oldid=prev</id>
		<title>Maxwells: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.stiles.casa/index.php?title=Module:Example/sandbox&amp;diff=5757&amp;oldid=prev"/>
		<updated>2022-06-11T21:01:27Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:01, 11 June 2022&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff::1.12:old-5756:rev-5757 --&gt;
&lt;/table&gt;</summary>
		<author><name>Maxwells</name></author>
	</entry>
	<entry>
		<id>https://wiki.stiles.casa/index.php?title=Module:Example/sandbox&amp;diff=5756&amp;oldid=prev</id>
		<title>en&gt;Andrybak: Create sandbox version of Module:Example</title>
		<link rel="alternate" type="text/html" href="https://wiki.stiles.casa/index.php?title=Module:Example/sandbox&amp;diff=5756&amp;oldid=prev"/>
		<updated>2020-06-07T08:59:09Z</updated>

		<summary type="html">&lt;p&gt;Create sandbox version of &lt;a href=&quot;/view/Module:Example&quot; title=&quot;Module:Example&quot;&gt;Module:Example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {};     --All lua modules on Stiles.casa Wiki must begin by defining a variable &lt;br /&gt;
                    --that will hold their externally accessible functions.&lt;br /&gt;
                    --Such variables can have whatever name you want and may &lt;br /&gt;
                    --also contain various data as well as functions.&lt;br /&gt;
&lt;br /&gt;
p.hello = function( frame )     --Add a function to &amp;quot;my_object&amp;quot;.  &lt;br /&gt;
                                        --Such functions are callable in Stiles.casa Wiki&lt;br /&gt;
                                        --via the #invoke command.&lt;br /&gt;
                                        --&amp;quot;frame&amp;quot; will contain the data that Stiles.casa Wiki&lt;br /&gt;
                                        --sends this function when it runs. &lt;br /&gt;
    &lt;br /&gt;
    local str = &amp;quot;Hello World!&amp;quot;  --Declare a local variable and set it equal to&lt;br /&gt;
                                --&amp;quot;Hello World!&amp;quot;.  &lt;br /&gt;
    &lt;br /&gt;
    return str    --This tells us to quit this function and send the information in&lt;br /&gt;
                  --&amp;quot;str&amp;quot; back to Stiles.casa Wiki.&lt;br /&gt;
    &lt;br /&gt;
end  -- end of the function &amp;quot;hello&amp;quot;&lt;br /&gt;
function p.hello_to(frame)		-- Add another function&lt;br /&gt;
	local name = frame.args[1]  -- To access arguments passed to a module, use `frame.args`&lt;br /&gt;
							    -- `frame.args[1]` refers to the first unnamed parameter&lt;br /&gt;
							    -- given to the module&lt;br /&gt;
	return &amp;quot;Hello, &amp;quot; .. name .. &amp;quot;!&amp;quot;  -- `..` concatenates strings. This will return a customized&lt;br /&gt;
									 -- greeting depending on the name given, such as &amp;quot;Hello, Fred!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
function p.count_fruit(frame)&lt;br /&gt;
	local num_bananas = frame.args.bananas -- Named arguments ({{#invoke:Example|count_fruit|foo=bar}}) are likewise &lt;br /&gt;
	local num_apples = frame.args.apples   -- accessed by indexing `frame.args` by name (`frame.args[&amp;quot;bananas&amp;quot;]`, or)&lt;br /&gt;
										   -- equivalently `frame.args.bananas`.&lt;br /&gt;
	return &amp;#039;I have &amp;#039; .. num_bananas .. &amp;#039; bananas and &amp;#039; .. num_apples .. &amp;#039; apples&amp;#039;&lt;br /&gt;
										   -- Like above, concatenate a bunch of strings together to produce&lt;br /&gt;
										   -- a sentence based on the arguments given.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p    --All modules end by returning the variable containing their functions to Stiles.casa Wiki.&lt;br /&gt;
-- Now we can use this module by calling {{#invoke: Example | hello }},&lt;br /&gt;
-- {{#invoke: Example | hello_to | foo }}, or {{#invoke:Example|count_fruit|bananas=5|apples=6}}&lt;br /&gt;
-- Note that the first part of the invoke is the name of the Module&amp;#039;s wikipage,&lt;br /&gt;
-- and the second part is the name of one of the functions attached to the &lt;br /&gt;
-- variable that you returned.&lt;br /&gt;
&lt;br /&gt;
-- The &amp;quot;print&amp;quot; function is not allowed in Stiles.casa Wiki.  All output is accomplished&lt;br /&gt;
-- via strings &amp;quot;returned&amp;quot; to Stiles.casa Wiki.&lt;/div&gt;</summary>
		<author><name>en&gt;Andrybak</name></author>
	</entry>
</feed>