<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AQuestDetails</id>
	<title>Module:QuestDetails - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AQuestDetails"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:QuestDetails&amp;action=history"/>
	<updated>2026-04-30T22:25:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:QuestDetails&amp;diff=34368&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;-- &lt;nowiki&gt; -- {{Quest details}}  local p = {} local yesno = require(&#039;Module:Yesno&#039;) local onmain = require(&#039;Module:Mainonly&#039;).on_main() local buildMap --= require(&#039;Module:Map&#039;).buildMap -- lazy loaded  local title = mw.title.getCurrentTitle()  local difficulties = {     none = &#039;None&#039;,     novice = &#039;Novice&#039;,     intermediate = &#039;Intermediate&#039;,     experienced = &#039;Experienced&#039;,     master = &#039;Master&#039;,     grandmaster = &#039;Grandmaster&#039;,     special = &#039;Special&#039; }  difficulties[&#039;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:QuestDetails&amp;diff=34368&amp;oldid=prev"/>
		<updated>2024-10-16T14:00:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;nowiki&amp;gt; -- {{Quest details}}  local p = {} local yesno = require(&amp;#039;Module:Yesno&amp;#039;) local onmain = require(&amp;#039;Module:Mainonly&amp;#039;).on_main() local buildMap --= require(&amp;#039;Module:Map&amp;#039;).buildMap -- lazy loaded  local title = mw.title.getCurrentTitle()  local difficulties = {     none = &amp;#039;None&amp;#039;,     novice = &amp;#039;Novice&amp;#039;,     intermediate = &amp;#039;Intermediate&amp;#039;,     experienced = &amp;#039;Experienced&amp;#039;,     master = &amp;#039;Master&amp;#039;,     grandmaster = &amp;#039;Grandmaster&amp;#039;,     special = &amp;#039;Special&amp;#039; }  difficulties[&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
-- {{Quest details}}&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local yesno = require(&amp;#039;Module:Yesno&amp;#039;)&lt;br /&gt;
local onmain = require(&amp;#039;Module:Mainonly&amp;#039;).on_main()&lt;br /&gt;
local buildMap --= require(&amp;#039;Module:Map&amp;#039;).buildMap -- lazy loaded&lt;br /&gt;
&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
local difficulties = {&lt;br /&gt;
    none = &amp;#039;None&amp;#039;,&lt;br /&gt;
    novice = &amp;#039;Novice&amp;#039;,&lt;br /&gt;
    intermediate = &amp;#039;Intermediate&amp;#039;,&lt;br /&gt;
    experienced = &amp;#039;Experienced&amp;#039;,&lt;br /&gt;
    master = &amp;#039;Master&amp;#039;,&lt;br /&gt;
    grandmaster = &amp;#039;Grandmaster&amp;#039;,&lt;br /&gt;
    special = &amp;#039;Special&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
difficulties[&amp;#039;1&amp;#039;] = difficulties.novice&lt;br /&gt;
difficulties[&amp;#039;2&amp;#039;] = difficulties.intermediate&lt;br /&gt;
difficulties[&amp;#039;3&amp;#039;] = difficulties.experienced&lt;br /&gt;
difficulties[&amp;#039;4&amp;#039;] = difficulties.master&lt;br /&gt;
difficulties[&amp;#039;5&amp;#039;] = difficulties.special&lt;br /&gt;
difficulties[&amp;#039;6&amp;#039;] = difficulties.grandmaster&lt;br /&gt;
&lt;br /&gt;
function p.details( frame )&lt;br /&gt;
    local _args = frame:getParent().args&lt;br /&gt;
    local tbl = mw.html.create( &amp;#039;table&amp;#039; )&lt;br /&gt;
        :addClass( &amp;#039;questdetails&amp;#039; )&lt;br /&gt;
        -- @todo replace with CSS&lt;br /&gt;
        :attr( &amp;#039;cellspacing&amp;#039;,  &amp;#039;3&amp;#039; )&lt;br /&gt;
    local titleurl = mw.uri.fullUrl( title.fullText, { action = &amp;#039;edit&amp;#039; } )&lt;br /&gt;
    local unknown = &amp;#039;Unknown &amp;lt;small&amp;gt;[&amp;#039; .. tostring( titleurl ) .. &amp;#039; edit]&amp;lt;/small&amp;gt;&amp;#039;&lt;br /&gt;
    local args = {}&lt;br /&gt;
    &lt;br /&gt;
    for k, v in pairs(_args) do&lt;br /&gt;
        if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
            args[k] = v&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local start = args.start or unknown&lt;br /&gt;
    local map = args.startmap or nil&lt;br /&gt;
    local mapplane = map and tonumber( string.match(map, &amp;#039;plane:%s*(%d)$&amp;#039;) ) or 0&lt;br /&gt;
    local difficultylevel = difficulties[string.lower(args.difficulty or &amp;#039;&amp;#039;)]&lt;br /&gt;
    local difficulty = difficultylevel and (&amp;#039;[[Quests/&amp;#039; .. difficultylevel .. &amp;#039;|&amp;#039; .. difficultylevel .. &amp;#039;]]&amp;#039;) or unknown&lt;br /&gt;
    local desc = args.description or unknown&lt;br /&gt;
    local length = args.length or unknown&lt;br /&gt;
    local reqs = args.requirements or &amp;#039;None&amp;#039;&lt;br /&gt;
    local items = args.items or &amp;#039;None&amp;#039;&lt;br /&gt;
    local kills = args.kills or &amp;#039;None&amp;#039;&lt;br /&gt;
    local checklist = items&lt;br /&gt;
    local ironman = args.ironman or unknown&lt;br /&gt;
    if items ~= &amp;#039;None&amp;#039; then&lt;br /&gt;
    	checklist = &amp;#039;&amp;lt;div class=&amp;quot;lighttable checklist no-toggle-parent&amp;quot;&amp;gt;\n&amp;#039;..items..&amp;#039;&amp;lt;/div&amp;gt;&amp;#039; --frame:expandTemplate{ title = &amp;#039;Checklist&amp;#039;, args = { items } }&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- check for being a miniquest&lt;br /&gt;
	local mq = string.match(title:getContent() , &amp;#039;[Ii]nfobox [Mm]iniquest&amp;#039;)&lt;br /&gt;
	buildMap = map and require(&amp;#039;Module:Map&amp;#039;).buildMap&lt;br /&gt;
&lt;br /&gt;
	local mapArgs = {&lt;br /&gt;
		[1] = map,&lt;br /&gt;
		[&amp;#039;title&amp;#039;] = &amp;#039;Start point&amp;#039;,&lt;br /&gt;
		[&amp;#039;plane&amp;#039;] = mapplane,&lt;br /&gt;
		[&amp;#039;mapID&amp;#039;] = &amp;#039;-1&amp;#039;,&lt;br /&gt;
		[&amp;#039;mtype&amp;#039;] = &amp;#039;pin&amp;#039;,&lt;br /&gt;
		[&amp;#039;type&amp;#039;] = &amp;#039;maplink&amp;#039;,&lt;br /&gt;
		[&amp;#039;text&amp;#039;] = &amp;#039;&amp;lt;b&amp;gt;Show on map&amp;lt;/b&amp;gt;&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
    tbl&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Start point&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :wikitext( (mq and &amp;#039;&amp;#039; or &amp;#039;[[File:Quest point icon.png|17px|link=|Map icon]] &amp;#039;) -- miniquests don&amp;#039;t have icon on map&lt;br /&gt;
                	.. start&lt;br /&gt;
                	.. &amp;#039; &amp;#039;&lt;br /&gt;
                	.. ( map and buildMap(mapArgs) or &amp;#039;&amp;#039; ) )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Official difficulty&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :wikitext( difficulty )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Official length&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :wikitext( length )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Description&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :wikitext( desc )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
		:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Requirements&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :addClass(&amp;#039;qc-input&amp;#039;)&lt;br /&gt;
                :addClass(&amp;#039;qc-active&amp;#039;)&lt;br /&gt;
                :newline():newline()&lt;br /&gt;
                :wikitext(reqs)&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Items required&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :newline():newline()&lt;br /&gt;
                :wikitext( checklist )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
            &lt;br /&gt;
    if args.recommended ~= nil and yesno(args.recommended, true) ~= false then&lt;br /&gt;
        tbl&lt;br /&gt;
            :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
                :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                    :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                    :wikitext( &amp;#039;Recommended&amp;#039; )&lt;br /&gt;
                    :done()&lt;br /&gt;
                :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                    :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                    :newline():newline()&lt;br /&gt;
                    :addClass(&amp;#039;qc-active&amp;#039;)&lt;br /&gt;
                    :wikitext( &amp;#039;&amp;lt;div class=&amp;quot;lighttable checklist no-toggle-parent&amp;quot;&amp;gt;\n&amp;#039;..args.recommended..&amp;#039;&amp;lt;/div&amp;gt;&amp;#039;) -- frame:expandTemplate{ title = &amp;#039;Checklist&amp;#039;, args = { args.recommended } } )&lt;br /&gt;
                    :done()&lt;br /&gt;
                :done()&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    tbl&lt;br /&gt;
        :tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            :tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
                :wikitext( &amp;#039;Enemies to defeat&amp;#039; )&lt;br /&gt;
                :done()&lt;br /&gt;
            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                :newline():newline()&lt;br /&gt;
                :wikitext( kills )&lt;br /&gt;
                :done()&lt;br /&gt;
            :done()&lt;br /&gt;
     if args.ironman ~= nil and yesno(args.ironman, true) ~= false then&lt;br /&gt;
        tbl&lt;br /&gt;
        	:tag( &amp;#039;tr&amp;#039; )&lt;br /&gt;
            	:tag( &amp;#039;th&amp;#039; )&lt;br /&gt;
                	:addClass( &amp;#039;questdetails-header&amp;#039; )&lt;br /&gt;
	                :wikitext( &amp;#039;Ironman concerns&amp;#039; )&lt;br /&gt;
	                :done()&lt;br /&gt;
	            :tag( &amp;#039;td&amp;#039; )&lt;br /&gt;
	                :addClass( &amp;#039;questdetails-info&amp;#039; )&lt;br /&gt;
                    :newline():newline()&lt;br /&gt;
	                :wikitext( &amp;#039;&amp;lt;div class=&amp;quot;lighttable checklist no-toggle-parent&amp;quot;&amp;gt;\n&amp;#039;..args.ironman..&amp;#039;&amp;lt;/div&amp;gt;&amp;#039;) -- frame:expandTemplate{ title = &amp;#039;Checklist&amp;#039;, args = { args.ironman }&lt;br /&gt;
	                :done()&lt;br /&gt;
	            :done()&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return tostring( tbl ) .. catsadd( difficultylevel, length ) .. smw(frame,_args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function smw(frame,args)&lt;br /&gt;
	if not onmain or title.text:find(&amp;#039;/[Ss]peedrun&amp;#039;) or title.text:find(&amp;#039;/[Qq]uick&amp;#039;) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- more to come&lt;br /&gt;
	local err = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	err:addClass(&amp;#039;hidden&amp;#039;):css(&amp;#039;display&amp;#039;,&amp;#039;none&amp;#039;)&lt;br /&gt;
	local haserr = false&lt;br /&gt;
	local info = &amp;#039;&amp;#039;&lt;br /&gt;
	local smwJSON = {&lt;br /&gt;
		name = title.text,&lt;br /&gt;
		desc = args.description or nil,&lt;br /&gt;
		difficulty = difficulties[string.lower(args.difficulty or &amp;#039;&amp;#039;)],&lt;br /&gt;
		start = args.start or nil,&lt;br /&gt;
		length = args.length or nil,&lt;br /&gt;
		requirements = args.requirements or &amp;#039;None&amp;#039;,&lt;br /&gt;
		items = args.items or &amp;#039;None&amp;#039;,&lt;br /&gt;
		kills = args.kills or &amp;#039;None&amp;#039;,&lt;br /&gt;
		ironman = args.ironman or nil&lt;br /&gt;
	}&lt;br /&gt;
	local jsongood, encsmwJSON = pcall(mw.text.jsonEncode, smwJSON)&lt;br /&gt;
	&lt;br /&gt;
	if jsongood then&lt;br /&gt;
		-- for easier debug, please do not remove&lt;br /&gt;
		encsmwJSON = mw.text.nowiki(encsmwJSON)&lt;br /&gt;
		local div = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
		div	:addClass(&amp;#039;hidden&amp;#039;)&lt;br /&gt;
			:css(&amp;#039;display&amp;#039;, &amp;#039;none&amp;#039;)&lt;br /&gt;
			:wikitext(&amp;#039;[[Quest JSON::&amp;#039;..encsmwJSON..&amp;#039;]]&amp;#039;)&lt;br /&gt;
		info = frame:preprocess(tostring(div))&lt;br /&gt;
	else&lt;br /&gt;
		haserr = true&lt;br /&gt;
		err:wikitext(&amp;#039;Error setting SMW JSON, string: &amp;#039; .. mw.dumpObject(smwJSON))&lt;br /&gt;
	end&lt;br /&gt;
	if not haserr then&lt;br /&gt;
		err = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local smw = {}&lt;br /&gt;
	if args.description then&lt;br /&gt;
    	smw[&amp;#039;Quest Description&amp;#039;] = args.description&lt;br /&gt;
    end&lt;br /&gt;
	if args.difficulty then&lt;br /&gt;
    	smw[&amp;#039;Quest Official difficulty&amp;#039;] = difficulties[string.lower(args.difficulty)]&lt;br /&gt;
    end&lt;br /&gt;
	if args.start then&lt;br /&gt;
    	smw[&amp;#039;Quest Start point&amp;#039;] = args.start&lt;br /&gt;
    end&lt;br /&gt;
	if args.length then&lt;br /&gt;
    	smw[&amp;#039;Quest Official length&amp;#039;] = args.length&lt;br /&gt;
    end&lt;br /&gt;
    if(args.ironman) then&lt;br /&gt;
    	smw[&amp;#039;Quest Ironman concerns&amp;#039;] = args.ironman&lt;br /&gt;
    end&lt;br /&gt;
	smw[&amp;#039;Quest Requirements&amp;#039;] = args.requirements or &amp;#039;None&amp;#039;&lt;br /&gt;
	smw[&amp;#039;Quest Items required&amp;#039;] = args.items or &amp;#039;None&amp;#039;&lt;br /&gt;
	smw[&amp;#039;Quest Enemies to defeat&amp;#039;] = args.kills or &amp;#039;None&amp;#039;&lt;br /&gt;
    mw.smw.set(smw)&lt;br /&gt;
	return tostring(info) .. tostring(err)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function catsadd(difficulty, length)&lt;br /&gt;
	if not onmain or title.text:find(&amp;#039;/[Ss]peedrun&amp;#039;) or title.text:find(&amp;#039;/[Qq]uick&amp;#039;) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local cats = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if difficulty then&lt;br /&gt;
		cats = cats .. &amp;#039;[[Category:&amp;#039; .. difficulty .. &amp;#039; quests]]&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		cats = cats .. &amp;#039;[[Category:Needs official difficulty added]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if not length then&lt;br /&gt;
		cats = cats .. &amp;#039;[[Category:Needs official length added]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return cats&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>Alex</name></author>
	</entry>
</feed>