<?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=Jasonharper</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=Jasonharper"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/Jasonharper"/>
	<updated>2026-04-24T21:14:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Help:To_Do_List&amp;diff=7564</id>
		<title>Help:To Do List</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Help:To_Do_List&amp;diff=7564"/>
		<updated>2011-12-03T09:39:35Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: /* Missing Stuff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;To Do&amp;quot; List ==&lt;br /&gt;
&lt;br /&gt;
This is a list of stuff that is missing from the wiki or else needs major work. Please help!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you need tips for editing the wiki, find that here: [[Help:Editing]].&lt;br /&gt;
&lt;br /&gt;
*CLI Commands are usually only added to the [[CLI Reference]]. Only very complicated commands require their own page.&lt;br /&gt;
&lt;br /&gt;
*ASH commands need to be listed on their category page as well as on the [[Ash Functions]] list. &lt;br /&gt;
**It is not necessary to always create a code sample, although it is preferred.&lt;br /&gt;
**If you don&#039;t add a code sample, please remember to add &#039;&#039;&#039;needscode=yes|&#039;&#039;&#039; to the page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Missing Stuff ==&lt;br /&gt;
 r10025: Added &amp;quot;choice&amp;quot; CLI command, to resolve manual or unsupported choiceadventures &lt;br /&gt;
 Added &amp;quot;choice&amp;quot; CLI command, to resolve manual or unsupported choice&lt;br /&gt;
 adventures without having to visit the relay browser - which might be&lt;br /&gt;
 inconvenient if you&#039;re already in the CLI, and don&#039;t need to see the full&lt;br /&gt;
 adventure text to decide which option you want. With no parameter, &amp;quot;choice&amp;quot;&lt;br /&gt;
 just lists the options. With a numeric parameter, it picks that option. &lt;br /&gt;
 With any other parameter, it picks the first option containing that text (in&lt;br /&gt;
 either the actual button text, or mafia&#039;s spoiler text).&lt;br /&gt;
&lt;br /&gt;
 r10033:  a new command &#039;graygui&#039; (or &#039;greygui&#039; if you prefer that spelling) &lt;br /&gt;
 has been added to the CLI, which will print out all the entry points for all&lt;br /&gt;
 the stuff that still has a known open request sequence.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I would like to list all valid adventuring conditions somewhere: (Is this all of them?)&lt;br /&gt;
* {{pspan|X item}} will be fulfilled when you have X of item.&lt;br /&gt;
* {{pspan|+X item}} will be fulfilled when you have X more of the item than you previously possessed.&lt;br /&gt;
* {{pspan|X choiceadv}} will be fulfilled when you encounter X choice adventures.&lt;br /&gt;
* {{pspan|X autostop}} will be fulfilled when you encounter X autostop adventures.&lt;br /&gt;
* {{pspan|X pirate insult}} will be fulfilled when you have learned X pirate insults.&lt;br /&gt;
* {{pspan|X arena flyer ml}} will be fulfilled when you have flyered X ML worth of monsters.&lt;br /&gt;
* {{pspan|X any itemtype}} will be fulfilled when you have X items that all have a partial match to itemtype, such as {{pspan|8 any paper strip}} or {{pspan|14 any fish meat}}.&lt;br /&gt;
* {{pspan|level X}} will be fulfilled when your character is level X. This is useful for automated power leveling.&lt;br /&gt;
* {{pspan|X muscle}}, {{pspan|X mysticality}} and {{pspan|X moxie}} will be fulfilled when the specified stat is at X.&lt;br /&gt;
* Special conditions exist for several locations.&lt;br /&gt;
** {{pspan|outfit}} is only valid in the Cobb&#039;s Knob Harem, Cobb&#039;s Knob Treasury, Frat House, Hippy Camp, Pirate Cove, Itznotyerzitz Mine, and eXtreme Slope.&lt;br /&gt;
** {{pspan|castle map items}} is only valid in the Giant&#039;s Castle.&lt;br /&gt;
&lt;br /&gt;
If you leave off the quantity X, then it is assumed to be 1.&lt;br /&gt;
Remainder of possible conditions:&lt;br /&gt;
* &#039;&#039;&#039;X meat&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;X health/mana&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;X% health/mana&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;X anything but Y&#039;&#039;&#039; (opposite of &#039;&#039;&#039;any&#039;&#039;&#039;)&lt;br /&gt;
* any/anything but can take multiple item names separated by | or /.&lt;br /&gt;
* &#039;&#039;&#039;outfit&#039;&#039;&#039; can be preceded by the name of certain outfits, or the location where one normally drops, to specify a non-default outfit.  I&#039;m not sure if there&#039;s any place where that&#039;s actually useful.&lt;br /&gt;
* &#039;&#039;&#039;castle map items&#039;&#039;&#039; is technically valid everywhere; it&#039;s only non-stupid in the Giant&#039;s Castle.&lt;br /&gt;
--[[User:Jasonharper|Jasonharper]] 04:39, 3 December 2011 (EST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 There&#039;s also a &amp;quot;location&amp;quot; command, which allows new zones to work like normal with the rest of mafia.&lt;br /&gt;
 &lt;br /&gt;
 location 274 Lollipop Forest&lt;br /&gt;
 &lt;br /&gt;
 Be careful, if you add the same location twice it can make a mess. &lt;br /&gt;
 Luckily, locations added this way are not remembered, so you can quit and restart if you mess it up.&lt;br /&gt;
&lt;br /&gt;
== Needs Major Work ==&lt;br /&gt;
&lt;br /&gt;
[[Proxy Records]] is only slightly better than a placeholder.&lt;br /&gt;
&lt;br /&gt;
 In r10047, the adventure tab interface was altered. Fix SinginSally&#039;s guide on pages...&lt;br /&gt;
 &lt;br /&gt;
 http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Attack_Script&lt;br /&gt;
 http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Custom_Combat_Script&lt;br /&gt;
 http://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Goal-Oriented_Adventuring&lt;br /&gt;
&lt;br /&gt;
== Needs Code Samples ==&lt;br /&gt;
&lt;br /&gt;
There is a list of all pages that require code samples: [[:Category:Needs_Code_Sample|Category:Needs Code Sample]]&lt;br /&gt;
&lt;br /&gt;
Information on how to create a code sample: [[Template:CodeSample]]&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Miscellaneous_ASH_Features&amp;diff=6087</id>
		<title>Miscellaneous ASH Features</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Miscellaneous_ASH_Features&amp;diff=6087"/>
		<updated>2010-10-17T18:41:37Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: /* Additional Script Uses */ negative remaining turns on a counterScript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==Special Syntax Functions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[notify]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to send a simple kmail to the script&#039;s author, letting them know you use their script.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[import]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to load an external script into your current one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[call]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enables the script writer to invoke a function whose name is known at runtime.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[new]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Constructor function used to populate a record.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
