<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stannius</id>
	<title>Kolmafia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kolmafia.us/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stannius"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/Stannius"/>
	<updated>2026-04-25T05:18:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Adventure&amp;diff=3981</id>
		<title>Adventure</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Adventure&amp;diff=3981"/>
		<updated>2011-06-20T19:13:29Z</updated>

		<summary type="html">&lt;p&gt;Stannius: another minor change to sample code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|adventure}}{{&lt;br /&gt;
#vardefine:return_type|boolean}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|int|adventures}}|&lt;br /&gt;
parameter2={{Param|location|place}}|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function2={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|int|adventures}}|&lt;br /&gt;
parameter2={{Param|location|place}}|&lt;br /&gt;
parameter3={{Param|string|filter}}|&lt;br /&gt;
p1desc={{Pspan|int}} is the number of adventures to spend.|&lt;br /&gt;
p2desc={{Pspan|place}} is the adventuring location.|&lt;br /&gt;
p3desc={{Pspan|filter}} is a combat action filter. If {{Pspan|filter}} contains a semicolon it is interpreted as a macro, otherwise this is the name of a top-level function which modifies the current CCS. A combat filter function takes the parameters of a consult script, but returns lines like a CCS, not like a consult script. Essentially, this allows the scripter to put a CCS or macro into a script.|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This function runs the specified number of {{pspan|adventures}} at the given {{pspan|place}}, keeping up your current mood &amp;amp; obeying restore settings.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If {{Pspan|filter}} contains a semicolon it will use {{Pspan|filter}} as a macro.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If {{Pspan|filter}} is omitted or assigned an empty string, this function will use your current CCS / battle action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This function returns true if the specified number of adventures were used, and false if not.  Possible reasons for returning false include being out of adventures, a location being unavailable, conditions being statisfied &#039;&#039;before&#039;&#039; {{Pspan|adventures}} were used up and all [[auto-stops]], including encountering a demon name or hobo glyph.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note that {{Pspan|adventures}} is the number of adventures to spend in the specified location {{pspan|place}}. Any &amp;quot;free&amp;quot; turns (choiceadventures that don&#039;t consume an adventure, usually) or adventures spend in other locations (by a counterScript or a betweenBattleScript for example) will not count towards this total.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As with auto-adventuring from the Adventure tab, adventure() checks against goals set via [[add_item_condition|add_item_condition()]] or via other methods of specifying goals in KoLmafia, and will auto-stop if all goals were satisfied.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Adventure 5 times at the Giant&#039;s Castle:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
adventure(5 , $location[giant&#039;s castle]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
title=Example of a Combat Filter|&lt;br /&gt;
description=This uses the combat filter to automatically olfact Goth Giants while adventuring.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
string olfact_goth(int round, string opp, string text) {&lt;br /&gt;
   if(opp != &amp;quot;Goth Giant&amp;quot;)&lt;br /&gt;
      return get_ccs_action(round);&lt;br /&gt;
   if(round == 1 &amp;amp;&amp;amp; have_effect($effect[On the Trail]) &amp;lt; 1)&lt;br /&gt;
      return &amp;quot;skill transcendent olfaction&amp;quot;;&lt;br /&gt;
   return get_ccs_action(round - 1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(5 , $location[giant castle], &amp;quot;olfact_goth&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Uses a combat filter to ensure that all sewer monsters are being cleeshed while you try to make your way to Hobopolis.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string combat_cleesh(int round, string opp, string text) {&lt;br /&gt;
   if (opp == $monster[frog].to_string() || opp == $monster[newt].to_string() &lt;br /&gt;
    || opp == $monster[salamander].to_string()) {&lt;br /&gt;
      return &amp;quot;attack&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
   return &amp;quot;skill CLEESH&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(1, $location[a maze of sewer tunnels], &amp;quot;combat_cleesh&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=This makes use of the combat filter to ensure that salve is being used.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
// Adds salve to beginning of combat if it doesn&#039;t already exist in the CCS. &lt;br /&gt;
// Otherwise it simply returns the current CCS.&lt;br /&gt;
string insert_salve(int round, string opp, string text) {&lt;br /&gt;
   boolean salve = false;&lt;br /&gt;
   for i from 1 to 30&lt;br /&gt;
      if(get_ccs_action(round) == &amp;quot;skill saucy salve&amp;quot;)&lt;br /&gt;
         salve = true;&lt;br /&gt;
   if(salve)&lt;br /&gt;
      return get_ccs_action(round);&lt;br /&gt;
   else {&lt;br /&gt;
      if(round == 1)&lt;br /&gt;
         return &amp;quot;skill saucy salve&amp;quot;;&lt;br /&gt;
      if(round &amp;gt; 1)&lt;br /&gt;
         round = round - 1;              // compensate for insertion&lt;br /&gt;
      return get_ccs_action(round);      // for the rest of the combat, executes your existing ccs&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(5 , $location[giant castle], &amp;quot;insert_salve&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|adv1}}|&lt;br /&gt;
cli_equiv=The CLI command &amp;quot;adv&amp;quot; works similarly.|&lt;br /&gt;
special=This function will return false if KoLmafia conditions are met before completing the specified number of turns.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Also, if the filter function is not top-level code, it will not be found, since it&#039;s being called outside of ASH. As a result, it will return &amp;quot;void&amp;quot;, which may result in the use of $item[ovoid leather thing].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Adventuring]]&lt;/div&gt;</summary>
		<author><name>Stannius</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Adventure&amp;diff=3980</id>
		<title>Adventure</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Adventure&amp;diff=3980"/>
		<updated>2011-06-20T19:12:26Z</updated>

		<summary type="html">&lt;p&gt;Stannius: missing semicolon in example code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|adventure}}{{&lt;br /&gt;
#vardefine:return_type|boolean}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|int|adventures}}|&lt;br /&gt;
parameter2={{Param|location|place}}|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function2={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|int|adventures}}|&lt;br /&gt;
parameter2={{Param|location|place}}|&lt;br /&gt;
parameter3={{Param|string|filter}}|&lt;br /&gt;
p1desc={{Pspan|int}} is the number of adventures to spend.|&lt;br /&gt;
p2desc={{Pspan|place}} is the adventuring location.|&lt;br /&gt;
p3desc={{Pspan|filter}} is a combat action filter. If {{Pspan|filter}} contains a semicolon it is interpreted as a macro, otherwise this is the name of a top-level function which modifies the current CCS. A combat filter function takes the parameters of a consult script, but returns lines like a CCS, not like a consult script. Essentially, this allows the scripter to put a CCS or macro into a script.|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This function runs the specified number of {{pspan|adventures}} at the given {{pspan|place}}, keeping up your current mood &amp;amp; obeying restore settings.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If {{Pspan|filter}} contains a semicolon it will use {{Pspan|filter}} as a macro.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If {{Pspan|filter}} is omitted or assigned an empty string, this function will use your current CCS / battle action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This function returns true if the specified number of adventures were used, and false if not.  Possible reasons for returning false include being out of adventures, a location being unavailable, conditions being statisfied &#039;&#039;before&#039;&#039; {{Pspan|adventures}} were used up and all [[auto-stops]], including encountering a demon name or hobo glyph.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Note that {{Pspan|adventures}} is the number of adventures to spend in the specified location {{pspan|place}}. Any &amp;quot;free&amp;quot; turns (choiceadventures that don&#039;t consume an adventure, usually) or adventures spend in other locations (by a counterScript or a betweenBattleScript for example) will not count towards this total.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As with auto-adventuring from the Adventure tab, adventure() checks against goals set via [[add_item_condition|add_item_condition()]] or via other methods of specifying goals in KoLmafia, and will auto-stop if all goals were satisfied.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Adventure 5 times at the Giant&#039;s Castle:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
adventure(5 , $location[giant&#039;s castle]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
title=Example of a Combat Filter|&lt;br /&gt;
description=This uses the combat filter to automatically olfact Goth Giants while adventuring.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
string olfact_goth(int round, string opp, string text) {&lt;br /&gt;
   if(opp != &amp;quot;Goth Giant&amp;quot;)&lt;br /&gt;
      return get_ccs_action(round);&lt;br /&gt;
   if(round == 1 &amp;amp;&amp;amp; have_effect($effect[On the Trail]) &amp;lt; 1)&lt;br /&gt;
      return &amp;quot;skill transcendent olfaction&amp;quot;;&lt;br /&gt;
   else&lt;br /&gt;
      return get_ccs_action(round - 1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(5 , $location[giant castle], &amp;quot;olfact_goth&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Uses a combat filter to ensure that all sewer monsters are being cleeshed while you try to make your way to Hobopolis.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string combat_cleesh(int round, string opp, string text) {&lt;br /&gt;
   if (opp == $monster[frog].to_string() || opp == $monster[newt].to_string() &lt;br /&gt;
    || opp == $monster[salamander].to_string()) {&lt;br /&gt;
      return &amp;quot;attack&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
   return &amp;quot;skill CLEESH&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(1, $location[a maze of sewer tunnels], &amp;quot;combat_cleesh&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=This makes use of the combat filter to ensure that salve is being used.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
// Adds salve to beginning of combat if it doesn&#039;t already exist in the CCS. &lt;br /&gt;
// Otherwise it simply returns the current CCS.&lt;br /&gt;
string insert_salve(int round, string opp, string text) {&lt;br /&gt;
   boolean salve = false;&lt;br /&gt;
   for i from 1 to 30&lt;br /&gt;
      if(get_ccs_action(round) == &amp;quot;skill saucy salve&amp;quot;)&lt;br /&gt;
         salve = true;&lt;br /&gt;
   if(salve)&lt;br /&gt;
      return get_ccs_action(round);&lt;br /&gt;
   else {&lt;br /&gt;
      if(round == 1)&lt;br /&gt;
         return &amp;quot;skill saucy salve&amp;quot;;&lt;br /&gt;
      if(round &amp;gt; 1)&lt;br /&gt;
         round = round - 1;              // compensate for insertion&lt;br /&gt;
      return get_ccs_action(round);      // for the rest of the combat, executes your existing ccs&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
adventure(5 , $location[giant castle], &amp;quot;insert_salve&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|adv1}}|&lt;br /&gt;
cli_equiv=The CLI command &amp;quot;adv&amp;quot; works similarly.|&lt;br /&gt;
special=This function will return false if KoLmafia conditions are met before completing the specified number of turns.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Also, if the filter function is not top-level code, it will not be found, since it&#039;s being called outside of ASH. As a result, it will return &amp;quot;void&amp;quot;, which may result in the use of $item[ovoid leather thing].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Adventuring]]&lt;/div&gt;</summary>
		<author><name>Stannius</name></author>
	</entry>
</feed>