<?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%3ADPLlua%2Fdoc</id>
	<title>Module:DPLlua/doc - 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%3ADPLlua%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:DPLlua/doc&amp;action=history"/>
	<updated>2026-04-30T13:43:18Z</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:DPLlua/doc&amp;diff=354&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;{{Documentation}} Uses Template:DPLlua helper to make it possible to include all parameters of a template while maintaining good performance.   {{Helper module|name=DPLlua |fname1 = ask(&amp;nbsp;...&amp;nbsp;) |ftype1 = tables |fuse1 = &lt;code&gt;ask&lt;/code&gt; takes a series of tables each containing the settings for a DPL query; it will return the same number of result tables as input tables. All formatting settings are stripped from the config. If the config does not contains &lt;co...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:DPLlua/doc&amp;diff=354&amp;oldid=prev"/>
		<updated>2024-10-11T21:00:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Documentation}} Uses &lt;a href=&quot;/w/Template:DPLlua_helper&quot; title=&quot;Template:DPLlua helper&quot;&gt;Template:DPLlua helper&lt;/a&gt; to make it possible to include all parameters of a template while maintaining good performance.   {{Helper module|name=DPLlua |fname1 = ask( ... ) |ftype1 = tables |fuse1 = &amp;lt;code&amp;gt;ask&amp;lt;/code&amp;gt; takes a series of tables each containing the settings for a DPL query; it will return the same number of result tables as input tables. All formatting settings are stripped from the config. If the config does not contains &amp;lt;co...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation}}&lt;br /&gt;
