<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.thefortunebringers.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AModule_toc</id>
	<title>Module:Module toc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.thefortunebringers.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AModule_toc"/>
	<link rel="alternate" type="text/html" href="http://www.thefortunebringers.com/index.php?title=Module:Module_toc&amp;action=history"/>
	<updated>2026-05-02T17:21:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://www.thefortunebringers.com/index.php?title=Module:Module_toc&amp;diff=83&amp;oldid=prev</id>
		<title>Dweller: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://www.thefortunebringers.com/index.php?title=Module:Module_toc&amp;diff=83&amp;oldid=prev"/>
		<updated>2025-05-20T01:10:21Z</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 20:10, 19 May 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key dndwiki:diff:1.41:old-82:rev-83 --&gt;
&lt;/table&gt;</summary>
		<author><name>Dweller</name></author>
	</entry>
	<entry>
		<id>http://www.thefortunebringers.com/index.php?title=Module:Module_toc&amp;diff=82&amp;oldid=prev</id>
		<title>StarCitizen&gt;Alistar Bot: /* top */ use string instead of mw.ustring, replaced: mw.ustring → string (7)</title>
		<link rel="alternate" type="text/html" href="http://www.thefortunebringers.com/index.php?title=Module:Module_toc&amp;diff=82&amp;oldid=prev"/>
		<updated>2024-10-23T22:48:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;top: &lt;/span&gt; use string instead of mw.ustring, replaced: mw.ustring → string (7)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Imported from: https://runescape.wiki/w/Module:Module%20toc&lt;br /&gt;
&lt;br /&gt;
-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function getNewlineLocations( content )&lt;br /&gt;
    local locs = {}&lt;br /&gt;
    local pos = 0&lt;br /&gt;
&lt;br /&gt;
    repeat&lt;br /&gt;
        pos = string.find( content, &amp;#039;\n&amp;#039;, pos + 1, true )&lt;br /&gt;
        table.insert( locs, pos )&lt;br /&gt;
    until not pos&lt;br /&gt;
&lt;br /&gt;
    return locs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function findLineNumber( pos, newLineLocs )&lt;br /&gt;
    local max = #newLineLocs&lt;br /&gt;
    local min = 1&lt;br /&gt;
&lt;br /&gt;
    repeat&lt;br /&gt;
        local i = math.ceil( (max + min) / 2 )&lt;br /&gt;
        if newLineLocs[i] &amp;lt; pos then&lt;br /&gt;
            min = i&lt;br /&gt;
        elseif newLineLocs[i] &amp;gt;= pos then&lt;br /&gt;
            max = i&lt;br /&gt;
        end&lt;br /&gt;
    until newLineLocs[i] &amp;gt; pos and (newLineLocs[i - 1] or 0) &amp;lt; pos&lt;br /&gt;
&lt;br /&gt;
    return max&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getFunctionLocations( content )&lt;br /&gt;
    local locs = {}&lt;br /&gt;
    local newLineLocs = getNewlineLocations( content )&lt;br /&gt;
&lt;br /&gt;
    local start = 0&lt;br /&gt;
    repeat&lt;br /&gt;
        local name&lt;br /&gt;
        name, start = string.match( content, &amp;#039;%sfunction%s+([^%s%(]+)%s*%(()&amp;#039;, start + 1 )&lt;br /&gt;
        if start then&lt;br /&gt;
            table.insert( locs, { name=name, line = findLineNumber( start, newLineLocs ) } )&lt;br /&gt;
        end&lt;br /&gt;
    until not start&lt;br /&gt;
&lt;br /&gt;
    start = 0&lt;br /&gt;
    repeat&lt;br /&gt;
        local name&lt;br /&gt;
        name, start = string.match( content, &amp;#039;%s([^%s=])%s*=%s*function%s*%(()&amp;#039;, start + 1 )&lt;br /&gt;
        if start then&lt;br /&gt;
            table.insert( locs, { name=name, line = findLineNumber( start, newLineLocs ) } )&lt;br /&gt;
        end&lt;br /&gt;
    until not start&lt;br /&gt;
&lt;br /&gt;
    return locs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main()&lt;br /&gt;
    local title = mw.title.getCurrentTitle()&lt;br /&gt;
    local moduleName = string.gsub( title.text, &amp;#039;/[Dd]oc$&amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
    if not title:inNamespaces( 828 ) then&lt;br /&gt;
        return &amp;#039;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local fullModuleName = string.gsub( title.fullText, &amp;#039;/[Dd]oc$&amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
    local content = mw.title.new( fullModuleName ):getContent()&lt;br /&gt;
&lt;br /&gt;
    if not content then&lt;br /&gt;
        return &amp;#039;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local function substMutilineComment( match )&lt;br /&gt;
        local lineCount = #getNewlineLocations( match )&lt;br /&gt;
        return string.rep( &amp;#039;\n&amp;#039;, lineCount ) or &amp;#039;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    content = content:gsub( &amp;#039;(%-%-%[(=-)%[.-%]%2%])&amp;#039;, substMutilineComment ):gsub( &amp;#039;%-%-[^\n]*&amp;#039;, &amp;#039;&amp;#039; ) -- Strip comments&lt;br /&gt;
    local functionLocs = getFunctionLocations( content )&lt;br /&gt;
&lt;br /&gt;
    table.sort( functionLocs, function(lhs, rhs) return lhs.line &amp;lt; rhs.line end )&lt;br /&gt;
&lt;br /&gt;
    if #functionLocs == 0 then&lt;br /&gt;
        return &amp;#039;&amp;#039;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local res = {}&lt;br /&gt;
    for _, func in ipairs( functionLocs ) do&lt;br /&gt;
        table.insert( res, string.format( &amp;#039;L %d &amp;amp;mdash; [%s#L-%d %s]&amp;#039;, func.line, title:fullUrl():gsub( &amp;#039;/[Dd]oc$&amp;#039;, &amp;#039;&amp;#039; ), func.line,  func.name ) )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local tbl = mw.html.create( &amp;#039;table&amp;#039; ):addClass( &amp;#039;wikitable mw-collapsible mw-collapsed&amp;#039; )&lt;br /&gt;
    tbl:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; ):wikitext( &amp;#039;Function list&amp;#039; ):done()&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; ):wikitext( table.concat( res, &amp;#039;&amp;lt;br&amp;gt;&amp;#039; ) )&lt;br /&gt;
&lt;br /&gt;
    return tostring( tbl )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
-- &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>StarCitizen&gt;Alistar Bot</name></author>
	</entry>
</feed>