<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.npowned.net/index.php?action=history&amp;feed=atom&amp;title=Module%3ATerritories%2Fdata%2Fdoc</id>
	<title>Module:Territories/data/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.npowned.net/index.php?action=history&amp;feed=atom&amp;title=Module%3ATerritories%2Fdata%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:Territories/data/doc&amp;action=history"/>
	<updated>2026-04-27T22:56:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://wiki.npowned.net/index.php?title=Module:Territories/data/doc&amp;diff=5633&amp;oldid=prev</id>
		<title>Bobogoobo: create</title>
		<link rel="alternate" type="text/html" href="https://wiki.npowned.net/index.php?title=Module:Territories/data/doc&amp;diff=5633&amp;oldid=prev"/>
		<updated>2025-09-08T02:00:22Z</updated>

		<summary type="html">&lt;p&gt;create&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
&lt;br /&gt;
This is a data module to be used with [[mw:Extension:Scribunto/Lua reference manual#mw.loadData|mw.loadData]].&lt;br /&gt;
&lt;br /&gt;
To do: write script to generate since there are so many, didn&amp;#039;t realize when starting.&lt;br /&gt;
&lt;br /&gt;
==How to generate==&lt;br /&gt;
# Edit the module data page and delete everything except the comment at the top and the word &amp;lt;code&amp;gt;return&amp;lt;/code&amp;gt; followed by a space.&lt;br /&gt;
# Go to the [https://www.torn.com/swagger.php#/Torn/37f1828422f3080da21f9eb4aa576686 API v2 page] and have a Public access key ready.&lt;br /&gt;
# Click the &amp;quot;Try it out&amp;quot; button. For ids, select nothing ( &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; ). The remaining fields need to be blank. Paste in your key and Execute.&lt;br /&gt;
# Click the copy button in the response box (not the example below it) and paste into the edit box. Delete the line at the top that starts with &amp;quot;territory&amp;quot;.&lt;br /&gt;
# At the bottom, in the &amp;lt;code&amp;gt;_metadata&amp;lt;/code&amp;gt; object, on the line that says &amp;quot;next&amp;quot;, make a note of the value after &amp;lt;code&amp;gt;offset=&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Delete the whole metadata object as well as the line above it ( &amp;lt;code&amp;gt;],&amp;lt;/code&amp;gt; ), then type a comma at the end of the previous line so it looks like this: ( &amp;lt;code&amp;gt;},&amp;lt;/code&amp;gt; ) and press Enter to create a new line.&lt;br /&gt;
# On the API page, enter the offset value into the offset field and Execute again.&lt;br /&gt;
# This time, only copy everything starting below the line at the top that starts with &amp;quot;territory&amp;quot; (so the single &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; and not the space before it), down to but not including the line that starts with &amp;quot;_metadata&amp;quot;. Also do not include the line above it ( &amp;lt;code&amp;gt;],&amp;lt;/code&amp;gt; ).&lt;br /&gt;
# Paste into the edit box on a new line after the comma you added.&lt;br /&gt;
# Repeat the set of five steps before this one until the &amp;quot;next&amp;quot; line in the metadata does not contain a URL (the offset will be around 4000).&lt;br /&gt;
# The only line following the last set of data should be a single closing brace ( &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt; ) with no indent.&lt;br /&gt;
# Copy the entire contents of the edit box into a text editor and make the following plaintext replacements: &amp;lt;code&amp;gt;  &amp;lt;/code&amp;gt; (two spaces) -&amp;gt; &amp;lt;code&amp;gt;\t&amp;lt;/code&amp;gt; (tab character - how to input depends on editor), &amp;lt;code&amp;gt;[&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;]&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;}&amp;lt;/code&amp;gt;, and regular expression replacement: &amp;lt;code&amp;gt;&amp;quot;(territory|id|sector|size|density|slots|respect|coordinates|x|y|neighbors)&amp;quot;:&amp;lt;/code&amp;gt; -&amp;gt; &amp;lt;code&amp;gt;$1 =&amp;lt;/code&amp;gt;, then unindent everything by one level.&lt;br /&gt;
# Update the date in the comment at the top and save. Keep a backup copy in your text editor in case it fails.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Lua data modules]]&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bobogoobo</name></author>
	</entry>
</feed>