<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wildermyth.com/w/index.php?action=history&amp;feed=atom&amp;title=Calamity_track%2FScript</id>
	<title>Calamity track/Script - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wildermyth.com/w/index.php?action=history&amp;feed=atom&amp;title=Calamity_track%2FScript"/>
	<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;action=history"/>
	<updated>2026-09-24T19:21:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20858&amp;oldid=prev</id>
		<title>Sten at 21:38, 5 March 2022</title>
		<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20858&amp;oldid=prev"/>
		<updated>2022-03-05T21:38:58Z</updated>

		<summary type="html">&lt;p&gt;&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 21:38, 5 March 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a [https://www.python.org/downloads/ Python] script to generate the [[calamity track]] table. Copy the code in the box below into a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calamityTable&lt;/del&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; (or whatever you want) inside the &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;Wildermyth&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; directory. Then run it by calling &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;python &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calamityTable&lt;/del&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; from the command line. It will create a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calamityTable&lt;/del&gt;.txt&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which is wiki-formatted and can be pasted into the [[calamity track]] page.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This is a [https://www.python.org/downloads/ Python] script to generate the [[calamity track]] table. Copy the code in the box below into a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikiCalamityTable&lt;/ins&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; (or whatever you want) inside the &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;Wildermyth&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; directory. Then run it by calling &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;python &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikiCalamityTable&lt;/ins&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; from the command line. It will create a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikiCalamityTable&lt;/ins&gt;.txt&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which is wiki-formatted and can be pasted into the [[calamity track]] page.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| role=&amp;quot;presentation&amp;quot; class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| role=&amp;quot;presentation&amp;quot; class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calamityTable&lt;/del&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikiCalamityTable&lt;/ins&gt;.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l112&quot;&gt;Line 112:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 112:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;Last updated [[%s]] using [[/Script|this script]].\n&amp;#039;%version[:-1]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;Last updated [[%s]] using [[/Script|this script]].\n&amp;#039;%version[:-1]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with open(&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;calamityTable&lt;/del&gt;.txt&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with open(&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;wikiCalamityTable&lt;/ins&gt;.txt&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   f.write(string)&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   f.write(string)&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wildermyth_com-wm_wiki_:diff::1.12:old-20673:rev-20858 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sten</name></author>
	</entry>
	<entry>
		<id>https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20673&amp;oldid=prev</id>
		<title>Sten at 12:50, 20 February 2022</title>
		<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20673&amp;oldid=prev"/>
		<updated>2022-02-20T12:50:41Z</updated>

		<summary type="html">&lt;p&gt;&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 12:50, 20 February 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if k == 0:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if k == 0:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;onlyIfFlavorHasCards&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;onlyIfFlavorHasCards&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],{&amp;#039;name&amp;#039;:cardName &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+ &lt;/del&gt;&amp;#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%s&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%&lt;/del&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1,&amp;#039;position&amp;#039;:j})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],{&amp;#039;name&amp;#039;:cardName&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numeral&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1,&amp;#039;position&amp;#039;:j})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,0,{&amp;#039;name&amp;#039;:cardName &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+ &lt;/del&gt;&amp;#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%s&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%&lt;/del&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1,&amp;#039;position&amp;#039;:j})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,0,{&amp;#039;name&amp;#039;:cardName&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numeral&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1,&amp;#039;position&amp;#039;:j})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;trackAdvanceThresholds&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;trackAdvanceThresholds&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],{&amp;#039;name&amp;#039;:cardName &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;+ &lt;/del&gt;&amp;#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%s&lt;/del&gt;&amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;%&lt;/del&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],{&amp;#039;name&amp;#039;:cardName&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;numeral&lt;/ins&gt;&amp;#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/ins&gt;cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot;&gt;Line 96:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if &amp;#039;position&amp;#039; in card and card[&amp;#039;position&amp;#039;] &amp;lt; 2:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if &amp;#039;position&amp;#039; in card and card[&amp;#039;position&amp;#039;] &amp;lt; 2:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         string += card[&amp;#039;name&amp;#039;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         string += &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;[[%s|%s]] %s&amp;#039;%(card[&amp;#039;cards&amp;#039;][0],&lt;/ins&gt;card[&amp;#039;name&amp;#039;]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,card[&amp;#039;numeral&amp;#039;])&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if &amp;#039;position&amp;#039; in card and card[&amp;#039;position&amp;#039;] &amp;lt; 2:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if &amp;#039;position&amp;#039; in card and card[&amp;#039;position&amp;#039;] &amp;lt; 2:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wildermyth_com-wm_wiki_:diff::1.12:old-20668:rev-20673 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sten</name></author>
	</entry>
	<entry>
		<id>https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20668&amp;oldid=prev</id>
		<title>Sten at 12:34, 20 February 2022</title>
		<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20668&amp;oldid=prev"/>
		<updated>2022-02-20T12:34:53Z</updated>

		<summary type="html">&lt;p&gt;&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 12:34, 20 February 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if k == 0:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if k == 0:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;onlyIfFlavorHasCards&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;onlyIfFlavorHasCards&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&amp;#039;position&amp;#039;:j&lt;/ins&gt;})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             max_cards = max(tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],max_cards)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,0,{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             add_entry(card_list,flavor,0,{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&amp;#039;position&amp;#039;:j&lt;/ins&gt;})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         else:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         else:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;trackAdvanceThresholds&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           if &amp;#039;trackAdvanceThresholds&amp;#039; in tracks[j]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l79&quot;&gt;Line 79:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 79:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;In this way, each faction has a [[calamity track]] consisting of successively more dangerous cards.\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;In this way, each faction has a [[calamity track]] consisting of successively more dangerous cards.\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;==Table==\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;==Table==\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;If drawn within a [[mission]], each card typically generates a number of the specified monster equal to the card\&amp;#039;s roman numeral. There are some exceptions, which are noted in the table.\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;If drawn within a [[mission]], each card typically generates a number of the specified monster equal to the card\&amp;#039;s roman numeral. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;string += &amp;#039;&lt;/ins&gt;There are some exceptions, which are noted in the table&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. &amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;string += &amp;#039;Also, \&amp;#039;\&amp;#039;italicized\&amp;#039;\&amp;#039; cards are not drawn as [[calamity]] cards but are instead available from a campaign\&amp;#039;s outset&lt;/ins&gt;.\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&amp;quot;\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&amp;quot;\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;! Threshold&amp;lt;br&amp;gt;cards !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]]\n&amp;#039;%tuple(card_list)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;! Threshold&amp;lt;br&amp;gt;cards !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]]\n&amp;#039;%tuple(card_list)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l92&quot;&gt;Line 92:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 94:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if j &amp;gt; 0:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if j &amp;gt; 0:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;#039;&amp;lt;br&amp;gt;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;#039;&amp;lt;br&amp;gt;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if &#039;position&#039; in card and card[&#039;position&#039;] &amp;lt; 2:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          string += &quot;&#039;&#039;&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         string += card[&amp;#039;name&amp;#039;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         string += card[&amp;#039;name&amp;#039;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if &#039;position&#039; in card and card[&#039;position&#039;] &amp;lt; 2:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          string += &quot;&#039;&#039;&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if len(set(card[&amp;#039;cards&amp;#039;])) &amp;gt; 1 or len(card[&amp;#039;cards&amp;#039;]) != card[&amp;#039;count&amp;#039;]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if len(set(card[&amp;#039;cards&amp;#039;])) &amp;gt; 1 or len(card[&amp;#039;cards&amp;#039;]) != card[&amp;#039;count&amp;#039;]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;#039;&amp;lt;ref&amp;gt;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           string += &amp;#039;&amp;lt;ref&amp;gt;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l104&quot;&gt;Line 104:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 110:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;|}\n\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;|}\n\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;==Notes==\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;==Notes==\n&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;small&amp;gt;&lt;/del&gt;Last updated [[%s]] using [[/Script|this script]].&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/small&amp;gt;&lt;/del&gt;\n&amp;#039;%version[:-1]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;string += &amp;#039;Last updated [[%s]] using [[/Script|this script]].\n&amp;#039;%version[:-1]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with open(&amp;#039;calamityTable.txt&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;with open(&amp;#039;calamityTable.txt&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   f.write(string)&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   f.write(string)&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sten</name></author>
	</entry>
	<entry>
		<id>https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20665&amp;oldid=prev</id>
		<title>Sten: Created page with &quot;This is a [https://www.python.org/downloads/ Python] script to generate the calamity track table. Copy the code in the box below into a text file named &#039;&#039;&#039;&lt;nowiki&gt;calamity...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wildermyth.com/w/index.php?title=Calamity_track/Script&amp;diff=20665&amp;oldid=prev"/>
		<updated>2022-02-20T12:03:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This is a [https://www.python.org/downloads/ Python] script to generate the &lt;a href=&quot;/wiki/Calamity_track&quot; title=&quot;Calamity track&quot;&gt;calamity track&lt;/a&gt; table. Copy the code in the box below into a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;calamity...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a [https://www.python.org/downloads/ Python] script to generate the [[calamity track]] table. Copy the code in the box below into a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;calamityTable.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; (or whatever you want) inside the &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;Wildermyth&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; directory. Then run it by calling &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;python calamityTable.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039; from the command line. It will create a text file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;calamityTable.txt&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;, which is wiki-formatted and can be pasted into the [[calamity track]] page.&lt;br /&gt;
&lt;br /&gt;
{| role=&amp;quot;presentation&amp;quot; class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;nowiki&amp;gt;calamityTable.py&amp;lt;/nowiki&amp;gt;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;import json&lt;br /&gt;
from glob import glob&lt;br /&gt;
&lt;br /&gt;
deck_file = &amp;#039;assets/data/generation/monsterDecks.json&amp;#039;&lt;br /&gt;
name_file = &amp;#039;assets/text/dynamic/dynamic.properties&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
monsterNames = {}&lt;br /&gt;
cardNames = {}&lt;br /&gt;
flavorNames = {}&lt;br /&gt;
cardNumbers = {}&lt;br /&gt;
with open(name_file,&amp;#039;r&amp;#039;,encoding=&amp;#039;utf8&amp;#039;) as f:&lt;br /&gt;
  lines = f.readlines()&lt;br /&gt;
  for line in lines:&lt;br /&gt;
    if line[0] == &amp;#039;#&amp;#039;:&lt;br /&gt;
      continue&lt;br /&gt;
    try:&lt;br /&gt;
      key,val = line.split(&amp;#039;=&amp;#039;)&lt;br /&gt;
    except:&lt;br /&gt;
      continue&lt;br /&gt;
    try:&lt;br /&gt;
      key_split = key.split(&amp;#039;.&amp;#039;)&lt;br /&gt;
    except:&lt;br /&gt;
      continue&lt;br /&gt;
    if len(key_split) == 2 and key_split[-1] == &amp;#039;name&amp;#039;:&lt;br /&gt;
      monsterNames[key_split[0]] = val[:-1]&lt;br /&gt;
    elif len(key_split) == 2 and key_split[0] == &amp;#039;monsterCardName&amp;#039;:&lt;br /&gt;
      cardNames[key_split[-1]] = val[:-1]&lt;br /&gt;
    elif len(key_split) == 2 and key_split[1] == &amp;#039;plural&amp;#039;:&lt;br /&gt;
      flavorNames[key_split[0]] = val[:-1]&lt;br /&gt;
    elif len(key_split) == 3 and key_split[0] == &amp;#039;monsterCard&amp;#039; and key_split[1] == &amp;#039;nameFormula&amp;#039;:&lt;br /&gt;
      cardNumbers[int(key_split[2])] = val[4:-1]&lt;br /&gt;
&lt;br /&gt;
with open(&amp;#039;version.txt&amp;#039;,&amp;#039;r&amp;#039;,encoding=&amp;#039;utf8&amp;#039;) as f:&lt;br /&gt;
  lines = f.readlines()&lt;br /&gt;
  version = lines[0]&lt;br /&gt;
string = &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
def add_entry(card_list,flavor,i,entry):&lt;br /&gt;
  try:&lt;br /&gt;
    card_list[flavor][i] += [entry]&lt;br /&gt;
  except:&lt;br /&gt;
    card_list[flavor] += [[] for _ in range(i-len(card_list[flavor])+1)]&lt;br /&gt;
    card_list[flavor][i] += [entry]&lt;br /&gt;
&lt;br /&gt;
card_list = {}&lt;br /&gt;
max_cards = 0 # per faction&lt;br /&gt;
with open(deck_file) as f:&lt;br /&gt;
  data = json.load(f)&lt;br /&gt;
  for i in range(len(data)):&lt;br /&gt;
    flavor = flavorNames[data[i][&amp;#039;groupFlavor&amp;#039;]]&lt;br /&gt;
    tracks = data[i][&amp;#039;tracks&amp;#039;]&lt;br /&gt;
    card_list[flavor] = []&lt;br /&gt;
    for j in range(len(tracks)):&lt;br /&gt;
      cardName = cardNames[tracks[j][&amp;#039;name&amp;#039;]]&lt;br /&gt;
      cards = tracks[j][&amp;#039;cards&amp;#039;]&lt;br /&gt;
      for k in range(len(cards)):&lt;br /&gt;
        monsters = [monsterNames[c] for c in cards[k]]&lt;br /&gt;
        if k == 0:&lt;br /&gt;
          if &amp;#039;onlyIfFlavorHasCards&amp;#039; in tracks[j]:&lt;br /&gt;
            add_entry(card_list,flavor,tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;br /&gt;
            max_cards = max(tracks[j][&amp;#039;onlyIfFlavorHasCards&amp;#039;],max_cards)&lt;br /&gt;
          else:&lt;br /&gt;
            add_entry(card_list,flavor,0,{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;br /&gt;
        else:&lt;br /&gt;
          if &amp;#039;trackAdvanceThresholds&amp;#039; in tracks[j]:&lt;br /&gt;
            add_entry(card_list,flavor,tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],{&amp;#039;name&amp;#039;:cardName + &amp;#039; %s&amp;#039;%cardNumbers[k],&amp;#039;cards&amp;#039;:monsters,&amp;#039;count&amp;#039;:k+1})&lt;br /&gt;
            max_cards = max(tracks[j][&amp;#039;trackAdvanceThresholds&amp;#039;][k-1],max_cards)&lt;br /&gt;
          else:&lt;br /&gt;
            pass&lt;br /&gt;
&lt;br /&gt;
string = &amp;#039;Many [[calamity]] cards introduce new [[monster]]s or increase the number of monsters that spawn within a [[mission]]. &amp;#039;&lt;br /&gt;
string += &amp;#039;These cards can only be drawn if the associated [[faction]] holds a number of calamity cards that meets or exceeds some threshold. &amp;#039;&lt;br /&gt;
string += &amp;#039;In this way, each faction has a [[calamity track]] consisting of successively more dangerous cards.\n&amp;#039;&lt;br /&gt;
string += &amp;#039;==Table==\n&amp;#039;&lt;br /&gt;
string += &amp;#039;If drawn within a [[mission]], each card typically generates a number of the specified monster equal to the card\&amp;#039;s roman numeral. There are some exceptions, which are noted in the table.\n&amp;#039;&lt;br /&gt;
string += &amp;#039;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&amp;quot;\n&amp;#039;&lt;br /&gt;
string += &amp;#039;! Threshold&amp;lt;br&amp;gt;cards !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]] !! [[%s]]\n&amp;#039;%tuple(card_list)&lt;br /&gt;
&lt;br /&gt;
for i in range(max_cards+1):&lt;br /&gt;
  string += &amp;#039;|-\n&amp;#039;&lt;br /&gt;
  string += &amp;#039;| %d &amp;#039;%i&lt;br /&gt;
  for flavor in list(card_list):&lt;br /&gt;
    string += &amp;#039;|| &amp;#039;&lt;br /&gt;
    try:&lt;br /&gt;
      for j,card in enumerate(card_list[flavor][i]):&lt;br /&gt;
        if j &amp;gt; 0:&lt;br /&gt;
          string += &amp;#039;&amp;lt;br&amp;gt;&amp;#039;&lt;br /&gt;
        string += card[&amp;#039;name&amp;#039;]&lt;br /&gt;
        if len(set(card[&amp;#039;cards&amp;#039;])) &amp;gt; 1 or len(card[&amp;#039;cards&amp;#039;]) != card[&amp;#039;count&amp;#039;]:&lt;br /&gt;
          string += &amp;#039;&amp;lt;ref&amp;gt;&amp;#039;&lt;br /&gt;
          for k,c in enumerate(set(card[&amp;#039;cards&amp;#039;])):&lt;br /&gt;
            if k &amp;gt; 0: string += &amp;#039;, &amp;#039;&lt;br /&gt;
            string += &amp;#039;%d %s&amp;#039;%(card[&amp;#039;cards&amp;#039;].count(c),c)&lt;br /&gt;
          string += &amp;#039;&amp;lt;/ref&amp;gt;&amp;#039;&lt;br /&gt;
    except IndexError:&lt;br /&gt;
      pass&lt;br /&gt;
  string += &amp;#039;\n&amp;#039;&lt;br /&gt;
string += &amp;#039;|}\n\n&amp;#039;&lt;br /&gt;
string += &amp;#039;==Notes==\n&amp;#039;&lt;br /&gt;
string += &amp;#039;&amp;lt;small&amp;gt;Last updated [[%s]] using [[/Script|this script]].&amp;lt;/small&amp;gt;\n&amp;#039;%version[:-1]&lt;br /&gt;
  &lt;br /&gt;
with open(&amp;#039;calamityTable.txt&amp;#039;, &amp;#039;w&amp;#039;) as f:&lt;br /&gt;
  f.write(string)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sten</name></author>
	</entry>
</feed>