<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3ACarousel</id>
	<title>Module:Carousel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pool.calebcooper.ie/index.php?action=history&amp;feed=atom&amp;title=Module%3ACarousel"/>
	<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Carousel&amp;action=history"/>
	<updated>2026-04-08T08:08:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://pool.calebcooper.ie/index.php?title=Module:Carousel&amp;diff=12205&amp;oldid=prev</id>
		<title>Caleb Cooper: Created page with &quot; p = {}  -- carousel returns one of a list of image filenames -- -- the index of the one chosen increments every &#039;switchsecs&#039; -- which is a parameter giving the number of seco...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pool.calebcooper.ie/index.php?title=Module:Carousel&amp;diff=12205&amp;oldid=prev"/>
		<updated>2020-10-18T17:38:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; p = {}  -- carousel returns one of a list of image filenames -- -- the index of the one chosen increments every &amp;#039;switchsecs&amp;#039; -- which is a parameter giving the number of seco...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
p = {}&lt;br /&gt;
&lt;br /&gt;
-- carousel returns one of a list of image filenames&lt;br /&gt;
--&lt;br /&gt;
-- the index of the one chosen increments every &amp;#039;switchsecs&amp;#039;&lt;br /&gt;
-- which is a parameter giving the number of seconds between switches&lt;br /&gt;
-- 3600 would switch every hour&lt;br /&gt;
-- 43200 would be every 12 hours&lt;br /&gt;
-- 86400 would be daily (the default)&lt;br /&gt;
--&lt;br /&gt;
-- The list of filenames is in a named submodule, so everyone can have their own list.&lt;br /&gt;
-- For Komodobish (the default), the module is [[Module:Carousel/Komodobish]].&lt;br /&gt;
-- For Serial Number 54129, the module is [[Module:Carousel/54129]].&lt;br /&gt;
-- See https://en.wikipedia.org/wiki/Special:PrefixIndex/Module:Carousel/&lt;br /&gt;
--&lt;br /&gt;
-- {{#invoke:carousel | main | name = name-of-datamodule | switchsecs = number-of-seconds }}&lt;br /&gt;
-- {{#invoke:carousel | main | name = 54129 | switchsecs = 10 }} for 10 sec switches using [[Module:Carousel/54129]]&lt;br /&gt;
-- {{#invoke:carousel | main }} for 24 hours between switches using the default data module&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
p.main = function(frame)&lt;br /&gt;
	-- get parameter switchsecs; if NaN or less than 1, set default&lt;br /&gt;
	local switchtime = tonumber(frame.args.switchsecs) or 86400&lt;br /&gt;
	if switchtime &amp;lt; 1 then switchtime = 86400 end&lt;br /&gt;
&lt;br /&gt;
	-- get parameter dataname; if missing, use default&lt;br /&gt;
	local dataname = frame.args.name or mw.text.trim(frame.args[1]) or &amp;quot;&amp;quot;&lt;br /&gt;
	if dataname == &amp;quot;&amp;quot; then dataname = &amp;quot;Komodobish&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	-- there should be a named data module as a submodule&lt;br /&gt;
	local imgs = require(&amp;quot;Module:Carousel/&amp;quot; .. dataname)&lt;br /&gt;
	local numimgs = #imgs&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;now&amp;#039; increments by 1 every switchtime seconds&lt;br /&gt;
	local now = math.floor( os.time() / switchtime )&lt;br /&gt;
&lt;br /&gt;
	-- set an index between 1 and number of images&lt;br /&gt;
	local idx = now % numimgs + 1&lt;br /&gt;
	return imgs[idx]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Caleb Cooper</name></author>
	</entry>
</feed>