&lt;br /&gt;
Adding &#039;&#039;&#039;[[Comments]]&#039;&#039;&#039; to your code can make it much easier to maintain, and helps other users understand what&#039;s going on.&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
&lt;br /&gt;
For help when things go wrong, please see the page on [[ASH Errors]].&lt;br /&gt;
&lt;br /&gt;
==Additional Script Uses==&lt;br /&gt;
&lt;br /&gt;
In addition to regular scripts, relay override scripts, and consult scripts, mafia has a few other hooks for adding event-driven scripts.  These situations are listed below, along with the preference that you can set a script name to (in parentheses).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Between Battle (betweenBattleScript)&#039;&#039;&#039;&lt;br /&gt;
*Executed whenever mafia is about to enter a combat. That means before every adventure if auto-adventuring, or before using an item that could lead to combat such as black pudding or drum machine.&lt;br /&gt;
*Does not require any special main() declaration.&lt;br /&gt;
*Example: Zarqon&#039;s [http://kolmafia.us/showthread.php?t=1240 Best Between Battle]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Buy (buyScript)&#039;&#039;&#039;&lt;br /&gt;
*Will execute whenever mafia needs to determine if it is to purchase or create an item.&lt;br /&gt;
*Requires a special main declaration boolean main(item itm, int qty, int ingredientLevel, boolean defaultBuy). These values will be supplied by mafia when the script is automatically called. A return value of true will instruct mafia to purchase the item and false will cause it to create the item possibly leading to other buy/create decisions.&lt;br /&gt;
**&#039;&#039;itm&#039;&#039; and &#039;&#039;qty&#039;&#039; specify the item under consideration.&lt;br /&gt;
**&#039;&#039;ingredientLevel&#039;&#039; indicates what&#039;s already available: &lt;br /&gt;
***0 = none of the ingredients&lt;br /&gt;
***1 = some of them&lt;br /&gt;
***2 = enough to create at least one of the requested item&lt;br /&gt;
**defaultBuy indicates what KoLmafia would have done otherwise; returning this value is the safest thing your script could do. It will normally be true if ingredientLevel is 0, false if 2. The default at level 1 depends on the item, and is subject to change - normally, anything made with star charts, pixels, the Malus, or multi-use are bought, anything else is created.&lt;br /&gt;
*Example: Bale&#039;s [http://kolmafia.us/showthread.php?p=18313#post18313 potionBuy].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chatbot (chatbotScript)&#039;&#039;&#039;&lt;br /&gt;
*Will execute whenever a private message is received&lt;br /&gt;
*Requires a special main declaration void main(string sender, string message)&lt;br /&gt;
**&#039;sender&#039; is the name of the player who sent the message&lt;br /&gt;
**&#039;message&#039; is the message that was sent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Counters (counterScript)&#039;&#039;&#039;&lt;br /&gt;
*Will execute whenever a counter will expire as a result of an intended use of adventures.&lt;br /&gt;
*Requires a special main declaration: boolean main(string name, int remain).  These values will be supplied by mafia when the script is automatically called and the return value will determine whether mafia continues operation (true) or aborts (false).  &lt;br /&gt;
**&#039;&#039;name&#039;&#039; will be the name of the counter that is about to expire.&lt;br /&gt;
**&#039;&#039;remain&#039;&#039; is the number of turns remaining before the counter expires.  Remain will usually be 0, but may be higher if you are about to multi-create items, adventure underwater, or take a vacation.   It may be negative if the counter was informational (one that doesn&#039;t abort adventuring), and it actually expired in the middle of an action that used multiple turns at once.&lt;br /&gt;
*Example: Bale&#039;s [http://kolmafia.us/showthread.php?t=2519 CounterChecker].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Login (loginScript)&#039;&#039;&#039;&lt;br /&gt;
:This script is immediately executed once your character is logged in.  Requires no special main() declaration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logout (logoutScript)&#039;&#039;&#039;&lt;br /&gt;
:Same as the loginScript, but runs on logout.  Note that an [[abort|abort()]] in the script won&#039;t stop a logout unless the logout was called in (specific ways, please list).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Planting (plantingScript)&#039;&#039;&#039;&lt;br /&gt;
*This script can be used to manage the mushroom fields, which are available when under a muscle zodiac sign. It runs after logging in, if you have a mushroom field. Main function takes no arguments. Generally should take into account current [[moon phase]] so that it can be started in the middle of a cycle.&lt;br /&gt;
*Example: [http://kolmafia.us/showthread.php?563-Modified-mushroom-script-to-produce-3rd-4th-gen-crop&amp;amp;p=7507&amp;amp;viewfull=1#post7507 Sandiman&#039;s mushroom planting script].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Post-Ascension (postAscensionScript)&#039;&#039;&#039;&lt;br /&gt;
:Executed at once when your character starts a new ascension. (Example: Bales&#039;s [http://kolmafia.us/showthread.php?t=2769 newLife])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pre-Ascension (preAscensionScript)&#039;&#039;&#039;&lt;br /&gt;
:Executed right before entering Valhalla.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Recovery (recoveryScript)&#039;&#039;&#039;&lt;br /&gt;
*Executed whenever mafia would recover your HP / MP.  &lt;br /&gt;
*Requires a special main() declaration: boolean main(string type, int amount).  These values will be supplied when mafia automatically calls the script, and the return value will instruct mafia if it should attempt to use mafia&#039;s default healing after the script concludes. &lt;br /&gt;
**&#039;&#039;type&#039;&#039; is either &amp;quot;HP&amp;quot; or &amp;quot;MP&amp;quot;.&lt;br /&gt;
**&#039;&#039;amount&#039;&#039; is the desired amount of restoration needed or 0 to use mafia&#039;s default recovery level and target.&lt;br /&gt;
*Example: Bale&#039;s [http://kolmafia.us/showthread.php?t=1780 Universal Recovery]&lt;br /&gt;
&lt;br /&gt;
==A little CLI help==&lt;br /&gt;
&lt;br /&gt;
Two CLI commands are of great use to ASH scripters:&lt;br /&gt;
* [[ashref]] allows one to get a list of ASH functions&lt;br /&gt;
* [[ash (CLI)|ash]] or [[ash (CLI)|ashq]] allows one to run ASH directly on the CLI.&lt;br /&gt;
&lt;br /&gt;
==Useful forum threads==&lt;br /&gt;
[http://kolmafia.us/showthread.php?523-Did-you-know...-It-s-a-secret-feature.&amp;amp;p=2968&amp;amp;viewfull=1#post2968 This thread], started by holatuwol, is a tidy compilation of various undocumented features in KoLmafia.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User_talk:PhilmASTErpLus&amp;diff=6842</id>
		<title>User talk:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User_talk:PhilmASTErpLus&amp;diff=6842"/>
		<updated>2010-07-27T05:49:33Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: /* ASH For Beginners */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;aggregate&amp;quot; and &amp;quot;map&amp;quot; are NOT synonyms.  &amp;quot;aggregate&amp;quot; is an abstract type; the three concrete implementations of that type are maps, arrays, and plural typed constants (which require a separate implementation because they need to be immutable). --[[User:Jasonharper|Jasonharper]] 04:36, 22 June 2010 (UTC)&lt;br /&gt;
:Uh-huh. Sorry about that editing rampage, should I go and revert them? Or how about alternatives? --[[User:PhilmASTErpLus|PhilmASTErpLus]] 04:39, 22 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I was not aware of this either; we&#039;ll need to see where that means we need to make changes. --[[User:StDoodle|StDoodle (#1059825)]] 05:07, 22 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regarding your recent user page update -- the ideal place to put such information, I think, is probably [[file_to_map]]. Also, there should probably be a little blurb on that page mentioning that you don&#039;t need those files in your data directory (they&#039;re built into the jars), but having them present will override the built-in mapfiles. --[[User:Heeheehee|Heeheehee]] 23:58, 1 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Browsing through the function pages, I found this: {{f|to_string}} (see the source for template details) --[[User:Heeheehee|Heeheehee]] 19:03, 4 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== [[ASH For Beginners]] ==&lt;br /&gt;
&lt;br /&gt;
Your recent edit is completely wrong; I would have reverted it, except that the reason field wasn&#039;t big enough to explain just how it was wrong.&lt;br /&gt;
&lt;br /&gt;
ALL values in ASH are passed and assigned in a completely uniform manner, regardless of type.  That manner could either be referred to as &amp;quot;call by value&amp;quot; or &amp;quot;call by reference&amp;quot;; the two concepts aren&#039;t distinct here, since all ASH values are references to some object.  No copying is ever done, except as part of an implicit type conversion.&lt;br /&gt;
&lt;br /&gt;
You appear to be confusing the concepts of call type and mutability.  There&#039;s no difference in how (for example) a map and an int value are passed; the observed differences in behavior are entirely due to the fact that there are ways to modify the contents of a map (with it still remaining the same map), yet no ways of modifying the value of an integer.  The closest you can come is to produce a new integer value, and assign it to the same variable that formerly held the old value; it is the variable that is changing, not the value. --[[User:Jasonharper|Jasonharper]] 05:49, 27 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Control_Structures&amp;diff=5717</id>
		<title>Talk:Control Structures</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Control_Structures&amp;diff=5717"/>
		<updated>2010-06-22T16:26:22Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ok, old version no longer needed. A couple cleanup requests:&lt;br /&gt;
* add return&lt;br /&gt;
* change looping to flow control OR add a separate section for continue, break &amp;amp; return&lt;br /&gt;
* the above 3 should each have a lv3 heading&lt;br /&gt;
--[[User:StDoodle|StDoodle (#1059825)]] 18:57, 18 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Never mind; the stuff, I fixed it. --[[User:StDoodle|StDoodle (#1059825)]] 19:21, 18 April 2010 (UTC) (Though further info for break, continue &amp;amp; return might be nice).&lt;br /&gt;
&lt;br /&gt;
I was not aware of that use of switch statements, thanks! --[[User:StDoodle|StDoodle (#1059825)]] 13:55, 3 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
*That use of switch statements was one of the things zarqon and I pushed for when we were cajoling veracity to add it as a mafia feature. It is so much more readable to use a single switch statement than 6 &amp;quot;else if&amp;quot; statements. --[[User:Bale|Bale]] 23:33, 3 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Er, that is to say, I knew how to use them with a top-level variable, but not that you could omit that and use a sep. expression each time... and I could swear I tried to use expressions that way (apparently you can&#039;t do both at once!). :P --[[User:StDoodle|StDoodle (#1059825)]] 02:29, 4 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I&#039;m wondering if a more explicit example is necessary. What I&#039;m talking about is:&lt;br /&gt;
&lt;br /&gt;
{{&lt;br /&gt;
CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
switch {&lt;br /&gt;
case x &amp;lt; 0 &amp;amp;&amp;amp; x == x % 2:&lt;br /&gt;
   print(x+&amp;quot; is negative and even&amp;quot;);&lt;br /&gt;
   break;&lt;br /&gt;
case x &amp;lt; 0:&lt;br /&gt;
   print(x+&amp;quot; is negative and odd&amp;quot;);&lt;br /&gt;
   break;&lt;br /&gt;
case x == 0:&lt;br /&gt;
   print(&amp;quot;x is zero&amp;quot;);&lt;br /&gt;
   break;&lt;br /&gt;
case x == x % 2 &amp;amp;&amp;amp; x &amp;lt; 10:&lt;br /&gt;
   print(x+&amp;quot; is a positive one digit even number&amp;quot;);&lt;br /&gt;
   break;&lt;br /&gt;
case x != x % 2&lt;br /&gt;
   print(x+&amp;quot; is an odd number&amp;quot;);&lt;br /&gt;
   break;&lt;br /&gt;
default:&lt;br /&gt;
   print(x+&amp;quot; is greater than 9&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Do you think an example like that would be helpful? --[[User:Bale|Bale]] 03:19, 4 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
That looks good; I&#039;d add in one line with a different variable though, just to make the differentiation in use clear. Such as an initial check for y &amp;gt; 9000 or something. Then again, I pretty much figured it out from what&#039;s on the page, so I&#039;m not sure it&#039;s necessary. Perhaps three samples are in order: a simple switch with a generic variable to test, your example, and a &amp;quot;This won&#039;t work&amp;quot; example that tries to mix the two. --[[User:StDoodle|StDoodle (#1059825)]] 13:51, 4 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Regarding foreach and sorting: since it sorts by index, not by value, that should be mentioned somewhere in that blurb. --[[User:Heeheehee|Heeheehee]] 12:10, 22 June 2010 (UTC)&lt;br /&gt;
* foreach DOES NOT SORT - it uses whatever ordering is provided by the aggregate you&#039;re iterating over.  For maps and arrays, the objects themselves maintain the keys in sorted order.  For plural typed constants, the ordering is however the elements were originally listed, which is completely arbitrary (and can even include duplicate keys).&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User_talk:PhilmASTErpLus&amp;diff=6837</id>
		<title>User talk:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User_talk:PhilmASTErpLus&amp;diff=6837"/>
		<updated>2010-06-22T04:36:06Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Created page with &amp;#039;&amp;quot;aggregate&amp;quot; and &amp;quot;map&amp;quot; are NOT synonyms.  &amp;quot;aggregate&amp;quot; is an abstract type; the three concrete implementations of that type are maps, arrays, and plural typed constants (which requ…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;quot;aggregate&amp;quot; and &amp;quot;map&amp;quot; are NOT synonyms.  &amp;quot;aggregate&amp;quot; is an abstract type; the three concrete implementations of that type are maps, arrays, and plural typed constants (which require a separate implementation because they need to be immutable). --[[User:Jasonharper|Jasonharper]] 04:36, 22 June 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Item_drops_array&amp;diff=5924</id>
		<title>Item drops array</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Item_drops_array&amp;diff=5924"/>
		<updated>2010-04-05T12:02:43Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: return type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|item_drops_array}}{{&lt;br /&gt;
#vardefine:return_type|record [int]}}{{&lt;br /&gt;
#vardefine:aggregate|yes}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Item Management|&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;
}}|&lt;br /&gt;
function2={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
parameter1={{Param|monster|m}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns an array of records with three fields:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record {&lt;br /&gt;
   item drop;&lt;br /&gt;
   int rate;&lt;br /&gt;
   string type;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
Since this is the first function to return a record, it cannot be stored to a variable, and thus the only way to access the data is by iterating over the elements in the array.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=Prints all information Mafia has regarding the item drops of a certain monster.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void drops(monster mob){&lt;br /&gt;
   print(&amp;quot;Monster: &amp;quot; + mob);&lt;br /&gt;
   foreach index, rec in item_drops_array(mob) &lt;br /&gt;
      print(&amp;quot;item: &amp;quot;+rec.drop+&amp;quot;, drop rate: &amp;quot;+rec.rate+&amp;quot;, type: &amp;quot;+rec.type);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|meat_drop|item_drops}}|&lt;br /&gt;
special=The zero-parameter form returns the last monster encountered (the current one, if used in combat).&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Disable&amp;diff=5333</id>
		<title>Disable</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Disable&amp;diff=5333"/>
		<updated>2010-03-25T08:36:32Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: return values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|disable}}{{&lt;br /&gt;
#vardefine:return_type|void}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Miscellaneous|&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|string|func}}|&lt;br /&gt;
p1desc={{pspan|func}} is the name of the function you wish to disable.&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This function allows you to disable commands and/or functions by name. String {{pspan|func}} specifies the name of a CLI command or ASH function that you do not wish to be carried out. Note these include custom ASH functions (that you name yourself), but not aliases.&lt;br /&gt;
&lt;br /&gt;
Mafia has an internal array of function names which are disabled. At the start of each session, this array starts empty. Disable adds names to this array and mafia will not allow functions to be called that are named after any on the disabled list (with the exception of disable and enable). This is useful for debugging scripts, as you can quickly disable functions from the top of a script without digging through the code. In addition, when a disabled function is called, mafia will print a line informing you of this fact, while not acting on it.&lt;br /&gt;
&lt;br /&gt;
Important considerations:&lt;br /&gt;
#Mafia cannot differentiate between scripts that call functions of the same name. If function &amp;quot;foo&amp;quot; is disabled from script one, it will still be disabled when you run script two, unless you enable &amp;quot;foo&amp;quot; or restart mafia.&lt;br /&gt;
#Remember that CLI commands will be disabled if they have the same name (or can be disabled deliberately with this function).&lt;br /&gt;
#A disabled function still returns a value - the default value for its declared return type (false, 0, &amp;quot;&amp;quot;, $item[none], an empty map, etc.).  If a disabled function is incorporated into a condition (eg. &amp;quot;if(disabled_function())&amp;quot; ), then mafia will not just skip the entire conditional - execution will continue as normal, based on that default value.&lt;br /&gt;
#Using &amp;quot;all&amp;quot; as the string parameter will disable all ASH and CLI functions with the exception of enable and disable. Therefore, to re-enable all functions, you must type &amp;quot;enable all&amp;quot; into the CLI - ASH enable(&amp;quot;all&amp;quot;) would technically work, but at that point you&#039;d have no way of invoking a script that contains it.&lt;br /&gt;
#disable() and enable() cannot be individually disabled using disable(), either.&lt;br /&gt;
&amp;amp;nbsp;|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=This mini scriptlet generates a map that is outputted to a data file. In testing you might not want to do this every time, so you can disable map_to_file().|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
disable(&amp;quot;map_to_file&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|enable}}|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Visit_url&amp;diff=3021</id>
		<title>Visit url</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Visit_url&amp;diff=3021"/>
		<updated>2010-03-24T03:48:42Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: 0-arg version and relay script details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|visit_url}}{{&lt;br /&gt;
#vardefine:return_type|buffer}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=String Handling Routines|&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|string|page}}|&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|string|page}}|&lt;br /&gt;
parameter2={{Param|boolean|use_POST}}|&lt;br /&gt;
p1desc={{Pspan|page}} is the page to visit|&lt;br /&gt;
p2desc={{Pspan|use_POST}} is true for a POST request and false for a GET request|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function3={{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;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the HTML from the visited page (not just what is displayed when visiting the page, but all markup) by performing a POST request if {{pspan|use_POST}} is omitted or true, or a GET request if false. Note that for addresses inside of KoL, it is only necessary to supply the page name for {{pspan|page}}, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for {{pspan|page}}.&lt;br /&gt;
&lt;br /&gt;
The version with no parameters is only meaningful in a relay override script; it retrieves the server page that your script is overriding.  All three versions behave slightly differently in a relay script; they retrieve a version of the page with any KoLmafia decorations added, rather than the raw page from the server.|&lt;br /&gt;
&lt;br /&gt;
improvecode=yes|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=Visits your private character sheet.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
visit_url( &amp;quot;charsheet.php&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
code2={{CodeSample|&lt;br /&gt;
description=Visits google.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
visit_url( &amp;quot;http://www.google.com/&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
code3={{CodeSample|&lt;br /&gt;
description=Given a player ID, parse a player&#039;s profile for his name.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string getPlayerName( int playerID ) {&lt;br /&gt;
	string playerName;&lt;br /&gt;
&lt;br /&gt;
	// use visit_url() to store the player profile&#039;s HTML in a string&lt;br /&gt;
	string playerProfile = visit_url(&amp;quot;/showplayer.php?who=&amp;quot; + playerID);&lt;br /&gt;
	if ( contains_text(playerProfile, &amp;quot;&amp;lt;td&amp;gt;Sorry, this player could not be found.&amp;lt;/td&amp;gt;&amp;quot;) ) {&lt;br /&gt;
		print(&amp;quot;Player &amp;quot; + playerID + &amp;quot;does not exist.&amp;quot;,&amp;quot;red&amp;quot;);&lt;br /&gt;
		return &amp;quot;&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
	// find player name in the string returned by visit_url()&lt;br /&gt;
	matcher match_name = create_matcher( &amp;quot;&amp;lt;b&amp;gt;([^&amp;lt;]+)&amp;lt;/b&amp;gt; \\(#&amp;quot; + playerID + &amp;quot;\\)&amp;lt;br&amp;gt;&amp;quot;, playerProfile );&lt;br /&gt;
	if ( match_name.find() ) {&lt;br /&gt;
		playerName = match_name.group(1);&lt;br /&gt;
	}&lt;br /&gt;
	else {&lt;br /&gt;
		print(&amp;quot;Problem occured while parsing for player name&amp;quot;,&amp;quot;red&amp;quot;);&lt;br /&gt;
		return &amp;quot;&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return playerName;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
special=Note that this function returns an empty string if the page does not exist or if the request times-out.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Modifiers&amp;diff=5819</id>
		<title>Modifiers</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Modifiers&amp;diff=5819"/>
		<updated>2010-03-19T04:50:40Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Modified!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Here is a comprehensive list of modifiers calculated by KoLMafia. Note that these are also available as ASH functions -- the first form, which takes one parameter, information about your character&#039;s current state; the second form, which takes two parameters, information about the [string|item|effect|skill|familiar] in question.&lt;br /&gt;
&lt;br /&gt;
To view this list of modifiers as it pertains to your character, use the CLI command &amp;quot;modref&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A list of the functions used to access these modifiers can be found at [[Modifier Functions]].&lt;br /&gt;
&lt;br /&gt;
==Numeric Modifiers==&lt;br /&gt;
Note that although some of these functions have an ASH derivative that may be easier to use, the two-parameter form is still relevant and rather useful when obtaining information about a particular [string|item|effect|skill|familiar], rather than your current state.&lt;br /&gt;
&lt;br /&gt;
When not logged in, these all return 0 for the 1-parameter form of [[numeric_modifier|numeric_modifier()]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Modifier Name&lt;br /&gt;
!  Related ASH function / Notes&lt;br /&gt;
|-&lt;br /&gt;
| Familiar Weight&lt;br /&gt;
| [[weight_adjustment| weight_adjustment()]]&lt;br /&gt;
|-&lt;br /&gt;
| Monster Level&lt;br /&gt;
| [[monster_level_adjustment| monster_level_adjustment()]]&lt;br /&gt;
|-&lt;br /&gt;
| Combat Rate&lt;br /&gt;
| [[combat_rate_modifier| combat_rate_modifier()]]&lt;br /&gt;
|-&lt;br /&gt;
| Initiative&lt;br /&gt;
| [[initiative_modifier| initiative_modifier()]]&lt;br /&gt;
|-&lt;br /&gt;
| Experience&lt;br /&gt;
| [[experience_bonus| experience_bonus()]]&lt;br /&gt;
|-&lt;br /&gt;
| Item Drop&lt;br /&gt;
| [[item_drop_modifier| item_drop_modifier()]]&lt;br /&gt;
|-&lt;br /&gt;
| Meat Drop&lt;br /&gt;
| [[meat_drop_modifier| meat_drop_modifier()]]&lt;br /&gt;
|-&lt;br /&gt;
| Damage Absorption&lt;br /&gt;
| [[raw_damage_absorption| raw_damage_absorption()]]&lt;br /&gt;
|-&lt;br /&gt;
| Damage Reduction&lt;br /&gt;
| [[damage_reduction|damage_reduction()]]&lt;br /&gt;
|-&lt;br /&gt;
| Cold Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[cold] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Hot Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[hot] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Sleaze Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[sleaze] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Spooky Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[spooky] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Stench Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[stench] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Mana Cost&lt;br /&gt;
| Similar to [[mana_cost_modifier|mana_cost_modifier()]] -- only counts up to the -3 cap.&lt;br /&gt;
|-&lt;br /&gt;
| Moxie&lt;br /&gt;
| Sum of all absolute moxie modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Moxie Percent&lt;br /&gt;
| Sum of all percentage-based moxie modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Muscle&lt;br /&gt;
| Sum of all absolute muscle modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Muscle Percent&lt;br /&gt;
| Sum of all percentage-based muscle modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Mysticality&lt;br /&gt;
| Sum of all absolute mysticality modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Mysticality Percent&lt;br /&gt;
| Sum of all percentage-based mysticality modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum HP&lt;br /&gt;
| Sum of all absolute HP modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum HP Percent&lt;br /&gt;
| Sum of all percentage-based HP modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum MP&lt;br /&gt;
| Sum of all absolute MP modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum MP Percent&lt;br /&gt;
| Sum of all percentage-based MP modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Weapon Damage&lt;br /&gt;
| Sum of all absolute weapon damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Ranged Damage&lt;br /&gt;
| Sum of all absolute ranged damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Spell Damage&lt;br /&gt;
| Sum of all absolute spell damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Spell Damage Percent&lt;br /&gt;
| Sum of all percentage-based spell damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Cold Damage&lt;br /&gt;
| Total cold damage.&lt;br /&gt;
|-&lt;br /&gt;
| Hot Damage&lt;br /&gt;
| Total hot damage.&lt;br /&gt;
|-&lt;br /&gt;
| Sleaze Damage&lt;br /&gt;
| Total sleaze damage.&lt;br /&gt;
|-&lt;br /&gt;
| Spooky Damage&lt;br /&gt;
| Total spooky damage.&lt;br /&gt;
|-&lt;br /&gt;
| Stench Damage&lt;br /&gt;
| Total stench damage.&lt;br /&gt;
|-&lt;br /&gt;
| Cold Spell Damage&lt;br /&gt;
| Total cold spell damage.&lt;br /&gt;
|-&lt;br /&gt;
| Hot Spell Damage&lt;br /&gt;
| Total hot spell damage.&lt;br /&gt;
|-&lt;br /&gt;
| Sleaze Spell Damage&lt;br /&gt;
| Total sleaze spell damage.&lt;br /&gt;
|-&lt;br /&gt;
| Spooky Spell Damage&lt;br /&gt;
| Total spooky spell damage.&lt;br /&gt;
|-&lt;br /&gt;
| Stench Spell Damage&lt;br /&gt;
| Total stench spell damage.&lt;br /&gt;
|-&lt;br /&gt;
| Critical&lt;br /&gt;
| Critical multiplier.&lt;br /&gt;
|-&lt;br /&gt;
| Fumble&lt;br /&gt;
| Fumble multiplier.&lt;br /&gt;
|-&lt;br /&gt;
| HP Regen Min&lt;br /&gt;
| Lower bound of all HP-regenerating effects/equipment.&lt;br /&gt;
|-&lt;br /&gt;
| HP Regen Max&lt;br /&gt;
| Upper bound of all HP-regenerating effects/equipment.&lt;br /&gt;
|-&lt;br /&gt;
| MP Regen Min&lt;br /&gt;
| Lower bound of all MP-regenerating effects/equipment.&lt;br /&gt;
|-&lt;br /&gt;
| MP Regen Max&lt;br /&gt;
| Upper bound of all MP-regenerating effects/equipment.&lt;br /&gt;
|-&lt;br /&gt;
| Adventures&lt;br /&gt;
| Bonus Rollover adventures&lt;br /&gt;
|-&lt;br /&gt;
| Familiar Weight Percent&lt;br /&gt;
| Percentage modifier of Familiar Weight (from Bad Moon effects; always &amp;lt;= 0)&lt;br /&gt;
|-&lt;br /&gt;
| Weapon Damage Percent&lt;br /&gt;
| Sum of all percentage-based weapon damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Ranged Damage Percent&lt;br /&gt;
| Sum of all percentage-based ranged damage modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Stackable Mana Cost&lt;br /&gt;
| Similar to [[mana_cost_modifier|mana_cost_modifier()]] -- all other MP cost modifiers.&lt;br /&gt;
|-&lt;br /&gt;
| Hobo Power&lt;br /&gt;
| Hobo Power from equipment and effects (effect, technically).&lt;br /&gt;
|-&lt;br /&gt;
| Base Resting HP&lt;br /&gt;
| Average HP gained from resting.&lt;br /&gt;
|-&lt;br /&gt;
| Resting HP Percent&lt;br /&gt;
| Percentage modifier to HP gained from resting (e.g. from Pagoda).&lt;br /&gt;
|-&lt;br /&gt;
| Bonus Resting HP&lt;br /&gt;
| Absolute modifier to HP gained from resting (e.g. from Gauze hammock).&lt;br /&gt;
|-&lt;br /&gt;
| Base Resting MP&lt;br /&gt;
| MP gained from resting.&lt;br /&gt;
|-&lt;br /&gt;
| Resting MP Percent&lt;br /&gt;
| Percentage modifier to HP gained from resting (e.g. Pagoda).&lt;br /&gt;
|-&lt;br /&gt;
| Bonus Resting MP&lt;br /&gt;
| Absolute modifier to HP gained from resting (e.g. from Beanbag chair).&lt;br /&gt;
|-&lt;br /&gt;
| Critical Hit Percent&lt;br /&gt;
| Percentage modifiers to critical hits (e.g. Depleted Grimacite Kneecapping stick).&lt;br /&gt;
|-&lt;br /&gt;
| PvP Fights&lt;br /&gt;
| Bonus PvP fights upon Rollover.&lt;br /&gt;
|-&lt;br /&gt;
| Volleyball&lt;br /&gt;
| Only for use with multiple parameters (e.g. Llama returns .5, metallic foil radar dish returns -1).&lt;br /&gt;
|-&lt;br /&gt;
| Sombrero&lt;br /&gt;
| Only for use with multiple parameters (e.g. Baby Sandworm returns 1, metallic foil radar dish returns 1).&lt;br /&gt;
|-&lt;br /&gt;
| Leprechaun&lt;br /&gt;
| Only for use with multiple parameters (e.g. Hobo monkey returns 1.25).&lt;br /&gt;
|-&lt;br /&gt;
| Fairy&lt;br /&gt;
| Only for use with multiple parameters (e.g. Hound dog returns 1.25).&lt;br /&gt;
|-&lt;br /&gt;
| Meat Drop Penalty&lt;br /&gt;
| Penalty to Meat Drops; result of having an Underwater location selected as your current location.&lt;br /&gt;
|-&lt;br /&gt;
| Hidden Familiar Weight&lt;br /&gt;
| Bonus familiar weight that does not show up on the character pane (e.g. from Temporary Teardrop Tattoo).&lt;br /&gt;
|-&lt;br /&gt;
| Item Drop Penalty&lt;br /&gt;
| Penalty to Item Drops; result of having an Underwater location selected as your current location.&lt;br /&gt;
|-&lt;br /&gt;
| Initiative Penalty&lt;br /&gt;
| Penalty to Initiative Drops; result of having an Underwater location selected as your current location.&lt;br /&gt;
|-&lt;br /&gt;
| Food Drop&lt;br /&gt;
| Exclusive bonus to food drops (e.g. Brother Flying Burrito&#039;s Blessing).&lt;br /&gt;
|-&lt;br /&gt;
| Booze Drop&lt;br /&gt;
| Exclusive bonus to food drops (e.g. Brother Smother&#039;s Blessing).&lt;br /&gt;
|-&lt;br /&gt;
| Hat Drop&lt;br /&gt;
| Exclusive bonus to hat drops (e.g. velcro broadsword).&lt;br /&gt;
|-&lt;br /&gt;
| Weapon Drop&lt;br /&gt;
| Exclusive bonus to weapon drops (e.g. velcro broadsword).&lt;br /&gt;
|-&lt;br /&gt;
| Offhand Drop&lt;br /&gt;
| Exclusive bonus to offhand drops (None at the moment; placeholder).&lt;br /&gt;
|-&lt;br /&gt;
| Shirt Drop&lt;br /&gt;
| Exclusive bonus to shirt drops (None at the moment; placeholder).&lt;br /&gt;
|-&lt;br /&gt;
| Pants Drop&lt;br /&gt;
| Exclusive bonus to weapon drops (e.g. Baneful Bandolier).&lt;br /&gt;
|-&lt;br /&gt;
| Accessory Drop&lt;br /&gt;
| Exclusive bonus to weapon drops (e.g. velcro paddle ball).&lt;br /&gt;
|-&lt;br /&gt;
| Volleyball Effectiveness&lt;br /&gt;
| Exclusive to the Baby Mutant Rattlesnake; evaluates an expression that factors in the current moon phase.&lt;br /&gt;
|-&lt;br /&gt;
| Sombrero Effectiveness&lt;br /&gt;
| None.&lt;br /&gt;
|-&lt;br /&gt;
| Leprechaun Effectiveness&lt;br /&gt;
| Exclusive to the Mutant Cactus Bud; evaluates an expression that factors in the current moon phase.&lt;br /&gt;
|-&lt;br /&gt;
| Fairy Effectiveness&lt;br /&gt;
| Exclusive to the Mutant Fire Ant; evaluates an expression that factors in the current moon phase.&lt;br /&gt;
|-&lt;br /&gt;
| Familiar Weight Cap&lt;br /&gt;
| (?) Maximum base weight for the current familiar.&lt;br /&gt;
|-&lt;br /&gt;
| Slime Resistance&lt;br /&gt;
| Similar to [[elemental_resistance|elemental_resistance( $element[slime] )]], but returns the level of resistance.&lt;br /&gt;
|-&lt;br /&gt;
| Slime Hates It&lt;br /&gt;
| Number of Slime Hates It active, as taken from equipment and effects.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum HP Nonmultiplied&lt;br /&gt;
| Bonus to HP from Slimy Sinews since it is not affected by HP multipliers.&lt;br /&gt;
|-&lt;br /&gt;
| Maximum MP Nonmultiplied&lt;br /&gt;
| Bonus to MP from Slimy Synapses since it is not affected by MP multipliers.&lt;br /&gt;
|-&lt;br /&gt;
| Spell Critical Percent&lt;br /&gt;
| Increased absolute spell critical rate.&lt;br /&gt;
|-&lt;br /&gt;
| Muscle Experience&lt;br /&gt;
| +X Mus substats/fight&lt;br /&gt;
|-&lt;br /&gt;
| Mysticality Experience&lt;br /&gt;
| +X Mys substats/fight&lt;br /&gt;
|-&lt;br /&gt;
| Moxie Experience&lt;br /&gt;
| +X Mox substats/fight&lt;br /&gt;
|-&lt;br /&gt;
| Effect Duration&lt;br /&gt;
| For use with the two-parameter form, using item as the other parameter. Returns duration of effect for potions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Derived Modifiers==&lt;br /&gt;
These are modifiers that are calculated based on other modifier values, rather than being a property of individual items.  They can be used just like the numeric modifier names above, but are fairly useless with the one-parameter form of the function since you can easily retrieve the actual values (which may differ slightly from these predicted values, due to different rounding behavior or other errors in KoLmafia&#039;s modifier calculations).  The intended usage is in the form numeric_modifier(&amp;quot;_spec&amp;quot;, &#039;&#039;name&#039;&#039;), to determine the results of a potential equipment or effect change that has been tested by the CLI &#039;&#039;&#039;whatif&#039;&#039;&#039; command.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Modifier Name&lt;br /&gt;
!  Related ASH function / Notes&lt;br /&gt;
|-&lt;br /&gt;
| Buffed Muscle&lt;br /&gt;
| Predicted value of [[my_buffedstat|my_buffedstat($stat[muscle])]]&lt;br /&gt;
|-&lt;br /&gt;
| Buffed Mysticality&lt;br /&gt;
| Predicted value of [[my_buffedstat|my_buffedstat($stat[mysticality])]]&lt;br /&gt;
|-&lt;br /&gt;
| Buffed Moxie&lt;br /&gt;
| Predicted value of [[my_buffedstat|my_buffedstat($stat[moxie])]]&lt;br /&gt;
|-&lt;br /&gt;
| Buffed HP Maximum&lt;br /&gt;
| Predicted value of [[my_maxhp|my_maxhp()]]&lt;br /&gt;
|-&lt;br /&gt;
| Buffed MP Maximum&lt;br /&gt;
| Predicted value of [[my_maxmp|my_maxmp()]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Bitmap Modifiers==&lt;br /&gt;
Note: This does not have a corresponding ASH function. Instead, they can all be called using the [[numeric_modifier|numeric_modifier()]] function. &lt;br /&gt;
When not logged in, these all return 0x0 (0).&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Modifier Name&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
| Clownosity&lt;br /&gt;
| If this is &amp;gt;= 4, you can &amp;quot;Push the nose&amp;quot; in the Fun House.&lt;br /&gt;
|-&lt;br /&gt;
| Brimstone&lt;br /&gt;
| These have many &amp;quot;bonuses&amp;quot; when you equip more of them at once.&lt;br /&gt;
|-&lt;br /&gt;
| Synergetic&lt;br /&gt;
| For items that have hidden bonuses when used together, such as the Secrets from the Future and the snake/wolf sword &amp;amp; shield.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Boolean Modifiers==&lt;br /&gt;
When not logged in, these all return false for the 1-parameter form of [[boolean_modifier|boolean_modifier()]].&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Modifier Name&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
| Softcore Only&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question has the Softcore Only flag (e.g. Travoltan Trousers).&lt;br /&gt;
|-&lt;br /&gt;
| Single Equip&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question has the Single Equip flag (e.g. plexiglass pendant).&lt;br /&gt;
|-&lt;br /&gt;
| Never Fumble&lt;br /&gt;
| Returns true if the player has an effect that prevents fumbling.&lt;br /&gt;
|-&lt;br /&gt;
| Weakens Monster&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question delevels on hit (e.g. 7-foot dwarven mattock).&lt;br /&gt;
|-&lt;br /&gt;
| Free Pull&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question can be pulled from Hagnk&#039;s for free (e.g. roll of toilet paper).&lt;br /&gt;
|-&lt;br /&gt;
| Variable&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question has a variable effect (e.g. depleted grimacite grappling hook).&lt;br /&gt;
|-&lt;br /&gt;
| Nonstackable Watch&lt;br /&gt;
| For use with the parameter &amp;quot;item&amp;quot;; returns true if the item in question counts as one of the nonstackable watches (e.g. dead guy&#039;s watch).&lt;br /&gt;
|-&lt;br /&gt;
| Cold Immunity&lt;br /&gt;
| Returns true if Coldform is active.&lt;br /&gt;
|-&lt;br /&gt;
| Hot Immunity&lt;br /&gt;
| Returns true if Hotform is active.&lt;br /&gt;
|-&lt;br /&gt;
| Sleaze Immunity&lt;br /&gt;
| Returns true if Sleazeform is active.&lt;br /&gt;
|-&lt;br /&gt;
| Spooky Immunity&lt;br /&gt;
| Returns true if Spookyform is active.&lt;br /&gt;
|-&lt;br /&gt;
| Stench Immunity&lt;br /&gt;
| Returns true if Stenchform is active.&lt;br /&gt;
|-&lt;br /&gt;
| Cold Vulnerability&lt;br /&gt;
| Returns true if the player is vulnerable to Cold (e.g. from Sleazeform).&lt;br /&gt;
|-&lt;br /&gt;
| Hot Vulnerability&lt;br /&gt;
| Returns true if the player is vulnerable to Hot (e.g. from Spookyform).&lt;br /&gt;
|-&lt;br /&gt;
| Sleaze Vulnerability&lt;br /&gt;
| Returns true if the player is vulnerable to Sleaze (e.g. from Stenchform).&lt;br /&gt;
|-&lt;br /&gt;
| Spooky Vulnerability&lt;br /&gt;
| Returns true if the player is vulnerable to Spooky (e.g. from Coldform).&lt;br /&gt;
|-&lt;br /&gt;
| Stench Vulnerability&lt;br /&gt;
| Returns true if the player is vulnerable to Stench (e.g. from Hotform).&lt;br /&gt;
|-&lt;br /&gt;
| Moxie Controls MP&lt;br /&gt;
| Returns true if the player has a moxie magnet equipped.&lt;br /&gt;
|-&lt;br /&gt;
| Moxie May Control MP&lt;br /&gt;
| Returns true if the player has Travoltan Trousers equipped (but not the moxie magnet?).&lt;br /&gt;
|-&lt;br /&gt;
| Four Songs&lt;br /&gt;
| Returns true if the player is able to &amp;quot;Keep 4 songs in [his] head instead of 3&amp;quot; (e.g. Brimstone Beret).&lt;br /&gt;
|-&lt;br /&gt;
| Additional Song&lt;br /&gt;
| Returns true if the player has the bonus from the El Hebilla del Cinturón de Lopez (Accordion Thief Epic Accessory).&lt;br /&gt;
|-&lt;br /&gt;
| Adventure Underwater&lt;br /&gt;
| Returns true if the player has some way to breathe underwater (e.g. makeshift SCUBA gear).&lt;br /&gt;
|-&lt;br /&gt;
| Underwater Familiar&lt;br /&gt;
| Returns true if the player&#039;s familiar has some way to breathe underwater (e.g. das boot).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==String Modifiers==&lt;br /&gt;
Note: These all appear in the two-parameter form.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Modifier Name&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
| Class&lt;br /&gt;
| Returns the class you must be to benefit from any of the enchantments on this item.&lt;br /&gt;
|-&lt;br /&gt;
| Intrinsic Effect&lt;br /&gt;
| Returns the intrinsic effect granted by a piece of equipment (e.g. Chapped Legs from leather chaps).&lt;br /&gt;
|-&lt;br /&gt;
| Equalize&lt;br /&gt;
| Returns the base stat of an equalizer potion.&lt;br /&gt;
|-&lt;br /&gt;
| Wiki Name&lt;br /&gt;
| Returns an empty string unless it is different, in which case the special HTML entities have been replaced. (e.g. frigid hankyu)&lt;br /&gt;
|-&lt;br /&gt;
| Modifiers&lt;br /&gt;
| Returns the raw text of this item&#039;s modifier data, useful for a quick view of all its enchantments.&lt;br /&gt;
|-&lt;br /&gt;
| Outfit&lt;br /&gt;
| Returns the name of the outfit (non-custom, folks!) that this item is part of.&lt;br /&gt;
|-&lt;br /&gt;
| Stat Tuning&lt;br /&gt;
| (Crimbo &#039;06 items, like tropical paperweight?)&lt;br /&gt;
|-&lt;br /&gt;
| Familiar Tuning&lt;br /&gt;
| Bandersnatch fold-able equipment.&lt;br /&gt;
|-&lt;br /&gt;
| Effect&lt;br /&gt;
| Returns the effect that KoL associates with a potion (which may not be the potion&#039;s only effect).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{RFI|Can someone check to make sure that I didn&#039;t screw up?|Also, fill in the missing data?}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Append_tail&amp;diff=5606</id>
		<title>Append tail</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Append_tail&amp;diff=5606"/>
		<updated>2010-03-12T19:09:56Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Redirected; this function is neither explainable nor usable on its own&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Append_replacement]]&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Append_replacement&amp;diff=5601</id>
		<title>Append replacement</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Append_replacement&amp;diff=5601"/>
		<updated>2010-03-12T19:08:04Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Explainified!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|append_replacement(), append_tail}}{{&lt;br /&gt;
#vardefine:return_type|buffer}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=String Handling Routines|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name=append_replacement|&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|matcher|match}}|&lt;br /&gt;
parameter2={{Param|buffer|buff}}|&lt;br /&gt;
parameter3={{Param|string|replace}}|&lt;br /&gt;
}}|&lt;br /&gt;
function2={{Function|&lt;br /&gt;
name=append_tail|&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|matcher|match}}|&lt;br /&gt;
parameter2={{Param|buffer|buff}}|&lt;br /&gt;
p1desc={{Pspan|match}} is a matcher created with the original string and search pattern|&lt;br /&gt;
p2desc={{Pspan|buff}} is the buffer in which the modified string is being accumulated|&lt;br /&gt;
p3desc={{Pspan|replace}} is the replacement text for the current match of the search pattern, with the same meanings for special characters as in [[replace_all|replace_all()]]|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=These two functions are the building blocks for a regular expression-based search and replace operation.  Most of the time, you can use the more straightforward [[replace_string|replace_string()]] or [[replace_all|replace_all()]] functions instead; the only time you actually need to use these functions is when the replacement text has to be generated in some special way, rather than being a constant.&lt;br /&gt;
&lt;br /&gt;
To use these functions, you must have a matcher variable which has been created with the desired search pattern and original text, and a buffer variable in which the modified string will be built.  append_replacement() (which is only valid immediately after [[find|find()]] has returned true for {{Pspan|match}}) will copy text into the buffer starting after the previous match (or the start of the original string) through the start of the current match, and will then append the {{Pspan|replace}} string.  append_tail() (which is normally called only once, after find() returns false) will copy any remaining text into the buffer, after the final match.  Both functions return {{Pspan|buff}}, for convenience.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=This sample will replace every 4-letter word in the input string with its uppercase version.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string cap4(string input)&lt;br /&gt;
{&lt;br /&gt;
	buffer b;&lt;br /&gt;
	matcher m = create_matcher(&amp;quot;\\b\\w{4}\\b&amp;quot;, input);&lt;br /&gt;
	while (m.find()) {&lt;br /&gt;
		m.append_replacement(b, m.group().to_upper_case());&lt;br /&gt;
	}&lt;br /&gt;
	m.append_tail(b);&lt;br /&gt;
	return b.to_string();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
print(cap4(&amp;quot;did this script work right?&amp;quot;));&lt;br /&gt;
// Output will be: did THIS script WORK right?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|create_matcher}}|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:My_primestat&amp;diff=5555</id>
		<title>Talk:My primestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:My_primestat&amp;diff=5555"/>
		<updated>2010-03-12T04:55:01Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: GIGO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Re the special info: This does not make sense to me. It does return $stat[moxie], but I can&#039;t really justify this --  $stat[moxie].to_int() is 3, not 0. It&#039;d be helpful if someone could explain -why- this happens. --[[User:Heeheehee|Heeheehee]] 04:35, 12 March 2010 (UTC)&lt;br /&gt;
* What&#039;s there to explain?  The not-logged-in value of functions that are only meaningful when logged in is pure garbage.  There was no effort expended towards having them return a particular value; any value that doesn&#039;t immediately cause a crash is good enough.  There is no guarantee that the garbage value will be consistent between versions of the program, or even successive calls to the function.&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=File_to_map&amp;diff=3059</id>
		<title>File to map</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=File_to_map&amp;diff=3059"/>
		<updated>2010-03-11T04:43:43Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: What is &amp;quot;has not been initialized&amp;quot; supposed to mean?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|file_to_map}}{{&lt;br /&gt;
#vardefine:return_type|boolean}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Miscellaneous|&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|string|file_to_load}}|&lt;br /&gt;
parameter2={{Param|aggregate|map_to_fill}}|&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|string|file_to_load}}|&lt;br /&gt;
parameter2={{Param|aggregate|map_to_fill}}|&lt;br /&gt;
parameter3={{Param|boolean|compact}}|&lt;br /&gt;
p1desc={{Pspan|file_to_load}} is the filename to load from|&lt;br /&gt;
p2desc={{Pspan|map_to_fill}} is the map to populate with data|&lt;br /&gt;
p3desc={{Pspan|compact}} is an (optional) flag; if omitted or true, records that do not contain any aggregate values are expected to be written on a single line, rather that one line per field.|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Loads data to the {{pspan|map_to_fill}} from a saved {{pspan|file_to_load}} in your KoLmafia &amp;quot;data&amp;quot; or &amp;quot;scripts&amp;quot; directory. The {{pspan|compact}} parameter is not needed unless you specified it in the [[map_to_file|map_to_file()]] call that originally generated the file, in which case the values must match. This function returns the operation&#039;s success. If {{pspan|map_to_fill}} has not been initialized, this function will abort (as oppossed to returning false).|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=This sample loads a simple map that includes item names keyed by a number.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string [int] my_list;&lt;br /&gt;
file_to_map( &amp;quot;SavedList.txt&amp;quot; , my_list);&lt;br /&gt;
for i from 0 to (count(my_list) - 1) {&lt;br /&gt;
   print( &amp;quot;At index: &amp;quot; + i + &amp;quot; We find: &amp;quot; + my_list[i] );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|&lt;br /&gt;
moreinfo=&lt;br /&gt;
If the file &amp;quot;SavedList.txt&amp;quot; had the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0	StDoodle&lt;br /&gt;
1	Grotfang&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the results would be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At index: 0 We find: StDoodle&lt;br /&gt;
At index: 1 We find: Grotfang&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|map_to_file|}}|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Map_to_file&amp;diff=3083</id>
		<title>Map to file</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Map_to_file&amp;diff=3083"/>
		<updated>2010-03-11T04:30:39Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Where did you come up with this stuff?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|map_to_file}}{{&lt;br /&gt;
#vardefine:return_type|boolean}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Miscellaneous|&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|aggregate|map_to_save}}|&lt;br /&gt;
parameter2={{Param|string|file_to_save}}|&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|aggregate|map_to_save}}|&lt;br /&gt;
parameter2={{Param|string|file_to_save}}|&lt;br /&gt;
parameter3={{Param|boolean|compact}}|&lt;br /&gt;
p1desc={{Pspan|map_to_save}} is the map to save data from|&lt;br /&gt;
p2desc={{Pspan|file_to_save}} is the filename to save to|&lt;br /&gt;
p3desc={{Pspan|compact}} is an (optional) flag; if omitted or true, record values are written on a single line of the file when possible, rather than one field per line|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Saves the data in the {{pspan|map_to_save}} to the {{pspan|file_to_save}} in your KoLmafia &amp;quot;data&amp;quot; directory. The {{pspan|compact}} parameter exists only for backwards compatibility; there is no need to use it in new code (but if you do use it, you must pass the same value to [[file_to_map|file_to_map()]] to successfully read any records within your map). This function returns the operation&#039;s success. If {{pspan|file_to_save}} already exists, this function will override (not append) the file&#039;s contents with the new data. It&#039;s also worth noting that, once saved, the data in {{pspan|file_to_save}} is not tied to any particular map; it can be loaded into another map or slice, as long as the datatypes are compatible.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As this &amp;amp; [[file_to_map|file_to_map()]] are KoLmafia&#039;s only I/O functions, they are invaluable for an ASH scripter wishing to save any script settings or information too complex to easily fit in a user preference. However, caution should be used, as a single failed operation of this function could result in the loss of all such data. For anything difficult to re-create, or too important to lose, the script author should be careful to save backups and check for function success during such operations.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=This sample saves a simple map of a user&#039;s responses to questions.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
boolean [string] answers;&lt;br /&gt;
answers[&amp;quot;Chocolate&amp;quot;] = user_confirm( &amp;quot;Do you like chocolate?&amp;quot; );&lt;br /&gt;
answers[&amp;quot;CuteKittens&amp;quot;] = user_confirm( &amp;quot;Do you like cute kittens?&amp;quot; );&lt;br /&gt;
answers[&amp;quot;ThisGame&amp;quot;] = user_confirm( &amp;quot;Do you like KoL?&amp;quot; );&lt;br /&gt;
if (map_to_file( answers , &amp;quot;WhatYouLike.txt&amp;quot; ))&lt;br /&gt;
   print( &amp;quot;Your answers were saved successfully.&amp;quot; );&lt;br /&gt;
else&lt;br /&gt;
   print( &amp;quot;There was a problem saving your answers.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|&lt;br /&gt;
moreinfo=&lt;br /&gt;
If the user answered No, Yes, Yes to the questions, they should now have a file that contains:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Chocolate	false&lt;br /&gt;
CuteKittens	true&lt;br /&gt;
ThisGame	true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|file_to_map}}|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Datatype_Conversions&amp;diff=1828</id>
		<title>Datatype Conversions</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Datatype_Conversions&amp;diff=1828"/>
		<updated>2010-03-09T00:07:31Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: +historical note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part 10 - Datatype Conversions ==&lt;br /&gt;
&lt;br /&gt;
These functions will convert 1 type of data to another.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean to_boolean( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into boolean.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;class to_class( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a class.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;effect to_effect( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into an effect.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, skill&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;familiar to_familiar( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a familiar.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;float to_float( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a float.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, item, location, familiar, skill, effect, slot, element, monster, boolean, class, stat&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int to_int( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into the number that will be recognized by the KoL server. Needed when you&amp;amp;#8217;re building raw URLs from time to time.&amp;lt;br /&amp;gt;&lt;br /&gt;
accepts: string, float, item, location, familiar, skill, effect, slot, element, monster, boolean, class, stat&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;item to_item( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into an item.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;location to_location( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a location.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;monster to_monster( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a monster.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string to_plural( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a string of its plural.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: item&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;skill to_skill( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a skill.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, effect&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;slot to_slot( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a slot.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: item&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string to_string( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts in-game variables to printable counterparts. The print command will cast non-string values properly now, but these are still useful for building URLs and setting properties.&amp;lt;br /&amp;gt;&lt;br /&gt;
accepts: boolean, int, float, item, location, familiar, class, stat, skill, effect, slot, element, monster&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Historical note ==&lt;br /&gt;
ASH did not originally support polymorphic functions, so it was not possible to have (for example) a single &#039;&#039;&#039;to_string(any)&#039;&#039;&#039; function that worked on any datatype.  Instead, there were separate &#039;&#039;&#039;int_to_string(int)&#039;&#039;&#039;, &#039;&#039;&#039;item_to_string(item)&#039;&#039;&#039;, etc. functions.  You may see these used in older scripts, and in fact they still work.  The rule is that if a function name is not otherwise defined anywhere, and it ends with one of the modern type conversion function names shown above, it is treated as a call to the modern function.  No check is made to verify that the chopped-off portion of the old function name actually matches the type of its parameter.&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Have_outfit&amp;diff=5106</id>
		<title>Talk:Have outfit</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Have_outfit&amp;diff=5106"/>
		<updated>2010-03-07T19:19:32Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I know for a fact that exactly 0 outfits have chefstaves in them. Will check for torso in a bit on one of my alts without Torso permed. --[[User:Heeheehee|Heeheehee]] 17:52, 7 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
As I believe was discussed in IRC, this function supposedly can check for custom outfits. If it really can&#039;t, and that&#039;s intentional, then yeah, the chefstaff part isn&#039;t an issue (at least currently). --[[User:StDoodle|StDoodle]] 19:10, 7 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Pro tip: anything that implies that mafia has any knowledge about the components of a custom outfit is a lie. --[[User:Jasonharper|Jasonharper]] 19:19, 7 March 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Have_outfit&amp;diff=5088</id>
		<title>Have outfit</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Have_outfit&amp;diff=5088"/>
		<updated>2010-03-07T19:17:54Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: no custom outfits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:name|have_outfit}}&lt;br /&gt;
{{#vardefine:return_type|boolean}}&lt;br /&gt;
&lt;br /&gt;
{{FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Equipment|&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|string|name}}|&lt;br /&gt;
p1desc={{Pspan|name}} is an outfit to check for|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This function returns true if you have all parts of the outfit {{Pspan|name}} and meet all of the stat requirements to equip it. Only in-game outfits are currently supported, not custom outfits.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|outfit}}|&lt;br /&gt;
cli_equiv=The CLI command command &amp;quot;outfit&amp;quot; with the parameter &amp;quot;list&amp;quot; gives information on the in-game outfits you have available (but does not list custom outfits or check for whether the outfit can be equipped).|&lt;br /&gt;
}}&lt;br /&gt;
{{RFI|Does this function check for misc. requirements such as torso &amp;amp; chefstaff wielding ability?|The custom outfit part was already listed; but how? (It doesn&#039;t work for me, is a specific prefix required? What?)}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Group_string&amp;diff=4386</id>
		<title>Group string</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Group_string&amp;diff=4386"/>
		<updated>2010-03-05T16:41:08Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:name|group_string}}&lt;br /&gt;
{{#vardefine:return_type|string [int, int]}}&lt;br /&gt;
{{#vardefine:aggregate|yes}}&lt;br /&gt;
&lt;br /&gt;
{{FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=String Handling Routines|&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|string|group_me}}|&lt;br /&gt;
parameter2={{Param|string|group_by}}|&lt;br /&gt;
p1desc={{Pspan|group_me}} is the string to split into groups|&lt;br /&gt;
p2desc={{Pspan|group_by}} is the regular expression to group by|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This function finds all (non-overlapping) matches of the regular expression {{pspan|group_by}} within the string {{pspan|group_me}}.  A 2-dimensional array of matching strings is returned.  The first index is the number of the match, starting with 0 for the first match.  The second index is the number of the group within each match, with exactly the same meaning as the 2nd parameter to [[group|group()]]: element 0 is the entire text matched by the regular expression, element 1 is the text matched by the first set of grouping parentheses within the expression, element 2 is the second set of grouping parentheses, and so on.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
more_info= See [http://kolmafia.us/showthread.php?t=318 this thread] for details.|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{RFI|The regex isn&#039;t too hard to parse, but the results are.|For results, I always see [int,0] and [int,1] keys; huh?}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Retrieve_item&amp;diff=2780</id>
		<title>Retrieve item</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Retrieve_item&amp;diff=2780"/>
		<updated>2010-03-05T16:18:14Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: order of operations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:name|retrieve_item}}&lt;br /&gt;
{{#vardefine:return_type|boolean}}&lt;br /&gt;
&lt;br /&gt;
{{FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Item Management|&lt;br /&gt;
second_category=Adventuring|&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|qty}}|&lt;br /&gt;
parameter2={{Param|item|get}}|&lt;br /&gt;
p1desc={{Pspan|qty}} is the quantity to acquire|&lt;br /&gt;
p2desc={{Pspan|get}} is the item to acquire|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Uses KoLmafia&#039;s internal logic to gather the items in the least destructive manner. Returns true if items are acquired as specified and false if not.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|buy}}|&lt;br /&gt;
cli_equiv=The CLI command &amp;quot;acquire&amp;quot; works similarly.|&lt;br /&gt;
special=Unlike a few other ASH commands, retrieve_item() will still return false on attempts to acquire items that are not possible to get (such as a sparkly engagement ring).&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;h2&amp;gt;Order of operations&amp;lt;/h2&amp;gt;&lt;br /&gt;
This is the current order in which retrieval options are tried, as of about r8200.  Note that this is an extremely condensed summary of several hundred lines of internal code, and that the details are subject to change&lt;br /&gt;
* items already in inventory&lt;br /&gt;
* items currently equipped&lt;br /&gt;
* items equipped on a non-current familiar&lt;br /&gt;
* retrieval of worthless items by using 31337 scrolls or sewering&lt;br /&gt;
* untinkering a dictionary to get the bridge&lt;br /&gt;
* items in closet, if enabled&lt;br /&gt;
* free pulls from Hagnk&#039;s&lt;br /&gt;
* items in storage, if no longer under ronin/HC restrictions (note that all of the item is pulled, not just the amount requested)&lt;br /&gt;
* items in the clan stash, if enabled&lt;br /&gt;
* item creation, up to the quantity creatable from ingredients on hand (this can be overriden by a buyScript)&lt;br /&gt;
* trading worthless items to the Hermit&lt;br /&gt;
* trading yeti furs to the Tr4pz0r&lt;br /&gt;
* NPC purchase (if enabled), or Mall purchase (if enabled, and no ingredients on hand)&lt;br /&gt;
* budgeted pulls from storage&lt;br /&gt;
* item creation, unless buying the item is enabled and appears to be cheaper than the cost of acquiring all the ingredients&lt;br /&gt;
* one final attempt at Mall purchase, if enabled and everything else has failed&lt;br /&gt;
{{RFI|Are there exceptions to the info listed under Special?}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User_talk:Jasonharper&amp;diff=4859</id>
		<title>User talk:Jasonharper</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User_talk:Jasonharper&amp;diff=4859"/>
		<updated>2010-03-05T15:21:23Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thanks for the help you&#039;ve been giving lately, it&#039;s greatly appreciated!&lt;br /&gt;
&lt;br /&gt;
Thought I&#039;d check on something also; is it okay to quote or near-quote revision notes when I don&#039;t know how a function works, as I did with [[batch_close]]()? Should I give credit, as I did on that page, or is it implicit that the ultimate source of information may be said logs? Whatever you &amp;amp; V are most comfortable with is fine by me, but if I can save the clutter of including such attributions on a page, it wouldn&#039;t hurt.&lt;br /&gt;
&lt;br /&gt;
It would probably also be nice to have a prominently linked-to &amp;quot;Without these mafia devs we wouldn&#039;t be here&amp;quot; type of page, I&#039;d think.&lt;br /&gt;
&lt;br /&gt;
Any other thoughts / comments are appreciated.&lt;br /&gt;
&lt;br /&gt;
Thanks! --[[User:StDoodle|StDoodle]] 14:54, 5 March 2010 (UTC)&lt;br /&gt;
* As the revision notes are frequently the only documentation you&#039;re going to have for a new function, certainly they should be fair game for inclusion here.  I agree that attribution of such notes would just be clutter. --[[User:Jasonharper|Jasonharper]] 15:21, 5 March 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Autosell_price&amp;diff=4838</id>
		<title>Autosell price</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Autosell_price&amp;diff=4838"/>
		<updated>2010-03-05T13:39:06Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Explanation of negative values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:name|autosell_price}}&lt;br /&gt;
{{#vardefine:return_type|int}}&lt;br /&gt;
&lt;br /&gt;
{{FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Item Management|&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|item|it}}|&lt;br /&gt;
p1desc={{pspan|it}} is the item to check the price of|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the autosell price of item {{pspan|it}}, or a value &amp;lt;= 0 if the item cannot be autosold.  The value will be presented as a negative number in a few unusual cases where an item can&#039;t be autosold, but does have a defined value detectable by other means: a Mall minimum price other than 100, or a price in one of the sign restaurants.  The laser-broiled pear is an example of a non-autosellable item with a value detectable both ways.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|autosell}}|&lt;br /&gt;
}}&lt;br /&gt;
{{RFI|Is there something I&#039;m not thinking of, as the old description said non-autosell items returned a negative value?&amp;lt;br /&amp;gt;Tested items included quest keys, macguffin diary &amp;amp; useless powder (all returned 0)}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Batch_close&amp;diff=4835</id>
		<title>Talk:Batch close</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Batch_close&amp;diff=4835"/>
		<updated>2010-03-05T11:58:58Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Bad example!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a really bad example of how to use batches:&lt;br /&gt;
* The batchable commands are all executed conditionally, so the order in which the first instance of each one is unpredictable, and therefore the order in which the batched commands are executed is unpredictable.  If both autosellable and mallsellable items were processed prior to the first item that had a nonzero closet amount, the batch of take_closet()s will be executed LAST.  This really needs to be done in at least two separate batches - the autosell and mallsell can be safely done in the same batch, since at most one will be done for any given item.&lt;br /&gt;
* There are extraneous server-hitting commands inside the batch, for no reason whatsoever.  If cli_execute() became batchable (unlikely, but not entirely impossible), the script would malfunction because the inventory counts inside the main loop wouldn&#039;t reflect the outfit change.  visit_url() is safe in a batch only because it has an individually significant return value.&lt;br /&gt;
* In any case, an example that the user CAN&#039;T SAFELY TRY FOR THEMSELVES does not strike me as being particularly educational.&lt;br /&gt;
--[[User:Jasonharper|Jasonharper]] 11:58, 5 March 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Adv1&amp;diff=4478</id>
		<title>Adv1</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Adv1&amp;diff=4478"/>
		<updated>2010-03-03T13:01:25Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: no CLI equivalent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine:name|adv1}}&lt;br /&gt;
{{#vardefine:return_type|boolean}}&lt;br /&gt;
&lt;br /&gt;
{{FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
function_category=Adventuring|&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|location|place}}|&lt;br /&gt;
parameter2={{Param|int|turnsUsed}}|&lt;br /&gt;
parameter3={{Param|string|filterFunc}}|&lt;br /&gt;
p1desc={{Pspan|place}} is the adventuring location.|&lt;br /&gt;
p2desc={{Pspan|turnsUsed}} overrides the normal number of adventures that are expected to be consumed at this location, or -1 can be passed to use the default. Specifically, 0 will prevent any counters from triggering - of course, if an adventure actually is consumed, any counters that you kept from triggering will be lost.|&lt;br /&gt;
p3desc={{Pspan|filterFunc}} is the name of a combat filter function defined elsewhere in your script, with the same behavior as in the 3-paramater version of [[adventure]](). An empty string can be passed to use your battle action or CCS as normal.}}|&lt;br /&gt;
&lt;br /&gt;
function_description=This will adventure exactly once in the specified {{pspan|place}} (even if it took no turns), although it will follow chained choice adventures for as long as you have preset options.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;This function does not have to make use of its return value, but if you wish to do so, it will return true if all adventures were used, and false if it is unable to do so for any reason (not enough adventures, location unavailable, etc.).|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Adventures 1 time at the Slime Tube. If an adventure takes no turns, possibly because the Gall Bladder was already squeezed, that adventure will still count. Counters will trigger as normal.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
adv1($location[slime tube], -1, &amp;quot;&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|adventure}}|&lt;br /&gt;
cli_equiv=None - &amp;quot;adv&amp;quot; will always try adventuring again if an adventure took no turns.|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Data_Structures&amp;diff=3182</id>
		<title>Data Structures</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Data_Structures&amp;diff=3182"/>
		<updated>2010-02-28T08:25:45Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: I&amp;#039;m a zodiacidal maniac!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Maps =&lt;br /&gt;
Most of this information was copied directly from ASH Maps Tutorial, by Veracity &lt;br /&gt;
(http://kolmafia.sourceforge.net/advanced.html#maps)&lt;br /&gt;
&lt;br /&gt;
A map is indexed by one data type (the key) and associates that key with another (or the same) data type (the value). The key can be any ASH simple data type: boolean, int, float, string, item, location, class, stat, skill, effect, familiar, slot, or monster. The value can be any ASH data type at all: a simple type, a record, or can be an aggregate - another map. This effectively allows multi-dimensional maps and. In fact, that&#039;s how the syntax we provide for multi-dimensional aggregates actually operates: maps of maps of maps ...&lt;br /&gt;
&lt;br /&gt;
You can declare a map any time you can declare a variable: as a top level (global) variable, as a function parameter, or as a local variable in any scope.&lt;br /&gt;
&lt;br /&gt;
You can fetch data from a map any time you can provide a data value: in an expression, as a function parameter, on the right side of an assignment statement, from a &amp;quot;return&amp;quot; statement, as so on. You can pass around entire maps, individual elements, or intermediate maps: &amp;quot;slices&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Assignments ==&lt;br /&gt;
&lt;br /&gt;
If you use a map on the left side of an assignment, you set the whole map at once to the new value. If you specify a map and a complete set of indices (of the correct types) on the left side of an assignment statement, you set a single element. If you specify a map and a prefix of indices (of the correct type), you directly set one of the intermediate maps, a &amp;quot;slice&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Declarations ==&lt;br /&gt;
&lt;br /&gt;
The syntax for declaring the data type of a map:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;data type&amp;gt; [ &amp;lt;key type&amp;gt;, ... ]  &lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
The syntax for referencing an element (or slice) of a map:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;variablename&amp;gt;[ &amp;lt;key expression&amp;gt;, ... ]  &lt;br /&gt;
&lt;br /&gt;
All the key expressions will be evaluated at run time. If you specify all the keys the map expects, you fetch data of the type specified by the map. If you specify fewer keys than the map expects, you get an intermediate map, a &amp;quot;slice&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
As an example:&lt;br /&gt;
&lt;br /&gt;
    boolean [string, string] props;  &lt;br /&gt;
&lt;br /&gt;
might be used to hold &amp;quot;properties&amp;quot; associated with names.&lt;br /&gt;
&lt;br /&gt;
    props[ &amp;quot;dog&amp;quot;, &amp;quot;mammal&amp;quot; ] = true; &lt;br /&gt;
    props[ &amp;quot;dog&amp;quot;, &amp;quot;pet&amp;quot; ] = true; &lt;br /&gt;
    props[ &amp;quot;dog&amp;quot;, &amp;quot;fun&amp;quot; ] = false;&lt;br /&gt;
    props[ &amp;quot;turtle&amp;quot;, &amp;quot;mammal&amp;quot; ] = false;&lt;br /&gt;
    props[ &amp;quot;turtle&amp;quot;, &amp;quot;pet&amp;quot; ] = true;&lt;br /&gt;
    props[ &amp;quot;turtle&amp;quot;, &amp;quot;fun&amp;quot; ] = false;&lt;br /&gt;
    props[ &amp;quot;aardvark&amp;quot;, &amp;quot;mammal&amp;quot; ] = true;&lt;br /&gt;
    props[ &amp;quot;aardvark&amp;quot;, &amp;quot;pet&amp;quot; ] = false;&lt;br /&gt;
    props[ &amp;quot;aardvark&amp;quot;, &amp;quot;fun&amp;quot; ] = true;  &lt;br /&gt;
&lt;br /&gt;
references:&lt;br /&gt;
&lt;br /&gt;
    props[ &amp;quot;dog&amp;quot;, &amp;quot;mammal&amp;quot;] =&amp;gt; true &lt;br /&gt;
    boolean [string] animal = props[ &amp;quot;turtle&amp;quot; ]; &lt;br /&gt;
    animal[ &amp;quot;fun&amp;quot; ] =&amp;gt; false  &lt;br /&gt;
&lt;br /&gt;
== Contains ==&lt;br /&gt;
&lt;br /&gt;
You can test the presence of a key in a map using the &amp;quot;contains&amp;quot; operator:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;aggregate reference expression&amp;gt; contains &amp;lt;key expression&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;aggregate reference expression&amp;gt; must evaluate at run time to a map or slice, and must evaluate at run time to a key of the appropriate type. (Note that that is enforced at parse time; ASH can tell the datatype any expression will produce).&lt;br /&gt;
&lt;br /&gt;
    props contains &amp;quot;dog&amp;quot; =&amp;gt; true &lt;br /&gt;
    props contains &amp;quot;elephant&amp;quot; =&amp;gt; false &lt;br /&gt;
    props[ &amp;quot;aardvark&amp;quot; ] contains &amp;quot;fun&amp;quot; =&amp;gt; true &lt;br /&gt;
    animal contains &amp;quot;pet&amp;quot; =&amp;gt; true &lt;br /&gt;
    animal contains &amp;quot;favorite food&amp;quot; =&amp;gt; false  &lt;br /&gt;
&lt;br /&gt;
== Remove ==&lt;br /&gt;
&lt;br /&gt;
You can remove a key-value association from a map using the &amp;quot;remove&amp;quot; unary operator:&lt;br /&gt;
&lt;br /&gt;
    remove &amp;lt;aggregate reference&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
For clarification, an aggregate reference is &amp;quot;&amp;lt;map name&amp;gt;[ &amp;lt;index 1&amp;gt; ... &amp;lt;index n&amp;gt; ]&amp;quot; where &amp;lt;map name&amp;gt;[ &amp;lt;index 1&amp;gt; ... &amp;lt;index n-1&amp;gt; ] specifies the &amp;quot;slice&amp;quot; and &amp;lt;index n&amp;gt; specifies the &amp;quot;key&amp;quot;. Which is just what you expect, if you fully specify the indices; for a single dimensional map, &amp;quot;map[10]&amp;quot; -&amp;gt; &amp;quot;map&amp;quot; is the slice and 10 is the key. The &amp;quot;remove&amp;quot; operator removes the &amp;quot;key&amp;quot; from the &amp;quot;slice&amp;quot;. For example:&lt;br /&gt;
&lt;br /&gt;
  string [int] map1;&lt;br /&gt;
  map1[5] = &amp;quot;foo&amp;quot;;&lt;br /&gt;
  print( count( map1 ) + &amp;quot; &amp;quot; + map1 contains 5 + &amp;quot; &amp;quot; + map1[5] );&lt;br /&gt;
  print( &amp;quot;remove: &amp;quot; + remove map1[5] );&lt;br /&gt;
  print( count( map1 ) + &amp;quot; &amp;quot; + map1 contains 5 + &amp;quot; &amp;quot;  + map1[5] );&lt;br /&gt;
  print( &amp;quot;remove: &amp;quot; + remove map1[5] );&lt;br /&gt;
  int [string, string] map2;&lt;br /&gt;
  map2[&amp;quot;me&amp;quot;,&amp;quot;you&amp;quot;] = 17;&lt;br /&gt;
  print( count( map2[&amp;quot;me&amp;quot;] ) + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;] contains &amp;quot;you&amp;quot; + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;,&amp;quot;you&amp;quot;] );&lt;br /&gt;
  print( &amp;quot;remove: &amp;quot; + remove map2[&amp;quot;me&amp;quot;, &amp;quot;you&amp;quot;] );&lt;br /&gt;
  print( count( map2[&amp;quot;me&amp;quot;] ) + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;] contains &amp;quot;you&amp;quot; + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;,&amp;quot;you&amp;quot;] );&lt;br /&gt;
  print( &amp;quot;remove: &amp;quot; + remove map2[&amp;quot;me&amp;quot;, &amp;quot;you&amp;quot;] );&lt;br /&gt;
  print( count( map2 ) + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;] );&lt;br /&gt;
  print( &amp;quot;remove: &amp;quot; + remove map2[&amp;quot;me&amp;quot;] );&lt;br /&gt;
  print( count( map2 ) + &amp;quot; &amp;quot; + map2[&amp;quot;me&amp;quot;] );&lt;br /&gt;
&lt;br /&gt;
yields:&lt;br /&gt;
&lt;br /&gt;
  1 true foo&lt;br /&gt;
  remove: foo&lt;br /&gt;
  0 false&lt;br /&gt;
  remove:&lt;br /&gt;
  1 true 17&lt;br /&gt;
  remove: 17&lt;br /&gt;
  0 false 0&lt;br /&gt;
  remove: 0&lt;br /&gt;
  1 aggregate int [string]&lt;br /&gt;
  remove: aggregate int [string]&lt;br /&gt;
  0 aggregate int [string]&lt;br /&gt;
&lt;br /&gt;
== Deletion ==&lt;br /&gt;
&lt;br /&gt;
clear (theMap) will remove all entries&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Sort ==&lt;br /&gt;
&lt;br /&gt;
From http://kolmafia.us/showthread.php?t=1738&lt;br /&gt;
&lt;br /&gt;
The syntax is:&lt;br /&gt;
sort aggregate by keyExpr;&lt;br /&gt;
aggregate is a reference to the object to be sorted - arrays are probably the most useful things to sort, but any mapping type can be used (even multidimensional maps, but note that you can only sort along a single dimension at a time). The reference must not be enclosed in parentheses, as that would look like a call to a function named sort() - which is still perfectly valid, &amp;quot;sort&amp;quot; has not become a reserved word.&lt;br /&gt;
&lt;br /&gt;
keyExpr is an arbitrary expression that defines how the items should be ordered. It is evaluated once for every entry in the aggregate, in a scope with two additional variables implicitly defined: &#039;index&#039; and &#039;value&#039;, holding the details of that entry. The value of the keyExpr is used as the sort key; typically it would be an int or string, but can be any ASH type that can be compared via &amp;quot;&amp;lt;&amp;quot; and the other relational operators.&lt;br /&gt;
&lt;br /&gt;
The most basic form of sorting would therefore be &amp;quot;sort ... by value&amp;quot;, but many useful things can be done with the use of a more complex keyExpr - the only real restriction is that the expression should not modify the object you&#039;re sorting. For example, if you had an array of items, you could sort it &amp;quot;by autosell_price(value)&amp;quot;. An array of weapon items could be sorted &amp;quot;by -get_power(value)&amp;quot; to put it in decreasing order of power. If the elements of your aggregate are records, you&#039;d need to use something like &amp;quot;by value.fieldName&amp;quot;, since the records themselves can&#039;t be meaningfully compared.&lt;br /&gt;
&lt;br /&gt;
After the sort statement, the aggregate will have exactly the same sets of keys and values as before (even if the keys weren&#039;t consecutive), and the iteration order of the keys will be the same, but the values will likely be associated with different keys. The sort is stable - in other words, elements with sort keys that compare as equal will remain in the same order. This means that you can sort on multiple criteria by simply performing separate sorts for each of the criteria, in increasing order of significance.&lt;br /&gt;
&lt;br /&gt;
A few more examples of things you can do:&lt;br /&gt;
* &amp;quot;by -value&amp;quot; sorts integers in decreasing order (there&#039;s no similar trick for string values).&lt;br /&gt;
* &amp;quot;by -index&amp;quot; reverses the existing order of an array (or map with integer keys).&lt;br /&gt;
* &amp;quot;by random(1000000)&amp;quot; shuffles into a random order.&lt;br /&gt;
* &amp;quot;by otherArray[index]&amp;quot; uses values from a parallel array as the sort keys (you&#039;d then need to do &amp;quot;sort otherArray by value;&amp;quot; if you wanted the two arrays to remain in sync).&lt;br /&gt;
&lt;br /&gt;
== Records ==&lt;br /&gt;
&lt;br /&gt;
(copy-pasted from Veracity&#039;s post introducing the record [http://kolmafia.us/showthread.php?t=280])&lt;br /&gt;
&lt;br /&gt;
Starting with SVN revision 1311 of KoLmafia, ASH now supports a new kind of structured data: the record. Here is a little example of how you declare a record and variables of the new type you&#039;ve created by doing so.&lt;br /&gt;
&lt;br /&gt;
  record my_type {&lt;br /&gt;
  	int ifield;&lt;br /&gt;
  	string sfield;&lt;br /&gt;
  	record {&lt;br /&gt;
  		int first;&lt;br /&gt;
  		int second;&lt;br /&gt;
  	} rfield;&lt;br /&gt;
  	int [int, int] mfield;&lt;br /&gt;
  };&lt;br /&gt;
  &lt;br /&gt;
  my_type rvar;&lt;br /&gt;
  my_type [int] mrvar;&lt;br /&gt;
&lt;br /&gt;
What I&#039;ve done with the above is declare a new data type which I&#039;ve named &amp;quot;my_type&amp;quot;. Having declared the new type, I can use it (almost) anywhere that I can use a built-in type name. I declared a variable, &amp;quot;rvar&amp;quot;, of that type, and I defined a map, &amp;quot;mrvar&amp;quot;, which maps keys of type integer to values of type my_type.&lt;br /&gt;
&lt;br /&gt;
The new type, &amp;quot;my_type&amp;quot; is a &amp;quot;composite&amp;quot; type. It contains four fields. &amp;quot;ifield&amp;quot; is an integer. &amp;quot;sfield&amp;quot; is a string. &amp;quot;rfield&amp;quot; is another composite field: an anonymous record containing two integers named &amp;quot;first&amp;quot; and &amp;quot;second&amp;quot;. Finally, &amp;quot;mfield&amp;quot; is a map from [int, int] to int.&lt;br /&gt;
&lt;br /&gt;
As you can see, a record can combine data of all the types ASH supports: primitive, aggregate, and composite.&lt;br /&gt;
&lt;br /&gt;
Having defined the new data type and several variables using it, here are some examples of how to access the fields.&lt;br /&gt;
&lt;br /&gt;
  rvar.ifield = 10;&lt;br /&gt;
  rvar.sfield = &amp;quot;secret&amp;quot;;&lt;br /&gt;
  rvar.rfield.first = 1000;&lt;br /&gt;
  rvar.sfield.second = 2000;&lt;br /&gt;
  rvar.mfield[ 2, 3 ] = 12;&lt;br /&gt;
  &lt;br /&gt;
  mrvar[ 1 ] = rvar;&lt;br /&gt;
  &lt;br /&gt;
  foreach key in mrvar&lt;br /&gt;
  	foreach key1, key2 in mrvar[key].mfield&lt;br /&gt;
  		print( &amp;quot;val = &amp;quot; + mrvar[key].mfield[key1,key2] );&lt;br /&gt;
&lt;br /&gt;
As you can see, if you have a variable that is a record, you access the fields of the record by following the variable name with &amp;quot;.&amp;amp;lt;field name&amp;amp;gt;&amp;quot;. The resulting value will be of whatever type you declared in the definition of the record. If the value is a map, you can give a list of keys within [], just like any other map. If the value is another record, you can access the fields of the nested record by using another &amp;quot;.&amp;amp;lt;field name&amp;amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with Pascal &amp;quot;records&amp;quot; or C/C++ &amp;quot;structs&amp;quot;, this should all be comfortably familiar.&lt;br /&gt;
&lt;br /&gt;
Finally, if you create a map whose values is a record, the file_to_map and map_to_file built-in ASH functions will Do The Right Thing; they will efficiently and reliably save and restore your data.&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Datatype_Conversions&amp;diff=1823</id>
		<title>Datatype Conversions</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Datatype_Conversions&amp;diff=1823"/>
		<updated>2010-02-28T08:13:37Z</updated>

		<summary type="html">&lt;p&gt;Jasonharper: Zodiac is datatype forbidden!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part 10 - Datatype Conversions ==&lt;br /&gt;
&lt;br /&gt;
These functions will convert 1 type of data to another.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean to_boolean( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into boolean.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;class to_class( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a class.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;effect to_effect( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into an effect.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, skill&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;familiar to_familiar( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a familiar.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;float to_float( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a float.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, item, location, familiar, skill, effect, slot, element, monster, boolean, class, stat&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int to_int( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into the number that will be recognized by the KoL server. Needed when you&amp;amp;#8217;re building raw URLs from time to time.&amp;lt;br /&amp;gt;&lt;br /&gt;
accepts: string, float, item, location, familiar, skill, effect, slot, element, monster, boolean, class, stat&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;item to_item( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into an item.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;location to_location( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a location.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;monster to_monster( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a monster.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;skill to_skill( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a skill.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: string, int, effect&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;slot to_slot( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts the ASH-based object into a slot.&amp;lt;br /&amp;gt;&lt;br /&gt;
Accepts: item&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string to_string( variable )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Converts in-game variables to printable counterparts. The print command will cast non-string values properly now, but these are still useful for building URLs and setting properties.&amp;lt;br /&amp;gt;&lt;br /&gt;
accepts: boolean, int, float, item, location, familiar, class, stat, skill, effect, slot, element, monster&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jasonharper</name></author>
	</entry>
</feed>