Uses [[Template:DPLlua helper]] to make it possible to include all parameters of a template while maintaining good performance. &lt;br /&gt;
&lt;br /&gt;
{{Helper module|name=DPLlua&lt;br /&gt;
|fname1 = ask(&amp;amp;nbsp;...&amp;amp;nbsp;)&lt;br /&gt;
|ftype1 = tables&lt;br /&gt;
|fuse1 = &amp;lt;code&amp;gt;ask&amp;lt;/code&amp;gt; takes a series of tables each containing the settings for a DPL query; it will return the same number of result tables as input tables. All formatting settings are stripped from the config. If the config does not contains &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt;, the result will be a simple list of page names. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;lt;pagename#1&amp;gt;,&lt;br /&gt;
	&amp;lt;pagename#2&amp;gt;,&lt;br /&gt;
	&amp;lt;pagename#3&amp;gt;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
A query with an &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; of the form &amp;lt;code&amp;gt;include = &amp;#039;{template#1}:1:2:param1:param2, {template#2}:3:param1, %0&amp;#039;&amp;lt;/code&amp;gt; will give a result like&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	[&amp;#039;include&amp;#039;] = {&lt;br /&gt;
		[&amp;#039;template#1&amp;#039;] = {&lt;br /&gt;
			[1] = val#1,&lt;br /&gt;
			[2] = val#2,&lt;br /&gt;
			[&amp;#039;param1&amp;#039;] = val#3,&lt;br /&gt;
			[&amp;#039;param2&amp;#039;] = val#4,&lt;br /&gt;
		},&lt;br /&gt;
		[&amp;#039;template#2&amp;#039;] = {&lt;br /&gt;
			[3] = val#5,&lt;br /&gt;
			[&amp;#039;param1&amp;#039;] = val#6,&lt;br /&gt;
		},&lt;br /&gt;
		[&amp;#039;%0&amp;#039;] = val#7&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;#039;title&amp;#039;] = &amp;lt;pagename&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can also do &amp;lt;code&amp;gt;include = &amp;#039;{some template}&amp;#039;&amp;lt;/code&amp;gt; which will include all parameters of that template in their unexpanded form (templates are not expanded but some content in parser tags is placed in strip markers).&lt;br /&gt;
&lt;br /&gt;
If the config value &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; is larger than 500 it will automatically generate multiple DPL queries with offsets and their outputs will be combined in the returned result.&lt;br /&gt;
&lt;br /&gt;
The output contains a &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; field so you don&amp;#039;t need to use &amp;lt;code&amp;gt;%DPLTIME%&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the DPL throws an error it will be available in the &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt; field of the output.&lt;br /&gt;
&lt;br /&gt;
Differences with normal DPL:&lt;br /&gt;
* All formatting options are ignored&lt;br /&gt;
* Surrogate templates (e.g. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;include = &amp;#039;{template|other template}&amp;#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; are ignored&lt;br /&gt;
* Using &amp;lt;code&amp;gt;include = &amp;#039;{template}&amp;#039;&amp;lt;/code&amp;gt; will include all the arguments of that template instead of expanding the template&lt;br /&gt;
* The parameter &amp;lt;code&amp;gt;count&amp;lt;/code&amp;gt; can go higher than 500&lt;br /&gt;
* When the value of a parameter is a table it will be expanded into multiple lines. E.g. doing &amp;lt;code&amp;gt;notcategory = {val#1, val#2}&amp;lt;/code&amp;gt; will expand into &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
|notcategory = val#1&lt;br /&gt;
|notcategory = val#2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note of warning, if you include content containing &amp;lt;code&amp;gt;§&amp;lt;/code&amp;gt; symbols the result may be unreliable. If you include a whole template (e.g. &amp;lt;code&amp;gt;include = &amp;#039;{some template}&amp;#039;&amp;lt;/code&amp;gt;), content inside strip markers (not nowiki) can&amp;#039;t be cleaned up inside lua so pipe characters (&amp;lt;code&amp;gt;&amp;amp;#124;&amp;lt;/code&amp;gt;) will be replaced with &amp;lt;code&amp;gt;§&amp;lt;/code&amp;gt; characters and the &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; characters are replaced by &amp;lt;code&amp;gt;&amp;amp;#10100;&amp;lt;/code&amp;gt; (U+2774) and &amp;lt;code&amp;gt;&amp;amp;#10101;&amp;lt;/code&amp;gt; (U+2775). Use &amp;lt;code&amp;gt;include = &amp;#039;{some template}, {some template}:1:2:3&amp;#039;&amp;lt;/code&amp;gt; instead for the problem parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;#039;lua&amp;#039;&amp;gt;&lt;br /&gt;
local dpl = require( &amp;#039;Module:DPLlua&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
local a, b = dpl.ask( {&lt;br /&gt;
		namespace = &amp;#039;&amp;#039;,&lt;br /&gt;
		linksto = &amp;#039;Treasure trails&amp;#039;,&lt;br /&gt;
		distinct = &amp;#039;strict&amp;#039;,&lt;br /&gt;
		ordermethod = &amp;#039;title&amp;#039;,&lt;br /&gt;
		count = 5,&lt;br /&gt;
		ignorecase = true&lt;br /&gt;
	},{&lt;br /&gt;
		namespace = &amp;#039;&amp;#039;,&lt;br /&gt;
		uses = &amp;#039;Template:Recipe&amp;#039;,&lt;br /&gt;
		count = 1,&lt;br /&gt;
		include = &amp;#039;{Recipe},{Infobox Item}&amp;#039;,&lt;br /&gt;
		ignorecase = true&lt;br /&gt;
	} )&lt;br /&gt;
mw.logObject(a)&lt;br /&gt;
mw.logObject(b)&lt;br /&gt;
--[=[&lt;br /&gt;
table#1 {&lt;br /&gt;
  &amp;quot;(beginner)&amp;quot;,&lt;br /&gt;
  &amp;quot;(easy)&amp;quot;,&lt;br /&gt;
  &amp;quot;(elite)&amp;quot;,&lt;br /&gt;
  &amp;quot;(g)&amp;quot;,&lt;br /&gt;
  &amp;quot;(hard)&amp;quot;,&lt;br /&gt;
  [&amp;quot;time&amp;quot;] = 0.0541,&lt;br /&gt;
}&lt;br /&gt;
table#1 {&lt;br /&gt;
  table#2 {&lt;br /&gt;
    [&amp;quot;include&amp;quot;] = table#3 {&lt;br /&gt;
      [&amp;quot;Infobox Item&amp;quot;] = table#4 {&lt;br /&gt;
        [&amp;quot;destroy&amp;quot;] = &amp;quot;Drop&amp;quot;,&lt;br /&gt;
        [&amp;quot;equipable&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;examine&amp;quot;] = &amp;quot;It&amp;#039;s a bar of &amp;#039;perfect&amp;#039; gold.&amp;quot;,&lt;br /&gt;
        [&amp;quot;id&amp;quot;] = &amp;quot;2365&amp;quot;,&lt;br /&gt;
        [&amp;quot;image&amp;quot;] = &amp;quot;[[File:&amp;#039;perfect&amp;#039; gold bar.png]]&amp;quot;,&lt;br /&gt;
        [&amp;quot;members&amp;quot;] = &amp;quot;Yes&amp;quot;,&lt;br /&gt;
        [&amp;quot;name&amp;quot;] = &amp;quot;&amp;#039;perfect&amp;#039; gold bar&amp;quot;,&lt;br /&gt;
        [&amp;quot;noteable&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;placeholder&amp;quot;] = &amp;quot;Yes&amp;quot;,&lt;br /&gt;
        [&amp;quot;quest&amp;quot;] = &amp;quot;[[Family Crest]]&amp;quot;,&lt;br /&gt;
        [&amp;quot;release&amp;quot;] = &amp;quot;[[9 April]] [[2002]]&amp;quot;,&lt;br /&gt;
        [&amp;quot;stackable&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;tradeable&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;update&amp;quot;] = &amp;quot;New members quest online!&amp;quot;,&lt;br /&gt;
        [&amp;quot;value&amp;quot;] = &amp;quot;300&amp;quot;,&lt;br /&gt;
        [&amp;quot;weight&amp;quot;] = &amp;quot;1.814&amp;quot;,&lt;br /&gt;
      },&lt;br /&gt;
      [&amp;quot;Recipe&amp;quot;] = table#5 {&lt;br /&gt;
        [&amp;quot;facilities&amp;quot;] = &amp;quot;Furnace&amp;quot;,&lt;br /&gt;
        [&amp;quot;mat1&amp;quot;] = &amp;quot;&amp;#039;perfect&amp;#039; gold ore&amp;quot;,&lt;br /&gt;
        [&amp;quot;mat1cost&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;members&amp;quot;] = &amp;quot;Yes&amp;quot;,&lt;br /&gt;
        [&amp;quot;notes&amp;quot;] = &amp;quot;Partial completion of [[Family Crest]]&amp;quot;,&lt;br /&gt;
        [&amp;quot;outputcost&amp;quot;] = &amp;quot;No&amp;quot;,&lt;br /&gt;
        [&amp;quot;outputname&amp;quot;] = &amp;quot;&amp;#039;perfect&amp;#039; gold bar&amp;quot;,&lt;br /&gt;
        [&amp;quot;skill1&amp;quot;] = &amp;quot;Smithing&amp;quot;,&lt;br /&gt;
        [&amp;quot;skill1exp&amp;quot;] = &amp;quot;22.5&amp;quot;,&lt;br /&gt;
        [&amp;quot;skill1lvl&amp;quot;] = &amp;quot;40&amp;quot;,&lt;br /&gt;
        [&amp;quot;ticks&amp;quot;] = &amp;quot;4&amp;quot;,&lt;br /&gt;
      },&lt;br /&gt;
    },&lt;br /&gt;
    [&amp;quot;title&amp;quot;] = &amp;quot;&amp;#039;perfect&amp;#039; gold bar&amp;quot;,&lt;br /&gt;
  },&lt;br /&gt;
  [&amp;quot;time&amp;quot;] = 0.0541,&lt;br /&gt;
}&lt;br /&gt;
]=]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>