<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kolmafia.us/index.php?action=history&amp;feed=atom&amp;title=KoLmafia_Guide%3A_Creating_an_Auto-adventuring_Script</id>
	<title>KoLmafia Guide: Creating an Auto-adventuring Script - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kolmafia.us/index.php?action=history&amp;feed=atom&amp;title=KoLmafia_Guide%3A_Creating_an_Auto-adventuring_Script"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;action=history"/>
	<updated>2026-06-14T20:43:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5530&amp;oldid=prev</id>
		<title>Bale: typo</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5530&amp;oldid=prev"/>
		<updated>2010-08-23T21:23:15Z</updated>

		<summary type="html">&lt;p&gt;typo&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:23, 23 August 2010&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-l144&quot;&gt;Line 144:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 144:&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 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;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&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;lt;/syntaxhighlight&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&amp;lt;/div&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;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;Continue to [[KoLmafia Guide: Commonly Used ASH Commands|Post-Lesson 6: Commonly Used ASH Commands]]&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;Continue to [[KoLmafia Guide: Commonly Used ASH Commands|Post-Lesson 6: Commonly Used ASH Commands]]&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;[[Category:KoLmafia Guide]][[Category:New User Help]]&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;[[Category:KoLmafia Guide]][[Category:New User Help]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key kolmafia_wiki:diff:1.41:old-5529:rev-5530:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Bale</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5529&amp;oldid=prev</id>
		<title>Bale: format fiddly</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5529&amp;oldid=prev"/>
		<updated>2010-08-23T21:22:57Z</updated>

		<summary type="html">&lt;p&gt;format fiddly&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:22, 23 August 2010&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-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&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;o) You see that some non-combat adventures might not actually consume an adventure. Therefore before doing the adventure I save off a temporary counter. After the adventure I compare the pre-adventure count with the post-adventure count, and that way I know whether to increment the main adventure counter or not.&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;o) You see that some non-combat adventures might not actually consume an adventure. Therefore before doing the adventure I save off a temporary counter. After the adventure I compare the pre-adventure count with the post-adventure count, and that way I know whether to increment the main adventure counter or not.&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; 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;lt;div style=&quot;margin-bottom: 1em; font-size: 12px&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;border: dashed 1px green&lt;/del&gt;; padding: 1em; margin:0px 20px;&quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&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;lt;div style=&quot;margin-bottom: 1em; font-size: 12px; padding: 1em; margin:0px 20px;&quot;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{CodeSample|code=&lt;/ins&gt;&amp;lt;syntaxhighlight&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;  ## These indicate percent of damage taken by Covered in Slime, by turns-remaining.&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;  ## These indicate percent of damage taken by Covered in Slime, by turns-remaining.&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;  float[11] slime_percent;&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;  float[11] slime_percent;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bale</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5528&amp;oldid=prev</id>
		<title>Bale at 19:55, 12 July 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5528&amp;oldid=prev"/>
		<updated>2010-07-12T19:55:45Z</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 19:55, 12 July 2010&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-l148&quot;&gt;Line 148:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 148:&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;Continue to [[KoLmafia Guide: Commonly Used ASH Commands|Post-Lesson 6: Commonly Used ASH Commands]]&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;Continue to [[KoLmafia Guide: Commonly Used ASH Commands|Post-Lesson 6: Commonly Used ASH Commands]]&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; 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;[[Category:KoLmafia Guide]]&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;[[Category:KoLmafia Guide&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]][[Category:New User Help&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bale</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5527&amp;oldid=prev</id>
		<title>Bale: Created page with &#039;Alright, here it is! This is a real live auto-adventuring, turn-burning script. This is my simple version of an automatic SlimeTube script for beginning slime players. There are …&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Creating_an_Auto-adventuring_Script&amp;diff=5527&amp;oldid=prev"/>
		<updated>2010-03-11T20:20:07Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;Alright, here it is! This is a real live auto-adventuring, turn-burning script. This is my simple version of an automatic SlimeTube script for beginning slime players. There are …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Alright, here it is! This is a real live auto-adventuring, turn-burning script. This is my simple version of an automatic SlimeTube script for beginning slime players. There are more complex ones out there, but I wanted less complexity and more control.&lt;br /&gt;
&lt;br /&gt;
a) Don&amp;#039;t freak. This script is a big one! But we will break it down.&lt;br /&gt;
&lt;br /&gt;
b) Note that I put my void main() statement IN THE MIDDLE. The reason is because I introduce Subroutines. I define my OWN functions that I call. As such, these must be defined before I use them in the main method!&lt;br /&gt;
&lt;br /&gt;
c) Before that, I define a MAP. This variable is used to help me figure out slime damage that will be taken. Note that it is defined OUTSIDE any function!&lt;br /&gt;
&lt;br /&gt;
d) Look at slime_damage. It figures out how much raw damage we will take based on being Covered in Slime for X turns.&lt;br /&gt;
We use the standard &amp;#039;figure out an effect&amp;#039;, but this time we store off exactly HOW MANY TURNS of the effect I have. The Slime &amp;lt; 1 line is because if unslimed, you will get a new coat of Sliming.&lt;br /&gt;
Then, I find the Slime Factor based on the turns of slime left. Basically, I have a number between 1 and 10. I feed it to the slime_percentage MAP and it returns a decimal number. I multiply it by my MAX HPs to determine the raw damage that will be taken.&lt;br /&gt;
&lt;br /&gt;
e) Look at CleanupTime. It tries to use the Chamois bucket to clean me. It returns a boolean whether it worked or not.&lt;br /&gt;
&lt;br /&gt;
f) Time for the main function. I have 3 inputs. How many turns to adventure, when I should use a Chamois(based on how much damage Ill take), and how low my HPs can get before I abort.&lt;br /&gt;
&lt;br /&gt;
g) First, I tweak the # of adventures to reflect reality. They might type in 500 turns, but if they only have 150 then we will modify the number accordingly. Similarly, an input of 0 means to use all remaining adventures.&lt;br /&gt;
&lt;br /&gt;
h) Now I have this giant While loop. I keep doing whats inside until we run out of adventures OR have executed how ever many cycles that they wanted done.&lt;br /&gt;
&lt;br /&gt;
i) First, I check current HPs before adventuring. If they are too low, we abort.&lt;br /&gt;
&lt;br /&gt;
j) Next, I call my own functions. First I figure out how much slime damage I am expected to take. (NOT including resistances!). If its more than Max HPs, I abort. &lt;br /&gt;
&lt;br /&gt;
k) Same deal, except I compare slime damage vs the tolerence. I like this function. If you have 1800HPs, you probably don&amp;#039;t want to eat 1700 on slime! It wont kill you, but that is expensive to recover from.&lt;br /&gt;
&lt;br /&gt;
l) Now, I check slime damage vs current HP. If for some reason your Slime damage tolerence is high, but your HPs get too low and your abort-clause is too high, you need to be cleaned so you don&amp;#039;t get killed.&lt;br /&gt;
&lt;br /&gt;
m) In all cases, I call the cleanup() method that I made myself to try to use a chamois.&lt;br /&gt;
&lt;br /&gt;
n) After all those checks, I go ahead and do 1 adventure in that location. Stuff to note:&lt;br /&gt;
i.) It will use YOUR custom combat script to fight! Make sure it is set right.&lt;br /&gt;
&lt;br /&gt;
ii.) It will use YOUR &amp;#039;Adventure location Choices&amp;#039; for non-combat (tickle uvula, etc) adventures. Make sure the right choices are set for the slimeTube. (do this by selecting Slime Tube as your location under the &amp;#039;Adventure&amp;#039; tab, and click the Choices tab.)&lt;br /&gt;
&lt;br /&gt;
o) You see that some non-combat adventures might not actually consume an adventure. Therefore before doing the adventure I save off a temporary counter. After the adventure I compare the pre-adventure count with the post-adventure count, and that way I know whether to increment the main adventure counter or not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; font-size: 12px;border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 ## These indicate percent of damage taken by Covered in Slime, by turns-remaining.&lt;br /&gt;
 float[11] slime_percent;&lt;br /&gt;
 slime_percent[0] = 0;&lt;br /&gt;
 slime_percent[1] = 5.334167;&lt;br /&gt;
 slime_percent[2] = 4.001677;&lt;br /&gt;
 slime_percent[3] = 2.9025;&lt;br /&gt;
 slime_percent[4] = 2.016667;&lt;br /&gt;
 slime_percent[5] = 1.325;&lt;br /&gt;
 slime_percent[6] = .805833;&lt;br /&gt;
 slime_percent[7] = .4391667;&lt;br /&gt;
 slime_percent[8] = .200833;&lt;br /&gt;
 slime_percent[9] = .066667;&lt;br /&gt;
 slime_percent[10] = .01;&lt;br /&gt;
