<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACalendar_crops</id>
	<title>Module:Calendar crops - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mbwiki.stairwaygames.work/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ACalendar_crops"/>
	<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Calendar_crops&amp;action=history"/>
	<updated>2026-04-06T17:42:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://mbwiki.stairwaygames.work/w/index.php?title=Module:Calendar_crops&amp;diff=6833&amp;oldid=prev</id>
		<title>Admin coral island: Created page with &quot;local p = {} local lib = require(&#039;Module:Feature&#039;) local Exists = require(&#039;Module:Exists&#039;).checkExists  function p.main(frame)     local args = require(&#039;Module:Arguments&#039;).getArgs(frame, {         parentFirst = true,         wrapper = {&#039;Template:Calendar crops&#039;}     })     return p._main(args) end  function p._main(args) 	local crop = args.crop or mw.title.getCurrentTitle().rootText 	local category = mw.html.create() 	assert(args[1], &#039;Missing stage information&#039;) 	local s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mbwiki.stairwaygames.work/w/index.php?title=Module:Calendar_crops&amp;diff=6833&amp;oldid=prev"/>
		<updated>2023-08-09T08:52:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} local lib = require(&amp;#039;Module:Feature&amp;#039;) local Exists = require(&amp;#039;Module:Exists&amp;#039;).checkExists  function p.main(frame)     local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {         parentFirst = true,         wrapper = {&amp;#039;Template:Calendar crops&amp;#039;}     })     return p._main(args) end  function p._main(args) 	local crop = args.crop or mw.title.getCurrentTitle().rootText 	local category = mw.html.create() 	assert(args[1], &amp;#039;Missing stage information&amp;#039;) 	local s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local lib = require(&amp;#039;Module:Feature&amp;#039;)&lt;br /&gt;
local Exists = require(&amp;#039;Module:Exists&amp;#039;).checkExists&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
        parentFirst = true,&lt;br /&gt;
        wrapper = {&amp;#039;Template:Calendar crops&amp;#039;}&lt;br /&gt;
    })&lt;br /&gt;
    return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local crop = args.crop or mw.title.getCurrentTitle().rootText&lt;br /&gt;
	local category = mw.html.create()&lt;br /&gt;
	assert(args[1], &amp;#039;Missing stage information&amp;#039;)&lt;br /&gt;
	local stages = args[1]:find(&amp;#039;;&amp;#039;) and lib.split(args[1], &amp;#039;;&amp;#039;) or args&lt;br /&gt;
	local growth = {}&lt;br /&gt;
	local regrowth = {0, &amp;#039;&amp;#039;}&lt;br /&gt;
	local images, padding, noRep, last = {}, {}, {}&lt;br /&gt;
	for i, stage in ipairs(stages) do&lt;br /&gt;
		if stage == &amp;#039;R0&amp;#039; then&lt;br /&gt;
			regrowth[2] = last&lt;br /&gt;
			regrowth[1] = -1&lt;br /&gt;
		elseif stage == &amp;#039;R&amp;#039; then&lt;br /&gt;
			regrowth[1] = regrowth[1] + 1&lt;br /&gt;
			if last ~= &amp;#039;R&amp;#039; then regrowth[2] = last end&lt;br /&gt;
			last = stage&lt;br /&gt;
			if not images[stage] then &lt;br /&gt;
				local filename = &amp;#039;File:&amp;#039; .. crop .. &amp;#039; stage &amp;#039; .. stage .. &amp;#039;.png&amp;#039;&lt;br /&gt;
				if Exists(filename) then&lt;br /&gt;
					images[stage] = &amp;#039;[[&amp;#039; .. filename .. &amp;#039;|75px]]&amp;#039;&lt;br /&gt;
					padding[stage] = {padding = 0}&lt;br /&gt;
				else&lt;br /&gt;
					images[stage] = &amp;#039;Regrowing&amp;#039;&lt;br /&gt;
					category:wikitext(&amp;#039;[[Category:Missing crop regrowth image]]&amp;#039;)&lt;br /&gt;
					padding[stage] = {}&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		elseif last == &amp;#039;R&amp;#039; then&lt;br /&gt;
			regrowth[2] = stage&lt;br /&gt;
			break&lt;br /&gt;
		elseif not last or last == stage or not noRep[stage] then&lt;br /&gt;
			table.insert(growth, stage)&lt;br /&gt;
			last = stage&lt;br /&gt;
			noRep[stage] = true&lt;br /&gt;
			if not images[stage] then &lt;br /&gt;
				local filename = &amp;#039;File:&amp;#039; .. crop .. &amp;#039; stage &amp;#039; .. stage .. &amp;#039;.png&amp;#039;&lt;br /&gt;
				if Exists(filename) then&lt;br /&gt;
					images[stage] = &amp;#039;[[&amp;#039; .. filename .. &amp;#039;|75px]]&amp;#039;&lt;br /&gt;
					padding[stage] = {padding = 0}&lt;br /&gt;
				else&lt;br /&gt;
					images[stage] = &amp;#039;Stage &amp;#039; .. stage .. lib.ternary((stages[i+1] ~= nil and stages[i+1] == &amp;#039;R&amp;#039;), &amp;#039;&amp;lt;br /&amp;gt;Harvestable&amp;#039;, &amp;#039;&amp;#039;) &lt;br /&gt;
					category:wikitext(&amp;#039;[[Category:Missing crop growth stage &amp;#039;, stage,&amp;#039; image]]&amp;#039;)&lt;br /&gt;
					padding[stage] = {}&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local stage, cycle = 1, #growth&lt;br /&gt;
	local calendar = mw.html.create(&amp;#039;table&amp;#039;):addClass(&amp;#039;wikitable&amp;#039;):css{[&amp;#039;text-align&amp;#039;] = &amp;#039;center&amp;#039;}&lt;br /&gt;
	calendar:tag(&amp;#039;caption&amp;#039;):wikitext(&amp;#039;Base&amp;#039;)&lt;br /&gt;
	local tr = calendar:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	tr&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Mon&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Tue&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Wed&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Thu&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Fri&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Sat&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;th&amp;#039;):wikitext(&amp;#039;Sun&amp;#039;)&lt;br /&gt;
	for i = 1, 28 do&lt;br /&gt;
		if i == 1 or i == 8 or i == 15 or i == 22 then&lt;br /&gt;
			tr = calendar:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if stage&amp;lt;=cycle then&lt;br /&gt;
			tr:tag(&amp;#039;td&amp;#039;):css(padding[growth[stage]]):wikitext(images[growth[stage]])&lt;br /&gt;
			stage = stage + 1&lt;br /&gt;
			if stage&amp;gt;cycle and regrowth[1]==0 then stage = 2 end&lt;br /&gt;
		elseif regrowth[1]&amp;gt;0 then&lt;br /&gt;
			local regstage = 1&lt;br /&gt;
			for y = i, 28 do&lt;br /&gt;
				if y ~= i and (y == 1 or y == 8 or y == 15 or y == 22) then&lt;br /&gt;
					tr = calendar:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				end&lt;br /&gt;
				if regstage&amp;lt;=regrowth[1] then&lt;br /&gt;
					tr:tag(&amp;#039;td&amp;#039;):css(padding[&amp;#039;R&amp;#039;]):wikitext(images[&amp;#039;R&amp;#039;])&lt;br /&gt;
					regstage = regstage + 1&lt;br /&gt;
				elseif regstage&amp;gt;regrowth[1] then&lt;br /&gt;
					tr:tag(&amp;#039;td&amp;#039;):css(padding[regrowth[2]]):wikitext(images[regrowth[2]])&lt;br /&gt;
					regstage = 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			break&lt;br /&gt;
		elseif regrowth[1] == -1 then&lt;br /&gt;
			-- crops that regrow the very next day, having virtually no regrowth period&lt;br /&gt;
			for y = i, 28 do&lt;br /&gt;
				if y ~= i and (y == 1 or y == 8 or y == 15 or y == 22) then&lt;br /&gt;
					tr = calendar:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
				end&lt;br /&gt;
				tr:tag(&amp;#039;td&amp;#039;):css(padding[regrowth[2]]):wikitext(images[regrowth[2]])&lt;br /&gt;
			end&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	calendar:node(require(&amp;#039;Module:Namespace detect&amp;#039;).main{main=category})&lt;br /&gt;
	&lt;br /&gt;
	return calendar&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Admin coral island</name></author>
	</entry>
</feed>