<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FQwerfjkl</id>
	<title>Module:Sandbox/Qwerfjkl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FQwerfjkl"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Qwerfjkl&amp;action=history"/>
	<updated>2026-04-21T11:52:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Qwerfjkl&amp;diff=146032&amp;oldid=prev</id>
		<title>imported&gt;Qwerfjkl: Bawl!]</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Qwerfjkl&amp;diff=146032&amp;oldid=prev"/>
		<updated>2022-06-26T14:25:07Z</updated>

		<summary type="html">&lt;p&gt;[&lt;a href=&quot;/index.php?title=W:en:User:Alexis_Jazz/Bawl&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;W:en:User:Alexis Jazz/Bawl (page does not exist)&quot;&gt;Bawl!&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 = {}&lt;br /&gt;
-- Checks whether a page exists, going through pcall&lt;br /&gt;
-- in case we are over the expensive function limit.&lt;br /&gt;
local function checkPageExists( title )&lt;br /&gt;
    if not title then&lt;br /&gt;
        error(&amp;#039;No title passed to checkArchiveExists&amp;#039;, 2)&lt;br /&gt;
    end&lt;br /&gt;
    local noError, titleObject = pcall(mw.title.new, title)&lt;br /&gt;
    if not noError then&lt;br /&gt;
        -- If we are over the expensive function limit then assume&lt;br /&gt;
        -- that the page doesn&amp;#039;t exist.&lt;br /&gt;
        return false&lt;br /&gt;
    else&lt;br /&gt;
        if titleObject then&lt;br /&gt;
            return titleObject.exists&lt;br /&gt;
        else&lt;br /&gt;
            return false -- Return false if given a bad title.&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Checks every nth archive to see if it exists, and returns the&lt;br /&gt;
-- number of the first archive that doesn&amp;#039;t exist. It is&lt;br /&gt;
-- necessary to do this in batches because each check is an&lt;br /&gt;
-- expensive function call, and we want to avoid making too many&lt;br /&gt;
-- of them so as not to go over the expensive function limit.&lt;br /&gt;
local function checkArchives( prefix, n, start )&lt;br /&gt;
    local i = start&lt;br /&gt;
    local exists = true&lt;br /&gt;
    while exists do&lt;br /&gt;
        exists = checkPageExists( prefix .. tostring( i ) )&lt;br /&gt;
        if exists then&lt;br /&gt;
            i = i + n&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return i&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the biggest archive number, using checkArchives()&lt;br /&gt;
-- and starting in intervals of 1000. This should get us a&lt;br /&gt;
-- maximum of 500,000 possible archives before we hit the&lt;br /&gt;
-- expensive function limit.&lt;br /&gt;
local function getBiggestArchiveNum( prefix, start )&lt;br /&gt;
    &lt;br /&gt;
    start = start or 1&lt;br /&gt;
    local check1000 = checkArchives( prefix, 1000, start )&lt;br /&gt;
    if check1000 == start then&lt;br /&gt;
        return 0 -- Return 0 if no archives were found.&lt;br /&gt;
    end&lt;br /&gt;
    local check200 = checkArchives( prefix, 200, check1000 - 1000 )&lt;br /&gt;
    local check50 = checkArchives( prefix, 50, check200 - 200 )&lt;br /&gt;
    local check10 = checkArchives( prefix, 10, check50 - 50 )&lt;br /&gt;
    local check1 = checkArchives( prefix, 1, check10 - 10 )&lt;br /&gt;
&lt;br /&gt;
    return check1&lt;br /&gt;
end&lt;br /&gt;
p.main = function (frame)&lt;br /&gt;
    return getBiggestArchiveNum(&amp;#039;User:Qwerfjkl/sandbox/&amp;#039;, 1)&lt;br /&gt;
end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Qwerfjkl</name></author>
	</entry>
</feed>