&lt;br /&gt;
int slime_damage()&lt;br /&gt;
{&lt;br /&gt;
  int slimeTurns = have_effect($effect[Coated in Slime]);&lt;br /&gt;
  if (slimeTurns &amp;lt; 1)&lt;br /&gt;
  {&lt;br /&gt;
    slimeTurns = 10;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  int slimeDmg = my_maxhp() * slime_percent[slimeTurns];&lt;br /&gt;
  print(&amp;quot;Calculated slime dmg = &amp;quot; +slimeDmg);&lt;br /&gt;
  return slimeDmg;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
boolean cleanupTime()&lt;br /&gt;
{&lt;br /&gt;
 visit_url( &amp;quot;clan_slimetube.php?action=chamois&amp;quot; );&lt;br /&gt;
 if ( have_effect( $effect[Coated in Slime] ) &amp;gt; 0 )&lt;br /&gt;
 {&lt;br /&gt;
   ## Something must have gone wrong.&lt;br /&gt;
   return false;&lt;br /&gt;
 }&lt;br /&gt;
 print (&amp;quot;Slime cleaned with Chamois&amp;quot;);&lt;br /&gt;
 return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main (int howManyTurnsToAdventure, int howManyHPsToLoseBeforeChamois,&lt;br /&gt;
int whatHPlevelToAbortScriptAt)&lt;br /&gt;
{&lt;br /&gt;
 ## Keep track of how many adventures we have done.&lt;br /&gt;
 int adventureCounter = 0;&lt;br /&gt;
&lt;br /&gt;
 ## Adjust desired adventures:  If 0 OR not enough adv left, use them all.&lt;br /&gt;
 if( howManyTurnsToAdventure &amp;lt; 1 ) howManyTurnsToAdventure = my_adventures();&lt;br /&gt;
 if( howManyTurnsToAdventure &amp;gt; my_adventures() ) howManyTurnsToAdventure = my_adventures();&lt;br /&gt;
&lt;br /&gt;
 ## The main loop.&lt;br /&gt;
 while( my_adventures() &amp;gt; 0 &amp;amp;&amp;amp; (howManyTurnsToAdventure-adventureCounter) &amp;gt; 0 )&lt;br /&gt;
 {&lt;br /&gt;
   ## Check current HPs vs the script abort level.&lt;br /&gt;
   if (my_hp() &amp;lt;= whatHPlevelToAbortScriptAt)&lt;br /&gt;
   {&lt;br /&gt;
     print(&amp;quot;Your HPs are below your whatHPlevelToAbortScriptAt&amp;quot;);&lt;br /&gt;
     print(&amp;quot;You might want to use a chamois to clean yourself!&amp;quot;);&lt;br /&gt;
     abort();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   ## This checks slime dmg vs your MAX HPs. (If you wanted to add auto-heal code.)&lt;br /&gt;
   if( slime_damage() &amp;gt;= my_maxhp() )&lt;br /&gt;
   {&lt;br /&gt;
     print (&amp;quot;Expected slime dmg is more than your MAX HP!&amp;quot;);&lt;br /&gt;
     if (!cleanupTime())&lt;br /&gt;
     {&lt;br /&gt;
       abort(&amp;quot;Couldn&amp;#039;t clean. Check Chamois bucket&amp;quot;);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   ## This checks slime dmg vs CURRENT HPs.&lt;br /&gt;
   ## Regardless of your tolerence, you need to stop the slime damage.&lt;br /&gt;
   if ( slime_damage() &amp;gt;= howManyHPsToLoseBeforeChamois)&lt;br /&gt;
   {&lt;br /&gt;
     print (&amp;quot;Expected slime dmg is more than your tolerence.&amp;quot;);&lt;br /&gt;
     if (!cleanupTime())&lt;br /&gt;
     {&lt;br /&gt;
       abort(&amp;quot;Couldn&amp;#039;t clean. Check Chamois bucket&amp;quot;);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   if ( slime_damage() &amp;gt;= my_hp() )&lt;br /&gt;
   {&lt;br /&gt;
     print (&amp;quot;Expected slime dmg is more than your current HPs&amp;quot;);&lt;br /&gt;
     ## IF You want to add the ability for this script to heal yourself,&lt;br /&gt;
     ## This would be a great place for it.&lt;br /&gt;
     if (!cleanupTime())&lt;br /&gt;
     {&lt;br /&gt;
       abort(&amp;quot;Couldn&amp;#039;t clean. Check Chamois bucket&amp;quot;);&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   int temporaryAdvCounter = my_adventures();&lt;br /&gt;
&lt;br /&gt;
   ## Use a single adventure. Note, non-combat MAY NOT use an actual adventure.&lt;br /&gt;
   adventure( 1 , $location[The Slime Tube] );&lt;br /&gt;
&lt;br /&gt;
   ## See if that adventure actually took an adventure.&lt;br /&gt;
   if (temporaryAdvCounter &amp;gt; my_adventures())&lt;br /&gt;
   {&lt;br /&gt;
     ## Our adventures decreased. Therefore this did take an adventure.&lt;br /&gt;
     adventureCounter = adventureCounter + 1;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   print (&amp;quot;Ok, done with adventure &amp;quot; +adventureCounter +&amp;quot; of &amp;quot; +howManyTurnsToAdventure);&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue to [[KoLmafia Guide: Commonly Used ASH Commands|Post-Lesson 6: Commonly Used ASH Commands]]&lt;br /&gt;
&lt;br /&gt;
[[Category:KoLmafia Guide]]&lt;/div&gt;</summary>
		<author><name>Bale</name></author>
	</entry>
</feed>