<?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=PhilmASTErpLus</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=PhilmASTErpLus"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/PhilmASTErpLus"/>
	<updated>2026-04-24T18:14:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6338</id>
		<title>ASH For Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6338"/>
		<updated>2010-11-10T17:49:46Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Programming */ grammar fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==File Editing==&lt;br /&gt;
To create and edit ASH scripts, you need a text editing program that doesn&#039;t automatically add line-breaks for word wrapping.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
While the built in editor TextEdit will work fine (as long as you remember to write only in plaintext), [http://www.barebones.com/products/textwrangler/ TextWrangler] is a much more powerful tool. It may not be designed for ASH scripting specifically, but it was written for a similar purpose.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
If you use Linux, you probably already know about the options available for text editing. Emacs, Vi, etc. are all fine for creating ASH scripts.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Windows users beware; using Microsoft Word to create ASH files will lead to no end of headaches! The built-in program notepad will work, as can wordpad when configured with the option &amp;quot;No Wrap&amp;quot; for text. However, having a program that can handle syntax-highlighting can be very beneficial. Many scripters recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] for ASH (and other programmatic) scripting. In this case, it&#039;s also beneficial to have a style configuration that works well with ASH, and one example can be found [http://kolmafia.us/showthread.php?3164-How-do-you-write-an-ASH-file&amp;amp;p=21567&amp;amp;viewfull=1#post21567 here].&lt;br /&gt;
&lt;br /&gt;
==Saving==&lt;br /&gt;
ASH scripts need to be saved with the file extension &amp;quot;.ash&amp;quot; to be properly recognized by KoLmafia. If you&#039;re using a built-in text editor on a Windows machine, it may automatically save your files with the &amp;quot;.txt&amp;quot; extension by default. (So you may end up with a file called &amp;quot;script.ash.txt&amp;quot; instead of the desired &amp;quot;script.ash&amp;quot;.) One way around this on Windows that usually works is to put quotes around the file name when you save it, including the extension.&lt;br /&gt;
&lt;br /&gt;
Most advanced text editors (such as Notepad++) will save files as specified, without the need for the quotes-trick.&lt;br /&gt;
&lt;br /&gt;
Most files should be saved in the &amp;quot;scripts&amp;quot; directory, which is located by default at the same directory level as the KoLmafia .jar or .exe file on Windows. You can also create a sub-directory under &amp;quot;scripts,&amp;quot; and it will be listed in KoLmafia&#039;s Scripts Menu.&lt;br /&gt;
&lt;br /&gt;
Relay browser scripts are the exception to the rule: they must be saved in the &amp;quot;relay&amp;quot; directory. Relay browser overrides need to be saved in the top level of &amp;quot;relay,&amp;quot; and must be named the same as the page they will override, except with an &amp;quot;.ash&amp;quot; extension. For example, to override &amp;quot;charpane.php&amp;quot; your script would need to be named &amp;quot;charpane.ash&amp;quot;. For user-interface scripts, the script name needs to start with &amp;quot;relay_&amp;quot; and end with &amp;quot;.ash&amp;quot;. These scripts must also be saved in the top-level of the &amp;quot;relay&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Programming==&lt;br /&gt;
You should first read through the various pages listed under &amp;quot;LANGUAGE CONVENTIONS&amp;quot; on the [[Main Page]]. One should also be aware that, with the exception of [[Control Structures]], all ASH commands need to end with a semi-colon. Also, every identifier in ASH&amp;amp;mdash;variables, functions, and other various keywords&amp;amp;mdash;are case-insensitive, so &amp;lt;code&amp;gt;string myVar=&amp;quot;abb&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STRing MYvar=&amp;quot;abb&amp;quot;&amp;lt;/code&amp;gt; produce the same results.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Variables are used to hold information that you need to access multiple times. They must be declared before they can be used, by specifying the [[Data Types|Data Type]] that they will hold, followed by the variable name.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare a variable named &amp;quot;count&amp;quot; of an integer type. You can also set the initial value of a variable on the same line it is declared.&lt;br /&gt;
{{CodeSample|description=On the other hand:|code=&amp;lt;syntaxhighlight&amp;gt;int count = 6;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare the variable &amp;quot;count&amp;quot; with an initial value of 6.&lt;br /&gt;
&lt;br /&gt;
Notice that you would not want to have both of the above lines in your script! Variables operate under what&#039;s referred to as their scope. In a nutshell, scope defines where a variable is accessible. Scope &amp;quot;cascades&amp;quot; down, similar to stylesheets for those familiar with web programming. A variable declared at the top-level of a script (a &amp;quot;global&amp;quot; variable), outside of any functions, will be accessible anywhere in your script, or in any other scripts that import it. A variable declared inside of a function will be accessible only inside that function (including inside of control structures), but is considered to not exist by other functions. Since ASH uses curly brace scope, variables within a set of curly braces (&#039;&#039;&#039;{ }&#039;&#039;&#039;) will not be available outside that same set of braces.&lt;br /&gt;
&lt;br /&gt;
Declaring a variable multiple times will generate an [[ASH Errors#Variable is already defined|error]]. Note that this only applies to variable with overlapping scope; if one function uses a variable named &amp;quot;bob&amp;quot; that is declared inside of the function, another function can declare another variable with the same name, even as a different datatype. However, the error will still occur if you have a globally-defined variable, and then declare a variable with the same name inside of a function (as their scopes overlap).&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
Functions are groupings of operations that can be applied multiple times by referencing the function name. Basically, they avoid having to re-type the same code over and over.&lt;br /&gt;
&lt;br /&gt;
====Built-in functions====&lt;br /&gt;
Many functions are built-in to KoLmafia, and examples can be found all over this wiki. Examples on the wiki are given in the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;datatypeReturned function_name([datatype1 parameter1] ...)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is the datatype that the function returns. Though you don&#039;t have to make use of this in a script, you would almost always want to (except for some functions that return a boolean). You need to be careful to match datatypes (though sometimes an implicit conversion is done; ie KoLmafia will usually translate a float into an int, and many commands that output text will implicitly convert from most datatypes). For example, if you have a variable of the datatype string, it is often an error to assign to it a function that returns an item.&lt;br /&gt;
&lt;br /&gt;
The function name follows and then parentheses, which may have nothing or multiple sets of datatypes &amp;amp; parameters.&lt;br /&gt;
&lt;br /&gt;
The parameter names are used for reference on the rest of the page (so you can match descriptions of parameters to the parameter in question, which is especially useful if the function takes more than one parameter with the same datatype).&lt;br /&gt;
&lt;br /&gt;
Note that, as with assignments of a fucntion&#039;s return value, it is important to match the parameter datatypes when using the function. If you have a function with the parameter &amp;lt;b&amp;gt;item it&amp;lt;/b&amp;gt;, and you supply the name of the item as text in quotes (which is how a string is written), you will get an error for doing so.&lt;br /&gt;
&lt;br /&gt;
====Custom-coded functions====&lt;br /&gt;
It&#039;s also possible to write your own functions. To do so, you declare them similarly to a variable as above. However, a function can also have the datatype of &amp;quot;void,&amp;quot; which is not allowed for variables. A &amp;quot;void&amp;quot; function is one that does not return any value; it simply does what it&#039;s programmed to do and the rest of your program moves on, regardless of the results (unless of course an [[ASH Errors|error]] occurs, including a call to [[abort|abort()]].)&lt;br /&gt;
{{CodeSample|description=For example, this simple function will double an integer:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int double_it(int value) {&lt;br /&gt;
   return 2 * value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=Furthermore, there are two distinct ways to call functions, user-defined or built-in:&amp;lt;br /&amp;gt;Conventional,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function(param1[,param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=and &amp;quot;Java style&amp;quot;:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
param1.function([param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The only difference between the two forms is aesthetics, as they are functionally equivalent.&lt;br /&gt;
{{CodeSample|description=Also somewhat important to note is that these commands can be chained together, and they will be executed from left-to-right. So, for instance,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;quot;polka pop&amp;quot;.to_item().to_int()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=will return the item number for $item[Polka Pop], 4342. This is one instance where &amp;quot;Java style&amp;quot; is more aesthetically pleasing compared to the conventional|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
to_int(to_item(&amp;quot;polka pop&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Note that scope (discussed above, under [[ASH_For_Beginners#Variables|Variables]]) also applies to user-defined functions. Also, functions built into KoLmafia have priority over any user-defined functions with the same name and parameters.&lt;br /&gt;
&lt;br /&gt;
===String Concatenation===&lt;br /&gt;
The basics to string concatenation: &amp;quot;Hello&amp;quot; + &amp;quot;world&amp;quot; yields &amp;quot;Helloworld&amp;quot;. Likewise, variables can be strung together in this fashion. Unless the variables are both numbers (floats, booleans, or ints), they will be converted to strings, then concatenated. For instance: &amp;quot;3x &amp;quot; + $item[Polka Pop] yields &amp;quot;3x Polka Pop&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Miscellaneous_ASH_Features&amp;diff=6089</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=6089"/>
		<updated>2010-11-10T17:47:37Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* A little CLI help */ reworded and added ashwiki&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;
*This only works for automated adventuring. The script will not fire if you&#039;re using the relay browser.&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;
Three 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;
* [[ashwiki]] allows you to search this wiki by launching a web browser.&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>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6337</id>
		<title>ASH For Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6337"/>
		<updated>2010-11-10T17:29:09Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Programming */ Wow, ASH is case-insensitive. *Boggles*&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==File Editing==&lt;br /&gt;
To create and edit ASH scripts, you need a text editing program that doesn&#039;t automatically add line-breaks for word wrapping.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
While the built in editor TextEdit will work fine (as long as you remember to write only in plaintext), [http://www.barebones.com/products/textwrangler/ TextWrangler] is a much more powerful tool. It may not be designed for ASH scripting specifically, but it was written for a similar purpose.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
If you use Linux, you probably already know about the options available for text editing. Emacs, Vi, etc. are all fine for creating ASH scripts.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Windows users beware; using Microsoft Word to create ASH files will lead to no end of headaches! The built-in program notepad will work, as can wordpad when configured with the option &amp;quot;No Wrap&amp;quot; for text. However, having a program that can handle syntax-highlighting can be very beneficial. Many scripters recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] for ASH (and other programmatic) scripting. In this case, it&#039;s also beneficial to have a style configuration that works well with ASH, and one example can be found [http://kolmafia.us/showthread.php?3164-How-do-you-write-an-ASH-file&amp;amp;p=21567&amp;amp;viewfull=1#post21567 here].&lt;br /&gt;
&lt;br /&gt;
==Saving==&lt;br /&gt;
ASH scripts need to be saved with the file extension &amp;quot;.ash&amp;quot; to be properly recognized by KoLmafia. If you&#039;re using a built-in text editor on a Windows machine, it may automatically save your files with the &amp;quot;.txt&amp;quot; extension by default. (So you may end up with a file called &amp;quot;script.ash.txt&amp;quot; instead of the desired &amp;quot;script.ash&amp;quot;.) One way around this on Windows that usually works is to put quotes around the file name when you save it, including the extension.&lt;br /&gt;
&lt;br /&gt;
Most advanced text editors (such as Notepad++) will save files as specified, without the need for the quotes-trick.&lt;br /&gt;
&lt;br /&gt;
Most files should be saved in the &amp;quot;scripts&amp;quot; directory, which is located by default at the same directory level as the KoLmafia .jar or .exe file on Windows. You can also create a sub-directory under &amp;quot;scripts,&amp;quot; and it will be listed in KoLmafia&#039;s Scripts Menu.&lt;br /&gt;
&lt;br /&gt;
Relay browser scripts are the exception to the rule: they must be saved in the &amp;quot;relay&amp;quot; directory. Relay browser overrides need to be saved in the top level of &amp;quot;relay,&amp;quot; and must be named the same as the page they will override, except with an &amp;quot;.ash&amp;quot; extension. For example, to override &amp;quot;charpane.php&amp;quot; your script would need to be named &amp;quot;charpane.ash&amp;quot;. For user-interface scripts, the script name needs to start with &amp;quot;relay_&amp;quot; and end with &amp;quot;.ash&amp;quot;. These scripts must also be saved in the top-level of the &amp;quot;relay&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Programming==&lt;br /&gt;
You should first read through the various pages listed under &amp;quot;LANGUAGE CONVENTIONS&amp;quot; on the [[Main Page]]. One should also be aware that, with the exception of [[Control Structures]], all ASH commands need to end with a semi-colon. Also, every identifier in ASH&amp;amp;mdash;variables, functions, and other various keywords&amp;amp;mdash;are case-insensitive, so &amp;lt;code&amp;gt;string myVar=&amp;quot;abb&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STRing MYvar=&amp;quot;abb&amp;quot;&amp;lt;/code&amp;gt; produces the same results.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Variables are used to hold information that you need to access multiple times. They must be declared before they can be used, by specifying the [[Data Types|Data Type]] that they will hold, followed by the variable name.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare a variable named &amp;quot;count&amp;quot; of an integer type. You can also set the initial value of a variable on the same line it is declared.&lt;br /&gt;
{{CodeSample|description=On the other hand:|code=&amp;lt;syntaxhighlight&amp;gt;int count = 6;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare the variable &amp;quot;count&amp;quot; with an initial value of 6.&lt;br /&gt;
&lt;br /&gt;
Notice that you would not want to have both of the above lines in your script! Variables operate under what&#039;s referred to as their scope. In a nutshell, scope defines where a variable is accessible. Scope &amp;quot;cascades&amp;quot; down, similar to stylesheets for those familiar with web programming. A variable declared at the top-level of a script (a &amp;quot;global&amp;quot; variable), outside of any functions, will be accessible anywhere in your script, or in any other scripts that import it. A variable declared inside of a function will be accessible only inside that function (including inside of control structures), but is considered to not exist by other functions. Since ASH uses curly brace scope, variables within a set of curly braces (&#039;&#039;&#039;{ }&#039;&#039;&#039;) will not be available outside that same set of braces.&lt;br /&gt;
&lt;br /&gt;
Declaring a variable multiple times will generate an [[ASH Errors#Variable is already defined|error]]. Note that this only applies to variable with overlapping scope; if one function uses a variable named &amp;quot;bob&amp;quot; that is declared inside of the function, another function can declare another variable with the same name, even as a different datatype. However, the error will still occur if you have a globally-defined variable, and then declare a variable with the same name inside of a function (as their scopes overlap).&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
Functions are groupings of operations that can be applied multiple times by referencing the function name. Basically, they avoid having to re-type the same code over and over.&lt;br /&gt;
&lt;br /&gt;
====Built-in functions====&lt;br /&gt;
Many functions are built-in to KoLmafia, and examples can be found all over this wiki. Examples on the wiki are given in the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;datatypeReturned function_name([datatype1 parameter1] ...)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is the datatype that the function returns. Though you don&#039;t have to make use of this in a script, you would almost always want to (except for some functions that return a boolean). You need to be careful to match datatypes (though sometimes an implicit conversion is done; ie KoLmafia will usually translate a float into an int, and many commands that output text will implicitly convert from most datatypes). For example, if you have a variable of the datatype string, it is often an error to assign to it a function that returns an item.&lt;br /&gt;
&lt;br /&gt;
The function name follows and then parentheses, which may have nothing or multiple sets of datatypes &amp;amp; parameters.&lt;br /&gt;
&lt;br /&gt;
The parameter names are used for reference on the rest of the page (so you can match descriptions of parameters to the parameter in question, which is especially useful if the function takes more than one parameter with the same datatype).&lt;br /&gt;
&lt;br /&gt;
Note that, as with assignments of a fucntion&#039;s return value, it is important to match the parameter datatypes when using the function. If you have a function with the parameter &amp;lt;b&amp;gt;item it&amp;lt;/b&amp;gt;, and you supply the name of the item as text in quotes (which is how a string is written), you will get an error for doing so.&lt;br /&gt;
&lt;br /&gt;
====Custom-coded functions====&lt;br /&gt;
It&#039;s also possible to write your own functions. To do so, you declare them similarly to a variable as above. However, a function can also have the datatype of &amp;quot;void,&amp;quot; which is not allowed for variables. A &amp;quot;void&amp;quot; function is one that does not return any value; it simply does what it&#039;s programmed to do and the rest of your program moves on, regardless of the results (unless of course an [[ASH Errors|error]] occurs, including a call to [[abort|abort()]].)&lt;br /&gt;
{{CodeSample|description=For example, this simple function will double an integer:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int double_it(int value) {&lt;br /&gt;
   return 2 * value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=Furthermore, there are two distinct ways to call functions, user-defined or built-in:&amp;lt;br /&amp;gt;Conventional,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function(param1[,param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=and &amp;quot;Java style&amp;quot;:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
param1.function([param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The only difference between the two forms is aesthetics, as they are functionally equivalent.&lt;br /&gt;
{{CodeSample|description=Also somewhat important to note is that these commands can be chained together, and they will be executed from left-to-right. So, for instance,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;quot;polka pop&amp;quot;.to_item().to_int()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=will return the item number for $item[Polka Pop], 4342. This is one instance where &amp;quot;Java style&amp;quot; is more aesthetically pleasing compared to the conventional|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
to_int(to_item(&amp;quot;polka pop&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Note that scope (discussed above, under [[ASH_For_Beginners#Variables|Variables]]) also applies to user-defined functions. Also, functions built into KoLmafia have priority over any user-defined functions with the same name and parameters.&lt;br /&gt;
&lt;br /&gt;
===String Concatenation===&lt;br /&gt;
The basics to string concatenation: &amp;quot;Hello&amp;quot; + &amp;quot;world&amp;quot; yields &amp;quot;Helloworld&amp;quot;. Likewise, variables can be strung together in this fashion. Unless the variables are both numbers (floats, booleans, or ints), they will be converted to strings, then concatenated. For instance: &amp;quot;3x &amp;quot; + $item[Polka Pop] yields &amp;quot;3x Polka Pop&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Custom_Combat_Script&amp;diff=4434</id>
		<title>Custom Combat Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Custom_Combat_Script&amp;diff=4434"/>
		<updated>2010-10-13T08:16:35Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Legal commands are */ Added some more commands found at http://kolmafia.sourceforge.net/combat.html and renamed section to be more &amp;quot;formal&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
== Basic CCS ==&lt;br /&gt;
A Custom Combat Script (CCS) is a way of instructing mafia how to handle combat, round by round. For example, a simple CCS would be to tell mafia to pickpocket on round 1, then cast entangling noodles on round 2 and finally on rounds 3+ to use shieldbutt. If it is unable to carry out one of those steps, then that step will be skipped. For instance, if the character failed to get initiative, then pickpocket will be skipped and the character will go straight to entangling noodles. That CCS would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
[ default ]&amp;lt;br /&amp;gt;&lt;br /&gt;
try to steal an item&amp;lt;br /&amp;gt;&lt;br /&gt;
skill entangling noodles&amp;lt;br /&amp;gt;&lt;br /&gt;
skill shieldbutt&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wanted to treat different monsters differently, that can be accommodated also. For instance, the following CCS will attempt to cast Transcendent Olfaction upon Black Knights while treating all other monsters differently. If the character currently has &amp;quot;On the Trail&amp;quot; then that line will be skipped.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
[ Black Knight ]&amp;lt;br /&amp;gt;&lt;br /&gt;
try to steal an item&amp;lt;br /&amp;gt;&lt;br /&gt;
skill transcendent olfaction&amp;lt;br /&amp;gt;&lt;br /&gt;
skill entangling noodles&amp;lt;br /&amp;gt;&lt;br /&gt;
skill shieldbutt&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[ default ]&amp;lt;br /&amp;gt;&lt;br /&gt;
try to steal an item&amp;lt;br /&amp;gt;&lt;br /&gt;
skill entangling noodles&amp;lt;br /&amp;gt;&lt;br /&gt;
skill shieldbutt&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that when you use a CCS, your CLI will report &amp;quot;character executes a macro!&amp;quot; because the CCS is converted into a macro to save on page loads&lt;br /&gt;
&lt;br /&gt;
=== Available Commands ===&lt;br /&gt;
* attack&lt;br /&gt;
* skill&lt;br /&gt;
* item, use&lt;br /&gt;
* try to steal an item, pickpocket&lt;br /&gt;
* summon pastamancer ghost&lt;br /&gt;
* jiggle chefstaff&lt;br /&gt;
* combo {followed by one of the following}&lt;br /&gt;
** Disco Concentration, Disco Nirvana, Disco Inferno, Disco Bleeding, Disco Blindness&lt;br /&gt;
** Rave Knockout, Rave Bleeding, Rave Concentration, Rave Steal, Rave Nirvana, Rave Stats&lt;br /&gt;
* abort&lt;br /&gt;
* abort after&lt;br /&gt;
* section [section name]&lt;br /&gt;
* special&lt;br /&gt;
* delevel&lt;br /&gt;
* skip&lt;br /&gt;
* note&lt;br /&gt;
* twiddle&lt;br /&gt;
&lt;br /&gt;
== Macros in CCS ==&lt;br /&gt;
Macros may be used in a Custom Combat Script in addition to the basic commands. Any line in quotes  and any macro command used in a CCS will be made into part of the macro which KoLmafia is passing to KoL. You can find an primer on all KoL&#039;s macros at {{kolwiki|Combat Macros}}.&lt;br /&gt;
&lt;br /&gt;
Also there is a section in the CCS called &amp;quot;global prefix&amp;quot; which will be part of every combat macro KoLmafia generates, regardless of the monster encountered. &lt;br /&gt;
&lt;br /&gt;
=== Example of CCS Macro ===&lt;br /&gt;
Here&#039;s an example of a CCS that generates a macro which will cause KoL to wait for a hobo monkey to steal meat from your enemy before launching attacks.&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
[ default ]&amp;lt;br /&amp;gt;&lt;br /&gt;
sub monkey_stasis&amp;lt;br /&amp;gt;&lt;br /&gt;
:while !match &amp;quot;climbs up and sits on your shoulder&amp;quot; &amp;amp;&amp;amp; !pastround 20 &amp;amp;&amp;amp; !hppercentbelow 20&lt;br /&gt;
::call stasis_item&lt;br /&gt;
:endwhile&lt;br /&gt;
endsub&amp;lt;br /&amp;gt;&lt;br /&gt;
call monkey_stasis&amp;lt;br /&amp;gt;&lt;br /&gt;
attack&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[ global prefix ]&amp;lt;br /&amp;gt;&lt;br /&gt;
scrollwhendone&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;abort missed 5&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;quot;abort pastround 27&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
sub stasis_item&amp;lt;br /&amp;gt;&lt;br /&gt;
:if hascombatitem facsimile dictionary&lt;br /&gt;
::item facsimile dictionary&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:if hascombatitem seal tooth&lt;br /&gt;
::item seal tooth&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:if hascombatitem spices&lt;br /&gt;
::item spices&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:if hascombatitem spectre scepter&lt;br /&gt;
::item spectre scepter&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:if hascombatitem dictionary&lt;br /&gt;
::item dictionary&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:if hascombatitem fat stacks of cash&lt;br /&gt;
::item fat stacks of cash&lt;br /&gt;
::goto _endstasisitem&lt;br /&gt;
:endif&lt;br /&gt;
:&amp;quot;abort &amp;quot;No infinite use items detected!&amp;quot; &amp;quot;&lt;br /&gt;
:mark _endstasisitem&lt;br /&gt;
endsub&amp;lt;br /&amp;gt;&lt;br /&gt;
sub stasis&amp;lt;br /&amp;gt;&lt;br /&gt;
:while !pastround 20 &amp;amp;&amp;amp; !hppercentbelow 20 &amp;amp;&amp;amp; mppercentbelow 99&lt;br /&gt;
::call stasis_item&lt;br /&gt;
:endwhile&lt;br /&gt;
endsub&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Concerns for macros in CCS ===&lt;br /&gt;
*A macro&#039;s abort command needs to be encased in quotes because abort is also a legal CCS command. That&#039;s why all aborts in the previous example were quoted. &lt;br /&gt;
&lt;br /&gt;
*If a comment is the last line in a CCS, that will be used as your finishing attack even though it does nothing. Never conclude a CCS with a macro comment or it will abort to the mini-browser with a warning from KoL that you executed 37 commands in a row without taking an action.&lt;br /&gt;
&lt;br /&gt;
== Consult Scripts ==&lt;br /&gt;
While this may seem reasonably flexible, sometimes you will want to do something too complicated to express in this format. For instance if you want your character to take different actions based on your characters current stats or current monster level, a consult script can automatically figure it out. There are few limits to what a consult script can enable. The downside to using a consult script is that KoLmafia will not be able to generate a combat macro to pass to KoL. As a result multi-round combat will take somewhat longer.&lt;br /&gt;
&lt;br /&gt;
A consult script is called by using the &amp;quot;consult&amp;quot; command in your CCS, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
[ default ]&amp;lt;br /&amp;gt;&lt;br /&gt;
consult myscript.ash&amp;lt;br /&amp;gt;&lt;br /&gt;
attack&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main() function in the ASH script being consulted must accept three parameters:&lt;br /&gt;
&lt;br /&gt;
 void main(int round, monster mob, string combat)&lt;br /&gt;
&lt;br /&gt;
These values will be supplied by mafia when the consult script is called.&lt;br /&gt;
&lt;br /&gt;
=== Example of a Consult Script ===&lt;br /&gt;
This example will attempt to maximize use of a Sauceror&#039;s spells as a Sauceror by making use of sauce splash effects when they can be used.&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
// Save this as SauceSplash.ash&lt;br /&gt;
boolean sauceSplash() {&lt;br /&gt;
   if(!(have_effect($effect[Jabañero Saucesphere]) &amp;gt;0 &lt;br /&gt;
      || have_effect($effect[Jalapeño Saucesphere]) &amp;gt;0))&lt;br /&gt;
         return false;&lt;br /&gt;
   int normal = numeric_modifier(&amp;quot;spell damage&amp;quot;);&lt;br /&gt;
   if(normal &amp;gt;= 25)&lt;br /&gt;
      return true;&lt;br /&gt;
   int cold = numeric_modifier(&amp;quot;cold spell damage&amp;quot;);&lt;br /&gt;
   int hot = numeric_modifier(&amp;quot;hot spell damage&amp;quot;);&lt;br /&gt;
   if(have_skill($skill[Immaculate Seasoning])&lt;br /&gt;
      &amp;amp;&amp;amp; cold != hot &amp;amp;&amp;amp; max(cold, hot) + normal &amp;gt;= 25)&lt;br /&gt;
         return true;&lt;br /&gt;
   if(monster_element() == $element[cold] &amp;amp;&amp;amp; cold + normal &amp;gt;= 25 &lt;br /&gt;
     &amp;amp;&amp;amp; (have_skill($skill[Immaculate Seasoning])&lt;br /&gt;
     || have_equipped($item[Gazpacho&#039;s Glacial Grimoire])))&lt;br /&gt;
        return true;&lt;br /&gt;
   if(monster_element() == $element[hot] &amp;amp;&amp;amp; hot + normal &amp;gt;= 25&lt;br /&gt;
     &amp;amp;&amp;amp; (have_skill($skill[Immaculate Seasoning])&lt;br /&gt;
     || have_equipped($item[Codex of Capsaicin Conjuration]) &lt;br /&gt;
     || have_equipped($item[Ol&#039; Scratch&#039;s manacles])&lt;br /&gt;
     || (have_equipped($item[Ol&#039; Scratch&#039;s ash can]) &amp;amp;&amp;amp; my_class() == $class[Sauceror])))&lt;br /&gt;
        return true;&lt;br /&gt;
   return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main(int initround, monster foe, string page) {&lt;br /&gt;
   if(have_effect($effect[Burning Soul]) || have_effect($effect[Soul Freeze]) || !sauceSplash())&lt;br /&gt;
      use_skill($skill[Saucegeyser]);&lt;br /&gt;
   else&lt;br /&gt;
      use_skill($skill[Wave of Sauce]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This consult script can then be integrated into a CCS like this:&lt;br /&gt;
&amp;lt;div style=&amp;quot;border: solid 1px black; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
[ default ]&amp;lt;br /&amp;gt;&lt;br /&gt;
consult SauceSplash.ash&amp;lt;br /&amp;gt;&lt;br /&gt;
attack&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parts of a Combat Consultation Script ===&lt;br /&gt;
As you can see in the above example, a consultation script is called with three parameters.&lt;br /&gt;
*The first parameter is the round of combat that the script is called. Sometimes it is important to keep track of the round. This is particularly important to keep from losing the fight by going over 30 rounds.&lt;br /&gt;
*The second parameter is the monster that you are fighting. This is important because it enables you to take different actions for different monsters.&lt;br /&gt;
*The third parameter is the text of the page. This is important because it enables you to examine every detail of the fight as it is taking place. It can be analyzed for potential actions, damage that you deal to a monster and all other events.&lt;br /&gt;
&lt;br /&gt;
All possible actions you can take in a round of combat are listed under [[In-combat Consulting]].&lt;br /&gt;
&lt;br /&gt;
=== Resolution of a Combat Consultation Script ===&lt;br /&gt;
The consult script can automate as many, or as few rounds of combat as desired to achieve its goal. When it finishes executing, if the monster is not yet dead, then the CCS will continue combat from the current round. Note that the current round is not always the next line in a script. For instance, if the consult script is called at round 1 and executes three actions, then it will return to the CCS at round 4. This is why most CCSs containing consult script prefer to have only a line after the consult script, usually a simple method of killing a monster.&lt;br /&gt;
&lt;br /&gt;
== Employ Scripts ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 1em; border: solid 1px red; color: red; font-weight: bold;&amp;quot;&amp;gt;Please note! This section is speculative; Employ Scripts have not yet been implemented.&amp;lt;/div&amp;gt;&lt;br /&gt;
An employ script is a like a consultation script, with benefits. While a consultation script operates turn-by-turn, an employ script operates only at the beginning of the combat and generates a combat macro.&lt;br /&gt;
&lt;br /&gt;
Employ scripts do not yet exist in KolMafia at this time, but they are a goal that jasonharper is working towards as he [http://kolmafia.us/showthread.php?4098-Dynamic-Combat-in-the-Age-of-Macros describes on the mafia forum].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is currently proposed that they will have the following format:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;string main( string opponent, string pageText, string macroSoFar, string parameter )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* opponent is the name of the monster being fought, just as in a consult script or combat filter function.&lt;br /&gt;
* pageText is the raw HTML of the initial combat page. This isn&#039;t necessarily going to be useful (since it&#039;s a one-time snapshot), however you may want to examine the Skills popup to see what conditionally-available skills are actually available.&lt;br /&gt;
* macroSoFar is the current text of the macro being built - a mafia-generated header with some useful subroutines defined, followed by macro translations of all the prior lines in the CCS.&lt;br /&gt;
* parameter contains any extra text from the CCS line; it could be used to customize the behavior of the script, more conveniently than using a &amp;quot;note&amp;quot; line with a consult script. It also serves the less obvious purpose of making the parameter count something other than 3, so that mistakenly attempting to employ a consult script, or consult an employ script, will fail before any code runs.&lt;br /&gt;
* The return value entirely replaces the macro being built. It would probably be an error for this to be any shorter than the original value of macroSoFar.&lt;br /&gt;
&lt;br /&gt;
The simplest thing an employ script could do is to append some commands to macroSoFar, and return that. Other possibilities include:&lt;br /&gt;
* It could look back through the previously-generated macro commands to decide what to do. For example, it could refrain from adding a &amp;quot;pickpocket&amp;quot; action if that has already been done&lt;br /&gt;
* If it wanted to set up a global abort condition, active throughout the combat, it could insert the command at the beginning of the macro.&lt;br /&gt;
* There will be a subroutine called &amp;quot;mafiaround&amp;quot; defined in the header, and called before every combat action to handle things like automatic antidote use. The script could insert commands into that subroutine, for example to implement an eye color check for using He-Boulder major rays.&lt;br /&gt;
* There will likely be other defined subroutines for the script to call or modify.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Monster_element&amp;diff=5303</id>
		<title>Monster element</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Monster_element&amp;diff=5303"/>
		<updated>2010-10-04T02:59:54Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added a dumb code sample...critics welcome!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|monster_element}}{{&lt;br /&gt;
#vardefine:return_type|element}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
}}|&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|monster|check_me}}|&lt;br /&gt;
p1desc={{Pspan|check_me}} is the (optional) monster to get the elemental alignment of|&lt;br /&gt;
}}|&lt;br /&gt;
function_description=Returns the elemental alignment of the specified monster {{pspan|check_me}}. If {{pspan|check_me}} is not specified, it defaults to the last monster you encountered.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This function can be used from within an [[In-combat Consulting]] script to help determine your fight strategy. When used this way, it isn&#039;t necessary to specify a monster, as the function will default to the one currently being fought.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Sample Code|&lt;br /&gt;
description=This example attempts to find element(s) that the monster being fought right now is weak against.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
boolean [element] weak_elements;&lt;br /&gt;
&lt;br /&gt;
switch (monster_element())&lt;br /&gt;
{&lt;br /&gt;
case $element[cold]:   weak_elements = $element[spooky, hot];    break;&lt;br /&gt;
case $element[spooky]: weak_elements = $element[hot, stench];    break;&lt;br /&gt;
case $element[hot]:    weak_elements = $element[stench, sleaze]; break;&lt;br /&gt;
case $element[stench]: weak_elements = $element[sleaze, cold];   break;&lt;br /&gt;
case $element[sleaze]: weak_elements = $element[cold, spooky];   break;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|monster_attack|monster_defense|monster_hp}}|&lt;br /&gt;
special=If no monster is specified and no monster has been fought in this session, this function returns $element[none]. This is because mafia forgets the value of [[last_monster|last_monster()]] when it logs out.|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Adventuring]]|[[Category:In-combat Consulting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Tips,_Tricks_and_Workarounds&amp;diff=7190</id>
		<title>Tips, Tricks and Workarounds</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Tips,_Tricks_and_Workarounds&amp;diff=7190"/>
		<updated>2010-10-01T07:02:06Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added 1-liner page intro and Offline Testing seciton&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
This page contains various tips and tricks that may help you in using KoLmafia and writing scripts.&lt;br /&gt;
&lt;br /&gt;
==Free Pulls==&lt;br /&gt;
&lt;br /&gt;
KoLmafia considers free pulls as completely separate from other items in Hangks. Because there is no resource being consumed by pulling them, they do not use the functions involved in pulls, specifically {{f|storage_amount}} and {{f|take_storage}}.&lt;br /&gt;
&lt;br /&gt;
To find the quantity of a free pull in Hangks, such as a brick you need to use {{f|available_amount}}. To remove a free pull item from Hangks you need to use {{f|retrieve_item}}.&lt;br /&gt;
&lt;br /&gt;
== Anonymous closures ==&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=ASH does not seem to accept anonymous closures by default. This is an example of an anonymous closure.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    call_some_function();&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=However, you can use a workaround with a if-clause like the following example.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
if (true)&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
As for where stuff like this could be used... It can initialize ASH scripts without creating any unnecessary functions or variables in the &amp;quot;namespace&amp;quot;. Not everyone&#039;s cup of tea, but at least you know.&lt;br /&gt;
&lt;br /&gt;
== Capturing an Abort ==&lt;br /&gt;
&lt;br /&gt;
By default, whenever an ASH function returns false, everything will abort &#039;&#039;unless&#039;&#039; you somehow capture the return value (i.e. assigning it to a variable or enclosing it in a control structure). So, if you want to make use of, say, the hermit() function in a way that won&#039;t abort if the function returns false, you could:&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Save the result as a boolean variable.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
boolean fakeBool = hermit(1, $item[Ten-leaf clover]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Capture the result in an if() conditional.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(!hermit(1, $item[Ten-leaf clover])) print(&amp;quot;Hermit looting failed: continuing on.&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An if() conditional doesn&#039;t even have to do anything.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(hermit(1, $item[Ten-leaf clover])) {}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The most minimalistic method is to capture it with a not operator and parenthesis.|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
(!hermit(1, $item[Ten-leaf clover]));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any of these will capture the return value and prevent mafia from aborting.&lt;br /&gt;
&lt;br /&gt;
== Syntax Highlighting for Notepad++ ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing Scripts Offline ==&lt;br /&gt;
&lt;br /&gt;
Because KoLmafia CLI and ASH are interpreted, it is impossible to know whether there are any errors in your scripts until you run it. If you want to check only the syntax of the script, you can run it without logging in. From the top menu of the login pane, select &amp;quot;General&amp;quot;, then &amp;quot;Graphical CLI&amp;quot;. The CLI (and the rest of the mafia interface) will appear, and running scripts will properly validate them. Note that because you are not logged in, any functions or commands that use or interact with KoL will not work. Thus, testing scripts this way will not reveal any KoL-related logical errors.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6336</id>
		<title>ASH For Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6336"/>
		<updated>2010-09-27T23:19:32Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: It bothers me that several articles have top-level section headings using &amp;lt;h1&amp;gt;, not &amp;lt;h2&amp;gt;. Unless there is a specific reason for this, I will correct them whenever I see one.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==File Editing==&lt;br /&gt;
To create and edit ASH scripts, you need a text editing program that doesn&#039;t automatically add line-breaks for word wrapping.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
While the built in editor TextEdit will work fine (as long as you remember to write only in plaintext), [http://www.barebones.com/products/textwrangler/ TextWrangler] is a much more powerful tool. It may not be designed for ASH scripting specifically, but it was written for a similar purpose.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
If you use Linux, you probably already know about the options available for text editing. Emacs, Vi, etc. are all fine for creating ASH scripts.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Windows users beware; using Microsoft Word to create ASH files will lead to no end of headaches! The built-in program notepad will work, as can wordpad when configured with the option &amp;quot;No Wrap&amp;quot; for text. However, having a program that can handle syntax-highlighting can be very beneficial. Many scripters recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] for ASH (and other programmatic) scripting. In this case, it&#039;s also beneficial to have a style configuration that works well with ASH, and one example can be found [http://kolmafia.us/showthread.php?3164-How-do-you-write-an-ASH-file&amp;amp;p=21567&amp;amp;viewfull=1#post21567 here].&lt;br /&gt;
&lt;br /&gt;
==Saving==&lt;br /&gt;
ASH scripts need to be saved with the file extension &amp;quot;.ash&amp;quot; to be properly recognized by KoLmafia. If you&#039;re using a built-in text editor on a Windows machine, it may automatically save your files with the &amp;quot;.txt&amp;quot; extension by default. (So you may end up with a file called &amp;quot;script.ash.txt&amp;quot; instead of the desired &amp;quot;script.ash&amp;quot;.) One way around this on Windows that usually works is to put quotes around the file name when you save it, including the extension.&lt;br /&gt;
&lt;br /&gt;
Most advanced text editors (such as Notepad++) will save files as specified, without the need for the quotes-trick.&lt;br /&gt;
&lt;br /&gt;
Most files should be saved in the &amp;quot;scripts&amp;quot; directory, which is located by default at the same directory level as the KoLmafia .jar or .exe file on Windows. You can also create a sub-directory under &amp;quot;scripts,&amp;quot; and it will be listed in KoLmafia&#039;s Scripts Menu.&lt;br /&gt;
&lt;br /&gt;
Relay browser scripts are the exception to the rule: they must be saved in the &amp;quot;relay&amp;quot; directory. Relay browser overrides need to be saved in the top level of &amp;quot;relay,&amp;quot; and must be named the same as the page they will override, except with an &amp;quot;.ash&amp;quot; extension. For example, to override &amp;quot;charpane.php&amp;quot; your script would need to be named &amp;quot;charpane.ash&amp;quot;. For user-interface scripts, the script name needs to start with &amp;quot;relay_&amp;quot; and end with &amp;quot;.ash&amp;quot;. These scripts must also be saved in the top-level of the &amp;quot;relay&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Programming==&lt;br /&gt;
You should first read through the various pages listed under &amp;quot;LANGUAGE CONVENTIONS&amp;quot; on the [[Main Page]]. One should also be aware that, with the exception of [[Control Structures]], all ASH commands need to end with a semi-colon.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Variables are used to hold information that you need to access multiple times. They must be declared before they can be used, by specifying the [[Data Types|Data Type]] that they will hold, followed by the variable name.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare a variable named &amp;quot;count&amp;quot; of an integer type. You can also set the initial value of a variable on the same line it is declared.&lt;br /&gt;
{{CodeSample|description=On the other hand:|code=&amp;lt;syntaxhighlight&amp;gt;int count = 6;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare the variable &amp;quot;count&amp;quot; with an initial value of 6.&lt;br /&gt;
&lt;br /&gt;
Notice that you would not want to have both of the above lines in your script! Variables operate under what&#039;s referred to as their scope. In a nutshell, scope defines where a variable is accessible. Scope &amp;quot;cascades&amp;quot; down, similar to stylesheets for those familiar with web programming. A variable declared at the top-level of a script (a &amp;quot;global&amp;quot; variable), outside of any functions, will be accessible anywhere in your script, or in any other scripts that import it. A variable declared inside of a function will be accessible only inside that function (including inside of control structures), but is considered to not exist by other functions. Since ASH uses curly brace scope, variables within a set of curly braces (&#039;&#039;&#039;{ }&#039;&#039;&#039;) will not be available outside that same set of braces.&lt;br /&gt;
&lt;br /&gt;
Declaring a variable multiple times will generate an [[ASH Errors#Variable is already defined|error]]. Note that this only applies to variable with overlapping scope; if one function uses a variable named &amp;quot;bob&amp;quot; that is declared inside of the function, another function can declare another variable with the same name, even as a different datatype. However, the error will still occur if you have a globally-defined variable, and then declare a variable with the same name inside of a function (as their scopes overlap).&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
Functions are groupings of operations that can be applied multiple times by referencing the function name. Basically, they avoid having to re-type the same code over and over.&lt;br /&gt;
&lt;br /&gt;
====Built-in functions====&lt;br /&gt;
Many functions are built-in to KoLmafia, and examples can be found all over this wiki. Examples on the wiki are given in the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;datatypeReturned function_name([datatype1 parameter1] ...)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is the datatype that the function returns. Though you don&#039;t have to make use of this in a script, you would almost always want to (except for some functions that return a boolean). You need to be careful to match datatypes (though sometimes an implicit conversion is done; ie KoLmafia will usually translate a float into an int, and many commands that output text will implicitly convert from most datatypes). For example, if you have a variable of the datatype string, it is often an error to assign to it a function that returns an item.&lt;br /&gt;
&lt;br /&gt;
The function name follows and then parentheses, which may have nothing or multiple sets of datatypes &amp;amp; parameters.&lt;br /&gt;
&lt;br /&gt;
The parameter names are used for reference on the rest of the page (so you can match descriptions of parameters to the parameter in question, which is especially useful if the function takes more than one parameter with the same datatype).&lt;br /&gt;
&lt;br /&gt;
Note that, as with assignments of a fucntion&#039;s return value, it is important to match the parameter datatypes when using the function. If you have a function with the parameter &amp;lt;b&amp;gt;item it&amp;lt;/b&amp;gt;, and you supply the name of the item as text in quotes (which is how a string is written), you will get an error for doing so.&lt;br /&gt;
&lt;br /&gt;
====Custom-coded functions====&lt;br /&gt;
It&#039;s also possible to write your own functions. To do so, you declare them similarly to a variable as above. However, a function can also have the datatype of &amp;quot;void,&amp;quot; which is not allowed for variables. A &amp;quot;void&amp;quot; function is one that does not return any value; it simply does what it&#039;s programmed to do and the rest of your program moves on, regardless of the results (unless of course an [[ASH Errors|error]] occurs, including a call to [[abort|abort()]].)&lt;br /&gt;
{{CodeSample|description=For example, this simple function will double an integer:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int double_it(int value) {&lt;br /&gt;
   return 2 * value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=Furthermore, there are two distinct ways to call functions, user-defined or built-in:&amp;lt;br /&amp;gt;Conventional,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function(param1[,param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=and &amp;quot;Java style&amp;quot;:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
param1.function([param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The only difference between the two forms is aesthetics, as they are functionally equivalent.&lt;br /&gt;
{{CodeSample|description=Also somewhat important to note is that these commands can be chained together, and they will be executed from left-to-right. So, for instance,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;quot;polka pop&amp;quot;.to_item().to_int()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=will return the item number for $item[Polka Pop], 4342. This is one instance where &amp;quot;Java style&amp;quot; is more aesthetically pleasing compared to the conventional|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
to_int(to_item(&amp;quot;polka pop&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Note that scope (discussed above, under [[ASH_For_Beginners#Variables|Variables]]) also applies to user-defined functions. Also, functions built into KoLmafia have priority over any user-defined functions with the same name and parameters.&lt;br /&gt;
&lt;br /&gt;
===String Concatenation===&lt;br /&gt;
The basics to string concatenation: &amp;quot;Hello&amp;quot; + &amp;quot;world&amp;quot; yields &amp;quot;Helloworld&amp;quot;. Likewise, variables can be strung together in this fashion. Unless the variables are both numbers (floats, booleans, or ints), they will be converted to strings, then concatenated. For instance: &amp;quot;3x &amp;quot; + $item[Polka Pop] yields &amp;quot;3x Polka Pop&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2732</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2732"/>
		<updated>2010-09-26T12:33:52Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Reverted to line breaks. I have yet to understand how wiki markup works with templates...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|print}}{{&lt;br /&gt;
#vardefine:return_type|void}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|message}}|&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|message}}|&lt;br /&gt;
parameter2={{Param|string|color}}|&lt;br /&gt;
p1desc={{Pspan|message}} is the text to print|&lt;br /&gt;
p2desc={{Pspan|color}} is an html color name or code|&lt;br /&gt;
}}|&lt;br /&gt;
function_description=Print the specified text {{pspan|message}} to the CLI. If the optional {{pspan|color}} parameter is specified and a valid html color code or entity, it will print in that color. See the [http://www.w3.org/TR/CSS21/syndata.html#color-units CSS 2.1 color specification] for a description of valid color syntax and keywords.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Prints stuff in color and black. Note that it prints black twice: first and last.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(&amp;quot;This is black.&amp;quot;);&lt;br /&gt;
foreach color in $strings[blue, green, olive, darkorange, magenta, black]&lt;br /&gt;
   print(&amp;quot;This is &amp;quot;+color+&amp;quot;.&amp;quot;, color);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|logprint|print_html}}|&lt;br /&gt;
cli_equiv=The CLI commands &amp;quot;fprint,&amp;quot; &amp;quot;echo&amp;quot; and &amp;quot;fecho&amp;quot; have similar functionality, minus the color option. However, &amp;quot;cecho&amp;quot; (also &amp;quot;colorecho&amp;quot;) does have this option for color.|&lt;br /&gt;
special=Using an invalid color name or code can cause odd colors to be chosen; see the [[Talk:Print|Talk Page]] for details.&lt;br /&gt;
&amp;lt;br /&amp;gt;As of r8638, attempting to print a string beginning with a slash(/) will cause KoLmafia to print a blank line instead. To avoid this behavior, you must specify the second argument for the text color. Any color will do, and even a blank string (&amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;) will work.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2731</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2731"/>
		<updated>2010-09-26T12:32:08Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Formatting - abandoned line breaks for unordered lists.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|print}}{{&lt;br /&gt;
#vardefine:return_type|void}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|message}}|&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|message}}|&lt;br /&gt;
parameter2={{Param|string|color}}|&lt;br /&gt;
p1desc={{Pspan|message}} is the text to print|&lt;br /&gt;
p2desc={{Pspan|color}} is an html color name or code|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Print the specified text {{pspan|message}} to the CLI. If the optional {{pspan|color}} parameter is specified and a valid html color code or entity, it will print in that color. See the [http://www.w3.org/TR/CSS21/syndata.html#color-units CSS 2.1 color specification] for a description of valid color syntax and keywords.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Prints stuff in color and black. Note that it prints black twice: first and last.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(&amp;quot;This is black.&amp;quot;);&lt;br /&gt;
foreach color in $strings[blue, green, olive, darkorange, magenta, black]&lt;br /&gt;
   print(&amp;quot;This is &amp;quot;+color+&amp;quot;.&amp;quot;, color);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|logprint|print_html}}|&lt;br /&gt;
cli_equiv=The CLI commands &amp;quot;fprint,&amp;quot; &amp;quot;echo&amp;quot; and &amp;quot;fecho&amp;quot; have similar functionality, minus the color option. However, &amp;quot;cecho&amp;quot; (also &amp;quot;colorecho&amp;quot;) does have this option for color.|&lt;br /&gt;
special=&lt;br /&gt;
*Using an invalid color name or code can cause odd colors to be chosen; see the [[Talk:Print|Talk Page]] for details.&lt;br /&gt;
*As of r8638, attempting to print a string beginning with a slash(/) will cause KoLmafia to print a blank line instead. To avoid this behavior, you must specify the second argument for the text color. Any color will do, and even a blank string (&amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;) will work.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2730</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2730"/>
		<updated>2010-09-26T12:30:19Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added info about the [print(&amp;quot;/write a blank string instead of this text&amp;quot;)] bug.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|print}}{{&lt;br /&gt;
#vardefine:return_type|void}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|message}}|&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|message}}|&lt;br /&gt;
parameter2={{Param|string|color}}|&lt;br /&gt;
p1desc={{Pspan|message}} is the text to print|&lt;br /&gt;
p2desc={{Pspan|color}} is an html color name or code|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Print the specified text {{pspan|message}} to the CLI. If the optional {{pspan|color}} parameter is specified and a valid html color code or entity, it will print in that color. See the [http://www.w3.org/TR/CSS21/syndata.html#color-units CSS 2.1 color specification] for a description of valid color syntax and keywords.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Prints stuff in color and black. Note that it prints black twice: first and last.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(&amp;quot;This is black.&amp;quot;);&lt;br /&gt;
foreach color in $strings[blue, green, olive, darkorange, magenta, black]&lt;br /&gt;
   print(&amp;quot;This is &amp;quot;+color+&amp;quot;.&amp;quot;, color);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|logprint|print_html}}|&lt;br /&gt;
cli_equiv=The CLI commands &amp;quot;fprint,&amp;quot; &amp;quot;echo&amp;quot; and &amp;quot;fecho&amp;quot; have similar functionality, minus the color option. However, &amp;quot;cecho&amp;quot; (also &amp;quot;colorecho&amp;quot;) does have this option for color.|&lt;br /&gt;
special=&lt;br /&gt;
Using an invalid color name or code can cause odd colors to be chosen; see the [[Talk:Print|Talk Page]] for details.&lt;br /&gt;
As of r8638, attempting to print a string beginning with a slash(/) will cause KoLmafia to print a blank line instead. To avoid this behavior, you must specify the second argument for the text color. Any color will do, and even a blank string (&amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;) will work.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Tips,_Tricks_and_Workarounds&amp;diff=7181</id>
		<title>Talk:Tips, Tricks and Workarounds</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Tips,_Tricks_and_Workarounds&amp;diff=7181"/>
		<updated>2010-09-26T12:18:12Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Quirks &amp;amp; Hacks from PhilmASTErpLus */ How about moving the information about print() to the function&amp;#039;s page?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Discussion Recap ==&lt;br /&gt;
&lt;br /&gt;
=== Discussion from [[Talk:Storage amount]] ===&lt;br /&gt;
&lt;br /&gt;
Can anyone else verify, before I edit it in, that this function doesn&#039;t work on free pulls? --[[User:StDoodle|StDoodle (#1059825)]] 11:45, 21 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Verified. I believe that this was reported as a bug once. (Back when we had that awesome bug tracker.) However this behavior was clarified to be working as intended and hence, not a bug. The fact that an itemd doesn&#039;t require a pulls means that it is supposed to be treated differently. Use {{f|available_amount}} minus {{f|item_amount}} to verify presence of free pulls in Hangks. Then get them into inventory with {{f|retrieve_item}} instead of with {{f|take_storage}}. You&#039;re right that info should probably be on all relevant pages.  --[[User:Bale|Bale]] 05:17, 22 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Perhaps we should start a special &amp;quot;caveats&amp;quot; page, and link to subheadings on it, for such info; it seems a bit much may be required to explain the situation to include it on every page. It would also be a good place to put info on things like Between Battle Scripts and adventure count in automation, etc. Thoughts? --[[User:StDoodle|StDoodle (#1059825)]] 15:10, 22 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I favor a caveats page. Or perhaps we could call it Tricks &amp;amp; Tips. We should add [[User:PhilmASTErpLus#ASH_Quirks_and_Hacks|THIS]] there also. --[[User:Bale|Bale]] 22:22, 22 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Tips, Tricks and Workarounds* sounds good to me. I agree that those items philmaterplus points out should go there. Also, we should clean up the FAQ to only include one example of non-aborting booleans, and move the full list to this new page, I think (with a link of course). Perhaps this would even be a good page to put a dedicated file link to the syntax highlighting scheme for Notepadd++ (I favor having it on the wiki, so when it&#039;s updated with new ash functions, it&#039;s... you know, updated). I&#039;ll come up with other ideas, too, and leave them on the talk page when it&#039;s there. --[[User:StDoodle|StDoodle (#1059825)]] 17:04, 23 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
*Actually it doesn&#039;t sound perfect, which is why I&#039;m not making it yet... hrmph.&lt;br /&gt;
&lt;br /&gt;
Moving Discussion to [[Talk: Tips, Tricks and Workarounds]]. Since there may be a bit of discussion about the page before it gets created properly. We can always move the talk page if we change our minds about what it should be called. --[[User:Bale|Bale]] 21:18, 23 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Quirks &amp;amp; Hacks from [[User:PhilmASTErpLus|PhilmASTErpLus]] ===&lt;br /&gt;
&lt;br /&gt;
*{{f|print}} displays a blank line when given a string starting with a slash (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.&lt;br /&gt;
*&amp;quot;Anonymous&amp;quot; closures: ASH does not seem to accept anonymous closures by default.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    call_some_function();&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
However, you can use a workaround with a if-clause.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
if (true)&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
As for where stuff like this could be used...I&#039;m using it for initializing ASH scripts without creating any unnecessary functions or variables in the &amp;quot;namespace&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:Great work so far, guys. One nitpick, though: I think the tip about using print() should be put in {{print|the appropriate function page}}, instead. I&#039;ll add it there ASAP. --[[User:PhilmASTErpLus|PhilmASTErpLus]] 12:18, 26 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== New Discussion ==&lt;br /&gt;
&lt;br /&gt;
Ugh, sorry. Can&#039;t think of the best way to fix that ATM, it was half a joke. (Note to self; don&#039;t edit wiki drunk.) --[[User:StDoodle|StDoodle (#1059825)]] 06:32, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Import&amp;diff=2823</id>
		<title>Import</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Import&amp;diff=2823"/>
		<updated>2010-09-16T20:44:48Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Reworded--automatic &amp;quot;#pragma once&amp;quot; feature is not only important for name collisions, but also for preventing a script from being executed multiple times. Also, it&amp;#039;s okay to remove &amp;#039;Formatting Needed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:import}}&lt;br /&gt;
&#039;&#039;&#039;import &amp;lt;filename&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Import&#039;&#039;&#039; is a command that is used to import (hence the name) an entire file&#039;s contents into the file in which &#039;&#039;&#039;import&#039;&#039;&#039; is called. &amp;quot;Nested&amp;quot; imports are possible; a script that is being imported may import another script. If a single file is imported more than once, KoLmafia will not import that file again. Note that when a script that has a &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; function is imported into another script with another &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; function, only the primary script&#039;s &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; is executed, and all &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; functions from imported scripts will be ignored. However, any of the imported top-level commands will be executed and all of the imported global variables will be accessible to the primary script. An import can only be used as a top-level command; attempting to import another script inside a closure (e.g. a function or a loop) will result in an error.&lt;br /&gt;
&lt;br /&gt;
Because &#039;&#039;&#039;import&#039;&#039;&#039; looks inside the /scripts directory and all its subfolders for the given script name, moving your scripts around inside the /scripts directory will not affect other scripts that rely on them. If there are multiple scripts with the same file name, KoLmafia will use the first script found. You can use your OS-specific directory path separators (usually slashes(/) and backslashes(\)) to explicitly &#039;&#039;&#039;import&#039;&#039;&#039; a script inside a subdirectory.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- code sample edited without permission by PhilmASTErpLus. --&amp;gt;&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
# snippet from my aftercore.ash file&lt;br /&gt;
import &amp;lt;lib/utilities.ash&amp;gt;    // import a utility function library in the scripts/lib/ directory&lt;br /&gt;
import &amp;lt;aftercore_config.ash&amp;gt; // import the configuration file (loaded with variables) into the script&lt;br /&gt;
import &amp;lt;aftercore_bounty.ash&amp;gt; // import bounty functionality (loaded with functions) into the script&lt;br /&gt;
&lt;br /&gt;
int first_meat = my_meat();&lt;br /&gt;
int first_advs = my_adventures();&lt;br /&gt;
boolean using_upcs_curr = false;&lt;br /&gt;
&lt;br /&gt;
# ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Alias&amp;diff=3091</id>
		<title>Alias</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Alias&amp;diff=3091"/>
		<updated>2010-09-16T20:32:39Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Expanded general how-to on aliases.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:alias}}&lt;br /&gt;
Creates a new alias in the KoLmafia CLI or displays the list of registered aliases.&lt;br /&gt;
An alias is a shortcut for complex CLI command(s) that are too long to type every time you want to. To create a new alias, type&lt;br /&gt;
 alias &#039;&#039;[alias_name]&#039;&#039; =&amp;gt; &#039;&#039;[actual_command]&#039;&#039;&lt;br /&gt;
into the CLI, where &amp;lt;code&amp;gt;&#039;&#039;[alias_name]&#039;&#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;&#039;[alias_command]&#039;&#039;&amp;lt;/code&amp;gt; are replaced with the shortcut string you want to use and the actual command string. For example, to create an alias &amp;quot;f&amp;quot; for the &amp;lt;code&amp;gt;[[familiar]]&amp;lt;/code&amp;gt; CLI command, type:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias f =&amp;gt; familiar&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, instead of typing &amp;lt;code&amp;gt;familiar pixie&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;familiar sandworm&amp;lt;/code&amp;gt;, you can just type &amp;lt;code&amp;gt;f pixie&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;f sandworm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To see the list of aliases that you have created so far, type &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; into the CLI without any arguments.&lt;br /&gt;
&lt;br /&gt;
Aliases are preserved across multiple characters. You can remove existing aliases by using the &amp;lt;code&amp;gt;[[unalias]]&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
== Complex Examples ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias dentures =&amp;gt; checkpoint; equip frilly skirt; ash visit_url(&amp;quot;inv_use.php?which=3&amp;amp;whichitem=2951&amp;amp;pwd&amp;quot;); visit_url(&amp;quot;choice.php?whichchoice=188&amp;amp;option=3&amp;amp;choiceform3=Catburgle&amp;amp;pwd&amp;quot;); cli_execute(&amp;quot;outfit checkpoint&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equips a frilly skirt, chooses the right choice in the Orcish Frat House Blueprints adventure, and then re-equips whatever pants you had on when you type &#039;&#039;dentures&#039;&#039; into the CLI.&lt;br /&gt;
&lt;br /&gt;
[[Category:CLI Commands]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Eating_%26_Drinking&amp;diff=4661</id>
		<title>KoLmafia Guide: Eating &amp; Drinking</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Guide:_Eating_%26_Drinking&amp;diff=4661"/>
		<updated>2010-09-16T20:11:59Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Minor grammar nitpicks and slight rewording to reflect recent food update.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This lesson covers managing and creating food, drink, and spleen-damaging items with Mafia. Eating and drinking in KoL&#039;s native interface sucks. As a new player you have no clue what most of the items do, and their description is only somewhat helpful and lacking in any concrete info in adventures gained or fullness used.  Digging through the wiki for every item is time-consuming and irritating.&lt;br /&gt;
Once you get into recipes for creating food and booze, it becomes very difficult to get anything done without tons of wiki studying.  You will master several common recipes but will likely overlook a lot of food and drinks you &#039;&#039;&#039;could&#039;&#039;&#039; make because you don&#039;t have them in mind.&lt;br /&gt;
&lt;br /&gt;
Mafia does a lot to address this and help you automate and keep track of your consumption. In this lesson, we will attempt to make and consume some drinks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# We are going to make some drinks. I am assuming that you have at least &#039;&#039;&#039;some&#039;&#039;&#039; stuff in your inventory that you can use to make drinks, AND you are not almost-drunk already. Go ahead and use advanced cocktail to summon Ice Cubes, etc if you can do so. Note that breakfast will do this for you.&lt;br /&gt;
# Click the top icon that looks like a backpack, or from the main menubar under General, select Item Manager.&lt;br /&gt;
#: [[File:Lesson11 topicons.png]]&lt;br /&gt;
# This is a big interface. On the left hand side, amongst the long list of stuff, under Usable, click on Booze. I recommend that you click the checkbox labeled &amp;quot;per drunk&amp;quot; to sort it with the highest quality booze at the top.&lt;br /&gt;
#:[[File:Lesson11 manager.png]]&lt;br /&gt;
# The screen is split into a top half and a bottom half. The bottom half contains a scrollpanel which has listings of booze, sorted by the quality of the beverage. Note that each drink has complete info as to stats and adventures per inebriation all spelled out. It&#039;s really awesome!&lt;br /&gt;
# You will notice that each drink has a number in parenthesis for Possible and Current. The Current number is how many of that drink you really have in your inventory. Possible is how many you COULD have, by mixing, buying, etc. When the Potential number is the same as the Actual, this means you have all of that drink that you could with your current state of inventory.&lt;br /&gt;
# You can click the &#039;No Create&#039; checkbox which will then only show drinks you have in your inventory, vs showing all drinks you could conceivably make. Consider though that Mafia &#039;&#039;&#039;does&#039;&#039; adjust the quality of created drinks based on the number of turns needed to create them.  For example, you will notice that your adventures per drunk increase for all your mixed drinks when you have a bartender-in-a-box.  Especially the 1 and 2 drunkenness drinks since spending a turn to make a 1 drunk drink is much worse than 1 turn to make a 4 drunk one.  The Per-Drunk checkbox should be active as Adventures per Drunk point are a much more useful measurement than total adventures.&lt;br /&gt;
# Going through the scrollbar, find the highest drink where you have more Possible than Current. This means you can make this drink. Select it and click Enqueue. It will ask how many to enqueue. It defaults to the difference between how many you have and can have, up to how much you can actually consume. In other words, if you have 3 martinis and 2 olive/gin, then it will default to enqueueing 2.&lt;br /&gt;
# Now, that drink goes to the Top of your screen&#039;s panel. Notice that the tab now shows how much Drunkenness you have enqueued. You can click the Ingredients Used tab to show exactly what the drink consists of.  This is particularly useful for both food and drink as you want to keep a tight rein on your Spices in many cases.  You also would probably not want to waste a precious Lime making a margarita with training wheels when you could make a Key Lime pie instead!&lt;br /&gt;
#:[[File:Lesson11 queue.png]]&lt;br /&gt;
# Click the Create button. It will now mix that drink for you. Depending on the settings it may even automatically create a bartender-in-a-box to ensure that it doesn&#039;t cost any turns. See below for how to do that!&lt;br /&gt;
# That drink now disappears from the top box and now your Current number has gone up for that drink. It made that drink for you.&lt;br /&gt;
# &#039;&#039;&#039;In-a-box feature:&#039;&#039;&#039; In the item manager, under Creatable, there are checkboxes to ensure Mafia will &#039;&#039;&#039;only&#039;&#039;&#039; create food/drink using a in-a-box from your campsite and another to automatically create an in-a-box when you lack one or it breaks.  This is nice in that it ensures that you will not use up precious turns. It is also very helpful when your in-a-Box breaks and Mafia doesn&#039;t have enough parts to reassemble it.  In which case, you would normally use up turns when cooking/mixing. With this feature active you would all the sudden notice all your recipes disappear from mafia, which would alert you that something is amiss.  However, it is very important that you turn this feature off when you ascend!  The reason being that Mafia will simply not show any recipes until you make the appropriate in-a-box, which might be a while during hardcore. In the meantime you are left wondering why can&#039;t make any drinks!  Note that if you do not have sufficient parts to create the in-a-box, you might want to change your preferences temporarily to allow Mafia to purchase from the mall. Mafia will then buy what it needs in order to assemble it in the &#039;&#039;cheapest manner possible&#039;&#039; if not in ronin/hardcore.&lt;br /&gt;
#:[[File:Lesson11 in-a-boxen.png]]&lt;br /&gt;
# You will probably wanna go ahead and drink. Use any booze-booster like the Ode to Booze buff or whatever first. Then, assuming you have a max drunkenness of 15 (the default), enqueue 14 drunkenness worth of your best booze. You can Consume directly if desired, but I prefer to queue it all up first and make it.  It is usually a good idea to make all your booze and food first, then consume it.  This ensures that if you must use turns to create something that it won&#039;t mess up your Ode to Booze or Milk of Magnesium.  Nothing is worse than using those then running out of buff turns while making all the consumables!&lt;br /&gt;
# The top box will populate with your booze and auto-count the intoxication, warning you if you are about to overdrink. Click Consume when ready and it will drink.&lt;br /&gt;
# Exit the Inventory Manager, click the CGI Graphical tab and look at the log. See what all it really did for you behind the scenes. You might see that it bought a fruit from a hippy (by disguising if you had the suit), or a soda water from the Market. The log lets you see EXACTLY what it did, which is an important step when learning KoLmafia!&lt;br /&gt;
# Bring up the Inventory Manager again. Repeat this process for Food. Then, click Spleen and go ahead and consume all the various Moxie Weeds and other junk that accumulates in your inventory for the free substats (unless you want to autosell them for meat).  If you&#039;ve got wads or other adventure-granting spleen items this is where you consume them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning:&#039;&#039;&#039; It should be noted that the Food and Booze Manager is VERY pesky about allowing you to make drinks that it knows you cannot consume. If you are totally drunk, you will find that the Item Manager will not let you make any drinks! In this case you can still make them by going to the Createable section where it has listings for food and booze. The drawback is that it won&#039;t show you detailed consumption information in that window. This might be necessary if you wanted to make a bunch of cocktails to sell for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bottom Line:&#039;&#039;&#039; KoLmafia really takes the guesswork/research out of eating and drinking, and is a huge help for cooking/mixing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Continue to [[KoLmafia Guide: PvP (Beating Up People)|Lesson 12: PvP (Beating Up People)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:KoLmafia Guide]][[Category:New User Help]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Fullness_limit&amp;diff=2447</id>
		<title>Fullness limit</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Fullness_limit&amp;diff=2447"/>
		<updated>2010-09-16T20:02:26Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Unwrapped overflowing long code is long.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|fullness_limit}}{{&lt;br /&gt;
#vardefine:return_type|int}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the logged-in character&#039;s maximum fullness level as an int.  For most characters, the returned value will be 15.  On the Feast of Boris this number is raised by 15.  The number is also raised by 5 for characters with Stomach of Steel.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=This example calculates how many hot hi meins it can eat and then eats them.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if (my_fullness() + 5 &amp;lt;= fullness_limit())&lt;br /&gt;
{&lt;br /&gt;
   eat(floor((fullness_limit() - my_fullness()) / 5) , $item[hot hi mein]);&lt;br /&gt;
   // We&#039;re using floor() here because if (fullness_limit() - my_fullness())/5 returns, say, 2.6,&lt;br /&gt;
   //we only want it to consume 2.&lt;br /&gt;
   // Also, eat() takes an integer, not a float, as a parameter.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|my_fullness|eat}}|&lt;br /&gt;
special=When not logged in, this function returns 15.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Your Character]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=My_primestat&amp;diff=2253</id>
		<title>My primestat</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=My_primestat&amp;diff=2253"/>
		<updated>2010-09-16T19:58:42Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Reformatted code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|my_primestat}}{{&lt;br /&gt;
#vardefine:return_type|stat}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the stat associated with your class.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Samples|&lt;br /&gt;
description=The following example attempts to create as many scrumpdiddlyumptious solutions as you have scrumptious reagents if you can access the Mysticality guild store. Since Accordion Thieves above level 9 can also access {{kolwiki|Gouda&#039;s Grimoire and Grocery}}, this code checks for it as well.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if ((my_primestat() == $stat[mysticality] || (my_class() == $class[Accordion Thief] &amp;amp;&amp;amp; my_level() &amp;gt; 9))&lt;br /&gt;
      &amp;amp;&amp;amp; guild_store_available())&lt;br /&gt;
{&lt;br /&gt;
   retrieve_item(item_amount($item[scrumptious reagent]) , $item[delectable catalyst]);&lt;br /&gt;
   use(item_amount($item[delectable catalyst]) , $item[delectable catalyst]);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|retrieve_item|item_amount|use}}|&lt;br /&gt;
special=When not logged in, this function returns $stat[moxie] (Needs spading).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Your Character]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Contains&amp;diff=7166</id>
		<title>Contains</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Contains&amp;diff=7166"/>
		<updated>2010-09-16T01:31:47Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Redirected page to Data Structures#Contains&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Data_Structures#Contains]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:To_item&amp;diff=7163</id>
		<title>Talk:To item</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:To_item&amp;diff=7163"/>
		<updated>2010-09-16T00:58:32Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Created page with &amp;#039;Surprisingly, {{f|to_item}} works on familiars, but with unexpected results. For many familiars, it returns the hatchling of the given familiar:  &amp;lt;blockquote&amp;gt;Fuzzy Dice, Spooky P…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Surprisingly, {{f|to_item}} works on familiars, but with unexpected results. For many familiars, it returns the hatchling of the given familiar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Fuzzy Dice, Spooky Pirate Skeleton, Barrrnacle, Blood-Faced Volleyball, Star Starfish, Hovering Sombrero, Ghost Pickle on a Stick, Jill-O-Lantern, Hand Turkey, Hanukkimbo Dreidl, Baby Yeti, Clockwork Grapefruit, Inflatable Dodecapede, Pygmy Bugbear Shaman, Attention-Deficit Demon, Cymbal-Playing Monkey, Sweet Nutcracker, Pet Rock, Snowy Owl, Teddy Bear, Ninja Pirate Zombie Robot, Wind-up Chattering Teeth, Astral Badger, Comma Chameleon, Misshapen Animal Skeleton, Scary Death Orb, Jitterbug, Nervous Tick, Reassembled Blackbird, Evil Teddy Bear, Toothsome Rock, Dandy Lion, O.A.F., Exotic Parrot, Wizard Action Figure, Casagnova Gnome, Hunchbacked Minion, Crimbo P. R. E. S. S. I. E., Bulky Buddy Box, Teddy Borg, RoboGoose, El Vibrato Megadrone, Adorable Seal Larva, Hobo Monkey, Uniclops, Psychedelic Bear, Mutant Fire Ant, Mutant Cactus Bud, Mutant Gila Monster, Cuddlefish, Pair of Ragged Claws, Magic Dragonfish, Midget Clownfish, Syncopated Turtle, Grinning Turtle, Wereturtle, Rock Lobster, Chauvinist Pig, Jack-in-the-Box, Pottery Barn Owl&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, there were several interesting exceptions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mosquito =&amp;gt; tiny plastic mosquito&lt;br /&gt;
Levitating Potato =&amp;gt; tiny plastic levitating potato&lt;br /&gt;
Angry Goat =&amp;gt; tiny plastic angry goat&lt;br /&gt;
Howling Balloon Monkey =&amp;gt; tiny plastic howling balloon monkey&lt;br /&gt;
Grue =&amp;gt; tiny plastic grue&lt;br /&gt;
Baby Gravy Fairy =&amp;gt; tiny plastic baby gravy fairy&lt;br /&gt;
Cocoabo =&amp;gt; tiny plastic cocoabo&lt;br /&gt;
Coffee Pixie =&amp;gt; tiny plastic coffee pixie&lt;br /&gt;
Cheshire Bat =&amp;gt; tiny plastic Cheshire bat&lt;br /&gt;
MagiMechTech MicroMechaMech =&amp;gt; stuffed MagiMechTech MicroMechaMech&lt;br /&gt;
Flaming Gravy Fairy =&amp;gt; stuffed flaming gravy fairy&lt;br /&gt;
Frozen Gravy Fairy =&amp;gt; stuffed frozen gravy fairy&lt;br /&gt;
Stinky Gravy Fairy =&amp;gt; stuffed stinky gravy fairy&lt;br /&gt;
Spooky Gravy Fairy =&amp;gt; stuffed spooky gravy fairy&lt;br /&gt;
Sleazy Gravy Fairy =&amp;gt; stuffed sleazy gravy fairy&lt;br /&gt;
Ancient Yuletide Troll =&amp;gt; tiny plastic ancient yuletide troll&lt;br /&gt;
Stocking Mimic =&amp;gt; tiny plastic stocking mimic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Perhaps they are chosen by matching the familiar name with the item name. For reference, the list of familiars for whom {{f|to_item}} returns nothing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Leprechaun, Sabre-Toothed Lime, Stab Bat, Ghuol Whelp, Killer Bee, Whirling Maple Leaf, Crimbo Elf, Feather Boa Constrictor, Emo Squid, Personal Raincloud, Doppelshifter, Temporal Riftlet, Wild Hare, Spirit Hobo, Origami Towel Crane, Ninja Snowflake, Penguin Goodfella, Jumpsuited Hound Dog, Green Pixie, Ragamuffin Imp, Gluttonous Green Ghost, Mad Hatrack, Untamed Turtle, Animated Macaroni Duck, Pet Cheezling, Autonomous Disco Ball, Mariachi Chihuahua, Llama Lama, Cotton Candy Carnie, Disembodied Hand, Black Cat, Baby Mutant Rattlesnake, Sugar Fruit Fairy, Imitation Crab, Frumious Bandersnatch, Purse Rat, Baby Sandworm, Slimeling, He-Boulder, Urchin Urchin, Grouper Groupie, Squamous Gibberer, Dancing Frog, Snow Angel, BRICKO chick, Baby Bugged Bugbear, Underworld Bonsai, Rogue Program, Mini-Hipster&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s weird, though. If {{f|to_item}} is actually using the familiar name to match the item, why does it return &amp;lt;code&amp;gt;$item[none]&amp;lt;/code&amp;gt; for the Leprechaun (tiny plastic leprechaun, leprechaun hatchling) or the Stab Bat (rewinged stab bat, tiny plastic stab bat)? Another mysterious quirks of ASH. --[[User:PhilmASTErpLus|PhilmASTErpLus]] 00:58, 16 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6775</id>
		<title>User:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6775"/>
		<updated>2010-09-13T12:35:59Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* ASH Quirks and Hacks */ Added information about the fairy gravy boat that I learned through the painful way.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m using this page as my own personal sandbox :) Please contribute your comments, opinions, and ideas in the [[User Talk:PhilmASTErpLus|talk page]].&lt;br /&gt;
&lt;br /&gt;
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Moving [[Datatype Constants]] to [[Data Types]] ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Datatype constants&amp;quot; are literals that begin with a dollar sign($), such as &amp;lt;code&amp;gt;$item[]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$effect[]&amp;lt;/code&amp;gt;, etc. Types of data, such as &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, are called [http://en.wikipedia.org/wiki/Data_type Data Types].&lt;br /&gt;
&lt;br /&gt;
That is true, and deserves fixing; but please don&#039;t do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Heh, that&#039;s okay (re: discussion on Datatype Constants). For most pages it isn&#039;t a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won&#039;t be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the &amp;quot;design by committee&amp;quot; philosophy &amp;amp; the &amp;quot;legacy problems&amp;quot; philosophy. Originally, the stuff here was simply copy &amp;amp; pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola&#039;s old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there&#039;s the &amp;quot;committee&amp;quot; issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn&#039;t present any issues with searching and display, but does up the learning curve for &amp;quot;proper&amp;quot; page editing in some places (mostly on the function pages). In the end, I&#039;m glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are &amp;quot;methods in the madness&amp;quot; for some of this stuff... ;)  Also, if you want to help with getting Datatype Constants corrected, I&#039;d be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
P.S. User pages such as this are the perfect places for sandboxing &amp;amp; discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a &amp;quot;/&amp;quot; as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.&lt;br /&gt;
&lt;br /&gt;
== Works ==&lt;br /&gt;
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. =&amp;gt; see {{f|file_to_map}}&lt;br /&gt;
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.&lt;br /&gt;
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].&lt;br /&gt;
&lt;br /&gt;
== ASH Quirks and Hacks ==&lt;br /&gt;
*{{f|print}} displays a blank line when given a string starting with a slash (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.&lt;br /&gt;
*&amp;quot;Anonymous&amp;quot; closures: ASH does not seem to accept anonymous closures by default.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    call_some_function();&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
However, you can use a workaround with a if-clause.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
if (true)&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
As for where stuff like this could be used...I&#039;m using it for initializing ASH scripts without creating any unnecessary functions or variables in the &amp;quot;namespace&amp;quot;.&lt;br /&gt;
*Technically NOT ASH-related, but KoLmafia has difficulty understanding haiku combat. In particular, as of r8611, it cannot detect acquisition of {{kolwiki|fairy gravy boat}}s from the {{kolwiki|Gravy Fairy Wing}} adventure. Therefore you must NOT use a goal and auto-adventure to get one. Let the adventurer beware!&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Import&amp;diff=2822</id>
		<title>Import</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Import&amp;diff=2822"/>
		<updated>2010-09-13T07:40:21Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Subdirectory stuff. Does a similar logic applies to file_to_map()/map_to_file()? I believe there was a forum discussion about security and preventing KoLmafia from accessing the parent directory.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:import}}&lt;br /&gt;
&#039;&#039;&#039;import &amp;lt;filename&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Import&#039;&#039;&#039; is a command that is used to import (hence the name) an entire file&#039;s contents into the file in which &#039;&#039;&#039;import&#039;&#039;&#039; is called. &amp;quot;Nested&amp;quot; imports are possible; a script that is being imported may import another script. If a single file is imported more than once, KoLmafia will automatically avoid function name collisions. Note that when a script that has a &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; function is imported into another script with another &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; function, only the primary script&#039;s &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; is executed, and all &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt; functions from imported scripts will be ignored. However, any of the imported top-level commands will be executed and all of the imported global variables will be accessible to the primary script.&lt;br /&gt;
&lt;br /&gt;
Because &#039;&#039;&#039;import&#039;&#039;&#039; looks inside the /scripts directory and all its subfolders for the given script name, moving your scripts around inside the /scripts directory will not affect other scripts that rely on them. If there are multiple scripts with the same file name, KoLmafia will use the first script found. You can use your OS-specific directory path separators (usually slashes(/) and backslashes(\)) to explicitly &#039;&#039;&#039;import&#039;&#039;&#039; a script inside a subdirectory.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- code sample edited without permission by PhilmASTErpLus. --&amp;gt;&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
# snippet from my aftercore.ash file&lt;br /&gt;
import &amp;lt;lib/utilities.ash&amp;gt;    // import a utility function library in the scripts/lib/ directory&lt;br /&gt;
import &amp;lt;aftercore_config.ash&amp;gt; // import the configuration file (loaded with variables) into the script&lt;br /&gt;
import &amp;lt;aftercore_bounty.ash&amp;gt; // import bounty functionality (loaded with functions) into the script&lt;br /&gt;
&lt;br /&gt;
int first_meat = my_meat();&lt;br /&gt;
int first_advs = my_adventures();&lt;br /&gt;
boolean using_upcs_curr = false;&lt;br /&gt;
&lt;br /&gt;
# ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{Format}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6774</id>
		<title>User:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6774"/>
		<updated>2010-09-13T02:13:55Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m using this page as my own personal sandbox :) Please contribute your comments, opinions, and ideas in the [[User Talk:PhilmASTErpLus|talk page]].&lt;br /&gt;
&lt;br /&gt;
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Moving [[Datatype Constants]] to [[Data Types]] ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Datatype constants&amp;quot; are literals that begin with a dollar sign($), such as &amp;lt;code&amp;gt;$item[]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$effect[]&amp;lt;/code&amp;gt;, etc. Types of data, such as &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, are called [http://en.wikipedia.org/wiki/Data_type Data Types].&lt;br /&gt;
&lt;br /&gt;
That is true, and deserves fixing; but please don&#039;t do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Heh, that&#039;s okay (re: discussion on Datatype Constants). For most pages it isn&#039;t a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won&#039;t be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the &amp;quot;design by committee&amp;quot; philosophy &amp;amp; the &amp;quot;legacy problems&amp;quot; philosophy. Originally, the stuff here was simply copy &amp;amp; pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola&#039;s old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there&#039;s the &amp;quot;committee&amp;quot; issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn&#039;t present any issues with searching and display, but does up the learning curve for &amp;quot;proper&amp;quot; page editing in some places (mostly on the function pages). In the end, I&#039;m glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are &amp;quot;methods in the madness&amp;quot; for some of this stuff... ;)  Also, if you want to help with getting Datatype Constants corrected, I&#039;d be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
P.S. User pages such as this are the perfect places for sandboxing &amp;amp; discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a &amp;quot;/&amp;quot; as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.&lt;br /&gt;
&lt;br /&gt;
== Works ==&lt;br /&gt;
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. =&amp;gt; see {{f|file_to_map}}&lt;br /&gt;
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.&lt;br /&gt;
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].&lt;br /&gt;
&lt;br /&gt;
== ASH Quirks and Hacks ==&lt;br /&gt;
*{{f|print}} displays a blank line when given a string starting with a slash (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.&lt;br /&gt;
*&amp;quot;Anonymous&amp;quot; closures: ASH does not seem to accept anonymous closures by default.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    call_some_function();&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
However, you can use a workaround with a if-clause.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
if (true)&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
As for where stuff like this could be used...I&#039;m using it for initializing ASH scripts without creating any unnecessary functions or variables in the &amp;quot;namespace&amp;quot;.&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6773</id>
		<title>User:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6773"/>
		<updated>2010-09-13T02:13:36Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m using this page as my own personal sandbox :) Please contribute your comments, opinions, and ideas in the [[User Talk:PhilmASTErpLus|talk page]].&lt;br /&gt;
&lt;br /&gt;
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Moving [[Datatype Constants]] to [[Data Types]] ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Datatype constants&amp;quot; are literals that begin with a dollar sign($), such as &amp;lt;code&amp;gt;$item[]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$effect[]&amp;lt;/code&amp;gt;, etc. Types of data, such as &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, are called [http://en.wikipedia.org/wiki/Data_type Data Types].&lt;br /&gt;
&lt;br /&gt;
That is true, and deserves fixing; but please don&#039;t do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Heh, that&#039;s okay (re: discussion on Datatype Constants). For most pages it isn&#039;t a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won&#039;t be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the &amp;quot;design by committee&amp;quot; philosophy &amp;amp; the &amp;quot;legacy problems&amp;quot; philosophy. Originally, the stuff here was simply copy &amp;amp; pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola&#039;s old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there&#039;s the &amp;quot;committee&amp;quot; issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn&#039;t present any issues with searching and display, but does up the learning curve for &amp;quot;proper&amp;quot; page editing in some places (mostly on the function pages). In the end, I&#039;m glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are &amp;quot;methods in the madness&amp;quot; for some of this stuff... ;)  Also, if you want to help with getting Datatype Constants corrected, I&#039;d be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
P.S. User pages such as this are the perfect places for sandboxing &amp;amp; discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a &amp;quot;/&amp;quot; as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.&lt;br /&gt;
&lt;br /&gt;
=== Works ===&lt;br /&gt;
&lt;br /&gt;
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. =&amp;gt; see {{f|file_to_map}}&lt;br /&gt;
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.&lt;br /&gt;
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].&lt;br /&gt;
&lt;br /&gt;
== ASH Quirks and Hacks ==&lt;br /&gt;
*{{f|print}} displays a blank line when given a string starting with a slash (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.&lt;br /&gt;
*&amp;quot;Anonymous&amp;quot; closures: ASH does not seem to accept anonymous closures by default.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    call_some_function();&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
However, you can use a workaround with a if-clause.&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int var1;&lt;br /&gt;
/* Do stuff */&lt;br /&gt;
if (true)&lt;br /&gt;
{&lt;br /&gt;
    int var1;&lt;br /&gt;
    /* Do other stuff */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
As for where stuff like this could be used...I&#039;m using it for initializing ASH scripts without creating any unnecessary functions or variables in the &amp;quot;namespace&amp;quot;.&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Item_Management&amp;diff=4215</id>
		<title>Item Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Item_Management&amp;diff=4215"/>
		<updated>2010-09-12T10:31:35Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Informational */ Reordered to correctly group X_amount() functions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==Informational==&lt;br /&gt;
{{Flink|int|my_meat|desc=Returns the amount of meat you have on hand.}}&lt;br /&gt;
{{Flink|int|my_closet_meat|desc=Returns the amount of meat you have in your Colossal Closet.}}&lt;br /&gt;
{{Flink|int|pulls_remaining|desc=Returns the number of pulls you can make from storage, or 0 if not applicable.}}&lt;br /&gt;
{{Flink|boolean|have_chef|desc=Returns true if you have a chef-boxen at your campground.}}&lt;br /&gt;
{{Flink|boolean|have_bartender|desc=Returns true if you have a bartender-boxen at your campground.}}&lt;br /&gt;
{{Flink|int [item]|get_campground|desc=Returns a map of your campground items.}}&lt;br /&gt;
{{Flink|boolean|have_mushroom_plot|desc=Returns true if and only if you&#039;ve purchased a mushroom plot this run.}}&lt;br /&gt;
{{Flink|int|stills_available|desc=Returns the number of Nash Crosby&#039;s Still uses left for the day (0 if not accessible).}}&lt;br /&gt;
{{Flink|string|item_type|item|desc=Returns the type of item specified.}}&lt;br /&gt;
{{Flink|int|item_amount|item}}&lt;br /&gt;
{{Flink|int|closet_amount|item}}&lt;br /&gt;
{{Flink|int|display_amount|item}}&lt;br /&gt;
{{Flink|int|equipped_amount|item}}&lt;br /&gt;
{{Flink|int|shop_amount|item}}&lt;br /&gt;
{{Flink|int|stash_amount|item|}}&lt;br /&gt;
{{Flink|int|storage_amount|item|desc=These 7 functions return the total number available of a given item in the respective section of your inventory.}}&lt;br /&gt;
{{Flink|int|available_amount|item|desc=Returns the total number available of a given item in all inventory sections accessible to your character based on current restrictions.}}&lt;br /&gt;
{{Flink|int|creatable_amount|item|desc=Returns the amount of the item that you are capable of creating given your current inventory and skills.}}&lt;br /&gt;
{{Flink|int [item]|get_ingredients|item|desc=Returns a map where each key is one of the required ingredients, with the integer value the number required. If you don&#039;t have the skills needed to make the item, it will return an empty map.}}&lt;br /&gt;
{{Flink|int [item]|get_inventory|desc=Returns a map where each key is an item in your inventory, with the integer value its quantity.}}&lt;br /&gt;
{{Flink|int [item]|get_related|item|string|desc=Returns associated items in a zap or fold group (see page for details).}}&lt;br /&gt;
[[File:Item category.png|frame|You can categorize items in KoL using [[is tradeable|is_tradeable()]], [[is giftable|is_giftable()]], and [[is displayable|is_displayable()]].]]&lt;br /&gt;
{{Flink|boolean|is_tradeable|item|desc=Returns whether the item can be placed in the mall.}}&lt;br /&gt;
{{Flink|boolean|is_giftable|item|desc=Returns whether the item can be traded in a gift package.}}&lt;br /&gt;
{{Flink|boolean|is_displayable|item|desc=Returns whether the item can be put in a display case (true for all but quest items).}}&lt;br /&gt;
{{Flink|boolean|have_shop|desc=Returns whether you have a mall store.}}&lt;br /&gt;
{{Flink|boolean|have_display|desc=Returns whether you have a display case.}}&lt;br /&gt;
{{Flink|boolean|is_npc_item|item|desc=Returns whether the item can be bought from an NPC store.}}&lt;br /&gt;
{{Flink|void|refresh_stash|desc=Takes a new look at the contents of your clan stash, as that section of inventory cannot be internally tracked due to access by others.}}&lt;br /&gt;
{{Flink|boolean|mall_price|item|desc=Returns the current (lowest) mall price of the given item.}}&lt;br /&gt;
{{Flink|int|historical_price|item|desc=Returns the most recently checked price for an item. This will never hit the server, unlike mall_price().}}&lt;br /&gt;
{{Flink|float|historical_age|item|desc=Returns the age of the most recently checked price for an item in days. This allows you to decide if you want to use historical_price() or mall_price().}}&lt;br /&gt;
{{Flink|int|autosell_price|item|desc=Returns the autosell price of the item (0 for items that cannot be autosold).}}&lt;br /&gt;
{{Flink|int|get_power|item|desc=Returns the power of the item (0 for items that don&#039;t have a power).}}&lt;br /&gt;
{{Flink|string|to_plural|item|desc=Returns the plural of an item as a string.}}&lt;br /&gt;
{{Flink|int|meat_drop|{{opt|monster}}|desc=Returns a certain monster&#039;s base meat drop.}}&lt;br /&gt;
{{Flink|int [item]|item_drops|{{opt|monster}}|desc=Returns an array of a certain monster&#039;s base item drops, keying item to drop rate. Has certain limitations detailed on individual page.}}&lt;br /&gt;
{{Flink|record [int]|item_drops_array|{{opt|monster}}|desc=Returns an array of records holding information regarding a certain monster&#039;s base item drops.}}&lt;br /&gt;
&lt;br /&gt;
==Moving Items Around==&lt;br /&gt;
{{Flink|boolean|put_closet|int|{{opt|item}}}}&lt;br /&gt;
{{Flink|boolean|put_display|int|item}}&lt;br /&gt;
{{Flink|boolean|put_stash|int|item}}&lt;br /&gt;
{{Flink|boolean|take_closet|int|{{opt|item}}}}&lt;br /&gt;
{{Flink|boolean|take_display|int|item}}&lt;br /&gt;
{{Flink|boolean|take_stash|int|item}}&lt;br /&gt;
{{Flink|boolean|take_storage|int|item|desc=Attempts to take or put the specified item in the appropriate section of your inventory, and returns its success.&amp;lt;br /&amp;gt;If the item parameter is omitted from put_closet() or take_closet(), meat is transferred instead of an item.}}&lt;br /&gt;
{{Flink|boolean|put_shop|int|int|{{opt|int}}|item|desc=Puts items in your store (see page for details).}}&lt;br /&gt;
&lt;br /&gt;
==Acquiring &amp;amp; Using Items==&lt;br /&gt;
{{Flink|boolean|retrieve_item|int|item|desc=Uses KoLmafia internal logic to gather items (see page for details).}}&lt;br /&gt;
{{Flink|boolean|hermit|int|item|desc=Trades worthless items (adventuring in the sewer if needed) to the hermit for specified items (see page for details).}}&lt;br /&gt;
{{Flink|boolean|use|int|item|desc=Attempts to use items as specified and reports success.}}&lt;br /&gt;
{{Flink|boolean|eatsilent|int|item}}&lt;br /&gt;
{{Flink|boolean|eat|int|item|desc=Attempts to eat items as specified and reports success.}}&lt;br /&gt;
{{Flink|boolean|overdrink|int|item}}&lt;br /&gt;
{{Flink|boolean|drink|int|item|desc=Attempts to drink items as specified and reports success.}}&lt;br /&gt;
{{Flink|boolean|create|int|item|desc=Attempts to create the specified items, following your KoLmafia settings regarding purchases to gather ingredients &amp;amp; require boxen.}}&lt;br /&gt;
{{Flink|boolean|buy|int|item}}&lt;br /&gt;
{{Flink|int|buy|int|item|int|desc=Tries to purchase the specified items (see page for details).}}&lt;br /&gt;
{{Flink|boolean|autosell|int|item|desc=Attempts to autosell the given items and reports success.}}&lt;br /&gt;
{{Flink|int|craft|string|int|item|item|desc=Raw crafting that obeys KoLmafia settings (see page for details).}}&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Weapon_hands&amp;diff=4970</id>
		<title>Weapon hands</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Weapon_hands&amp;diff=4970"/>
		<updated>2010-09-12T10:18:27Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: This function returns 3 for 3-handed weapons as of r8607.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|weapon_hands}}{{&lt;br /&gt;
#vardefine:return_type|int}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|item|check_me}}|&lt;br /&gt;
p1desc={{Pspan|check_me}} is the item to check|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the number of hands required for a weapon. Everything else, including off-hand items, returns 0. Note that while weapons jokingly labeled as &amp;quot;3-handed&amp;quot; in KoL are actually 2-handed in reality, this function will return 3.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|weapon_type}}|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Equipment]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=CCS&amp;diff=7144</id>
		<title>CCS</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=CCS&amp;diff=7144"/>
		<updated>2010-09-05T08:01:44Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Redirected page to Custom Combat Script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Custom Combat Script]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6219</id>
		<title>ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6219"/>
		<updated>2010-08-26T03:18:34Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Map modified within foreach */ More typos found. Sorry about that.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Errors happen. When they do, it helps to have some idea of what what wrong.&lt;br /&gt;
&lt;br /&gt;
===Abort===&lt;br /&gt;
&lt;br /&gt;
Whenever a script runs the [[abort|abort()]] function, this error is generated.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The zero-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;KoLmafia declares world peace.&amp;lt;/span&amp;gt; Note that this message may also appear as a result of pressing Esc in the Main Interface or hitting &amp;quot;stop now&amp;quot; in the Adventure tab.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The one-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort(&amp;quot;Aborting script...&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Aborting script...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot initialize parameter [parameter]===&lt;br /&gt;
&lt;br /&gt;
This error is created when an assignment is attempted inside a function declaration.&lt;br /&gt;
The following code results in an error.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* test.ash */&lt;br /&gt;
&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will halt the script and print: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Cannot initialize parameter myvar (test.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot return [datatype] from [datatype] function===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value does not match the function&#039;s type.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff(){&lt;br /&gt;
   return &amp;quot;4&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return string value from int function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Similarly, for void functions:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff(){&lt;br /&gt;
   return 4;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return a value from a void function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encountered &#039;[break|continue]&#039; outside loop===&lt;br /&gt;
&lt;br /&gt;
This indicates that the control structure in question was not in a loop.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Encountered &#039;continue&#039; outside of loop (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem (missing ending semi-colon, unmatched braces, unmatched parenthesis etc...).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int a = 1&lt;br /&gt;
print(a);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Expected ;, found print (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function defined multiple times===&lt;br /&gt;
&lt;br /&gt;
This indicates that the function in question has already been defined.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    return a*((a&amp;gt;0).to_int()*2 - 1);&lt;br /&gt;
}&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    if(a&amp;lt;0) a = -a;&lt;br /&gt;
    return a;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Function &amp;lt;nowiki&amp;gt;&#039;abs( int )&#039;&amp;lt;/nowiki&amp;gt; defined multiple times (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;if&amp;quot; requires a boolean conditional expression ===&lt;br /&gt;
&lt;br /&gt;
This indicates that the condition inside an if statement is not a boolean.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(42) {&lt;br /&gt;
   print(&amp;quot;Don&#039;t panic.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;quot;if&amp;quot; requires a boolean conditional expression (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Index type is not a primitive type===&lt;br /&gt;
&lt;br /&gt;
This indicates that the map&#039;s index is not a standard datatype (float, int, string, etc.).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record alpha{&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
int[alpha] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Index type &#039;alpha&#039; is not a primitive type (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid field name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record does not contain the field in question.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
my_record [int] my_map;&lt;br /&gt;
my_map[1].c = &amp;quot;hello&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;c&#039; (test.ash, line 7)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this error may also be encountered when neglecting to name a field.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description= For instance:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;;&#039; (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid type name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the specified type is not recognized by Mafia.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int[fruit] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid type name &#039;fruit&#039; (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Main method must appear at top level===&lt;br /&gt;
&lt;br /&gt;
This indicates that the script&#039;s main method is inside another method, for some reason. This is usually caused by a missing brace.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff() {&lt;br /&gt;
   // stuff happens here&lt;br /&gt;
&lt;br /&gt;
void main() {&lt;br /&gt;
   stuff();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;main method must appear at top level (test.ash, line 6)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Map modified within foreach===&lt;br /&gt;
&lt;br /&gt;
You cannot add new entries into a map within a &amp;lt;code&amp;gt;[[foreach]]&amp;lt;/code&amp;gt; loop. This can happen if you accidentally wrap the name of a string variable with double-quotes for referencing a map entry.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, the following code:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* test.ash */&lt;br /&gt;
item [string] my_map;&lt;br /&gt;
/* Populate my_map with several entries */&lt;br /&gt;
foreach str in my_map&lt;br /&gt;
   print( str + &amp;quot; =&amp;gt; &amp;quot; + my_map[ &amp;quot;str&amp;quot; ] );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Yields: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Map modified within foreach (test.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Missing return value===&lt;br /&gt;
&lt;br /&gt;
The last line of a user-defined function has to be &amp;quot;return &amp;lt;value&amp;gt;;&amp;quot; (although the [[Control_Structures#return|return]] command can be used before too).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int my_function( int a, int b ) {	&lt;br /&gt;
    if ( a &amp;gt; b ) return a ;&lt;br /&gt;
    else return b ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Missing return value (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===No closing found===&lt;br /&gt;
&lt;br /&gt;
This can be caused by forgetting to put a &#039;&#039;&#039;&amp;quot;&#039;&#039;&#039; or a &#039;&#039;&#039;]&#039;&#039;&#039; at the end of an argument&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
buy(1000 , $item[disco ball, 225);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;No closing ] found (testing.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record expected===&lt;br /&gt;
&lt;br /&gt;
This indicates that an unrecognized record was found. This often appears when you forget to append &amp;quot;()&amp;quot; to a function name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(4.to_string);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record expected (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record name is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record name has already been defined, and so cannot be reused. The solution is to change the record name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record str {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
record str {&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record name &#039;str&#039; is already defined (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Return needs [datatype] value===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value is void when the function is not.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff() {&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Return needs int value (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reserved word cannot be a [function|record|variable] name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the desired name has been [[Reserved Words|reserved]], and so cannot be used. The solution is to use a different name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int float(float a) {&lt;br /&gt;
   return round(a);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;float&#039; cannot be used as a function name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interesting point to note is that ASH functions take precedent over identically named custom functions rather than throw an exception.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid record name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record string {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;string&#039; cannot be a record name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid variable name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string item = &amp;quot;bottle of gin&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;item&#039; cannot be a variable name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Script parsing error===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem, as in having an excess amount of braces or a variable/function/record name that starts with an invalid character.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
put_shop(0 ,0 ,$item[wolf mask]);&lt;br /&gt;
put_shop(0 ,0 ,$item[rave whistle]);&lt;br /&gt;
put_shop(0 ,0 ,$item[giant needle]);&lt;br /&gt;
cli_execute (&amp;quot;undercut&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Script parsing error (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Variable is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the same variable has been declared twice.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int Drops ;&lt;br /&gt;
int Meat ;&lt;br /&gt;
int Drops = numeric_modifier(&amp;quot;Item Drop&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Variable Drops is already defined (test.ash, line 3)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{RFI|Obviously, a lot more info is needed here.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6218</id>
		<title>ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6218"/>
		<updated>2010-08-26T03:17:41Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Map modified within foreach */ Gah, typo fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Errors happen. When they do, it helps to have some idea of what what wrong.&lt;br /&gt;
&lt;br /&gt;
===Abort===&lt;br /&gt;
&lt;br /&gt;
Whenever a script runs the [[abort|abort()]] function, this error is generated.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The zero-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;KoLmafia declares world peace.&amp;lt;/span&amp;gt; Note that this message may also appear as a result of pressing Esc in the Main Interface or hitting &amp;quot;stop now&amp;quot; in the Adventure tab.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The one-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort(&amp;quot;Aborting script...&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Aborting script...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot initialize parameter [parameter]===&lt;br /&gt;
&lt;br /&gt;
This error is created when an assignment is attempted inside a function declaration.&lt;br /&gt;
The following code results in an error.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* test.ash */&lt;br /&gt;
&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will halt the script and print: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Cannot initialize parameter myvar (test.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot return [datatype] from [datatype] function===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value does not match the function&#039;s type.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff(){&lt;br /&gt;
   return &amp;quot;4&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return string value from int function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Similarly, for void functions:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff(){&lt;br /&gt;
   return 4;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return a value from a void function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encountered &#039;[break|continue]&#039; outside loop===&lt;br /&gt;
&lt;br /&gt;
This indicates that the control structure in question was not in a loop.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Encountered &#039;continue&#039; outside of loop (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem (missing ending semi-colon, unmatched braces, unmatched parenthesis etc...).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int a = 1&lt;br /&gt;
print(a);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Expected ;, found print (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function defined multiple times===&lt;br /&gt;
&lt;br /&gt;
This indicates that the function in question has already been defined.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    return a*((a&amp;gt;0).to_int()*2 - 1);&lt;br /&gt;
}&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    if(a&amp;lt;0) a = -a;&lt;br /&gt;
    return a;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Function &amp;lt;nowiki&amp;gt;&#039;abs( int )&#039;&amp;lt;/nowiki&amp;gt; defined multiple times (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;if&amp;quot; requires a boolean conditional expression ===&lt;br /&gt;
&lt;br /&gt;
This indicates that the condition inside an if statement is not a boolean.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(42) {&lt;br /&gt;
   print(&amp;quot;Don&#039;t panic.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;quot;if&amp;quot; requires a boolean conditional expression (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Index type is not a primitive type===&lt;br /&gt;
&lt;br /&gt;
This indicates that the map&#039;s index is not a standard datatype (float, int, string, etc.).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record alpha{&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
int[alpha] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Index type &#039;alpha&#039; is not a primitive type (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid field name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record does not contain the field in question.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
my_record [int] my_map;&lt;br /&gt;
my_map[1].c = &amp;quot;hello&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;c&#039; (test.ash, line 7)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this error may also be encountered when neglecting to name a field.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description= For instance:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;;&#039; (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid type name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the specified type is not recognized by Mafia.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int[fruit] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid type name &#039;fruit&#039; (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Main method must appear at top level===&lt;br /&gt;
&lt;br /&gt;
This indicates that the script&#039;s main method is inside another method, for some reason. This is usually caused by a missing brace.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff() {&lt;br /&gt;
   // stuff happens here&lt;br /&gt;
&lt;br /&gt;
void main() {&lt;br /&gt;
   stuff();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;main method must appear at top level (test.ash, line 6)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Map modified within foreach===&lt;br /&gt;
&lt;br /&gt;
You cannot add new entries into a map within a &amp;lt;code&amp;gt;[[foreach]]&amp;lt;/code&amp;gt; loop. This can happen if you accidentally wrap the name of a string variable with double-quotes for referencing a map entry.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, the following code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item [string] my_map;&lt;br /&gt;
/* Populate my_map with several entries */&lt;br /&gt;
foreach str in my_map&lt;br /&gt;
   print( str + &amp;quot; =&amp;gt; &amp;quot; + my_map[ &amp;quot;str&amp;quot; ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Yields: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Map modified within foreach (filename.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Missing return value===&lt;br /&gt;
&lt;br /&gt;
The last line of a user-defined function has to be &amp;quot;return &amp;lt;value&amp;gt;;&amp;quot; (although the [[Control_Structures#return|return]] command can be used before too).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int my_function( int a, int b ) {	&lt;br /&gt;
    if ( a &amp;gt; b ) return a ;&lt;br /&gt;
    else return b ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Missing return value (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===No closing found===&lt;br /&gt;
&lt;br /&gt;
This can be caused by forgetting to put a &#039;&#039;&#039;&amp;quot;&#039;&#039;&#039; or a &#039;&#039;&#039;]&#039;&#039;&#039; at the end of an argument&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
buy(1000 , $item[disco ball, 225);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;No closing ] found (testing.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record expected===&lt;br /&gt;
&lt;br /&gt;
This indicates that an unrecognized record was found. This often appears when you forget to append &amp;quot;()&amp;quot; to a function name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(4.to_string);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record expected (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record name is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record name has already been defined, and so cannot be reused. The solution is to change the record name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record str {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
record str {&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record name &#039;str&#039; is already defined (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Return needs [datatype] value===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value is void when the function is not.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff() {&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Return needs int value (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reserved word cannot be a [function|record|variable] name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the desired name has been [[Reserved Words|reserved]], and so cannot be used. The solution is to use a different name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int float(float a) {&lt;br /&gt;
   return round(a);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;float&#039; cannot be used as a function name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interesting point to note is that ASH functions take precedent over identically named custom functions rather than throw an exception.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid record name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record string {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;string&#039; cannot be a record name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid variable name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string item = &amp;quot;bottle of gin&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;item&#039; cannot be a variable name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Script parsing error===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem, as in having an excess amount of braces or a variable/function/record name that starts with an invalid character.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
put_shop(0 ,0 ,$item[wolf mask]);&lt;br /&gt;
put_shop(0 ,0 ,$item[rave whistle]);&lt;br /&gt;
put_shop(0 ,0 ,$item[giant needle]);&lt;br /&gt;
cli_execute (&amp;quot;undercut&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Script parsing error (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Variable is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the same variable has been declared twice.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int Drops ;&lt;br /&gt;
int Meat ;&lt;br /&gt;
int Drops = numeric_modifier(&amp;quot;Item Drop&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Variable Drops is already defined (test.ash, line 3)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{RFI|Obviously, a lot more info is needed here.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6217</id>
		<title>ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6217"/>
		<updated>2010-08-26T03:17:15Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added &amp;quot;map modified within foreach&amp;quot; -- needs more testing, though.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Errors happen. When they do, it helps to have some idea of what what wrong.&lt;br /&gt;
&lt;br /&gt;
===Abort===&lt;br /&gt;
&lt;br /&gt;
Whenever a script runs the [[abort|abort()]] function, this error is generated.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The zero-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;KoLmafia declares world peace.&amp;lt;/span&amp;gt; Note that this message may also appear as a result of pressing Esc in the Main Interface or hitting &amp;quot;stop now&amp;quot; in the Adventure tab.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The one-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort(&amp;quot;Aborting script...&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Aborting script...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot initialize parameter [parameter]===&lt;br /&gt;
&lt;br /&gt;
This error is created when an assignment is attempted inside a function declaration.&lt;br /&gt;
The following code results in an error.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* test.ash */&lt;br /&gt;
&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will halt the script and print: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Cannot initialize parameter myvar (test.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot return [datatype] from [datatype] function===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value does not match the function&#039;s type.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff(){&lt;br /&gt;
   return &amp;quot;4&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return string value from int function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Similarly, for void functions:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff(){&lt;br /&gt;
   return 4;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return a value from a void function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encountered &#039;[break|continue]&#039; outside loop===&lt;br /&gt;
&lt;br /&gt;
This indicates that the control structure in question was not in a loop.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Encountered &#039;continue&#039; outside of loop (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem (missing ending semi-colon, unmatched braces, unmatched parenthesis etc...).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int a = 1&lt;br /&gt;
print(a);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Expected ;, found print (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function defined multiple times===&lt;br /&gt;
&lt;br /&gt;
This indicates that the function in question has already been defined.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    return a*((a&amp;gt;0).to_int()*2 - 1);&lt;br /&gt;
}&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    if(a&amp;lt;0) a = -a;&lt;br /&gt;
    return a;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Function &amp;lt;nowiki&amp;gt;&#039;abs( int )&#039;&amp;lt;/nowiki&amp;gt; defined multiple times (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;if&amp;quot; requires a boolean conditional expression ===&lt;br /&gt;
&lt;br /&gt;
This indicates that the condition inside an if statement is not a boolean.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(42) {&lt;br /&gt;
   print(&amp;quot;Don&#039;t panic.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;quot;if&amp;quot; requires a boolean conditional expression (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Index type is not a primitive type===&lt;br /&gt;
&lt;br /&gt;
This indicates that the map&#039;s index is not a standard datatype (float, int, string, etc.).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record alpha{&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
int[alpha] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Index type &#039;alpha&#039; is not a primitive type (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid field name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record does not contain the field in question.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
my_record [int] my_map;&lt;br /&gt;
my_map[1].c = &amp;quot;hello&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;c&#039; (test.ash, line 7)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this error may also be encountered when neglecting to name a field.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description= For instance:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;;&#039; (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid type name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the specified type is not recognized by Mafia.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int[fruit] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid type name &#039;fruit&#039; (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Main method must appear at top level===&lt;br /&gt;
&lt;br /&gt;
This indicates that the script&#039;s main method is inside another method, for some reason. This is usually caused by a missing brace.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff() {&lt;br /&gt;
   // stuff happens here&lt;br /&gt;
&lt;br /&gt;
void main() {&lt;br /&gt;
   stuff();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;main method must appear at top level (test.ash, line 6)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Map modified within foreach===&lt;br /&gt;
&lt;br /&gt;
You cannot add new entries into a map within a &amp;lt;code&amp;gt;[[foreach]]&amp;lt;/code&amp;gt; loop. This can happen if you accidentally wrap the name of a string variable with double-quotes for referencing a map entry.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, the following code&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item [string] my_map;&lt;br /&gt;
/* Populate my_map with several entries */&lt;br /&gt;
foreach str in my_map&lt;br /&gt;
   print( str + &amp;quot; =&amp;gt; &amp;quot; + my_map[ &amp;quot;str&amp;quot; ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Yields: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Map modified within foreach (filename.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Missing return value===&lt;br /&gt;
&lt;br /&gt;
The last line of a user-defined function has to be &amp;quot;return &amp;lt;value&amp;gt;;&amp;quot; (although the [[Control_Structures#return|return]] command can be used before too).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int my_function( int a, int b ) {	&lt;br /&gt;
    if ( a &amp;gt; b ) return a ;&lt;br /&gt;
    else return b ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Missing return value (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===No closing found===&lt;br /&gt;
&lt;br /&gt;
This can be caused by forgetting to put a &#039;&#039;&#039;&amp;quot;&#039;&#039;&#039; or a &#039;&#039;&#039;]&#039;&#039;&#039; at the end of an argument&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
buy(1000 , $item[disco ball, 225);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;No closing ] found (testing.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record expected===&lt;br /&gt;
&lt;br /&gt;
This indicates that an unrecognized record was found. This often appears when you forget to append &amp;quot;()&amp;quot; to a function name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(4.to_string);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record expected (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record name is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record name has already been defined, and so cannot be reused. The solution is to change the record name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record str {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
record str {&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record name &#039;str&#039; is already defined (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Return needs [datatype] value===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value is void when the function is not.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff() {&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Return needs int value (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reserved word cannot be a [function|record|variable] name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the desired name has been [[Reserved Words|reserved]], and so cannot be used. The solution is to use a different name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int float(float a) {&lt;br /&gt;
   return round(a);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;float&#039; cannot be used as a function name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interesting point to note is that ASH functions take precedent over identically named custom functions rather than throw an exception.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid record name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record string {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;string&#039; cannot be a record name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid variable name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string item = &amp;quot;bottle of gin&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;item&#039; cannot be a variable name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Script parsing error===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem, as in having an excess amount of braces or a variable/function/record name that starts with an invalid character.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
put_shop(0 ,0 ,$item[wolf mask]);&lt;br /&gt;
put_shop(0 ,0 ,$item[rave whistle]);&lt;br /&gt;
put_shop(0 ,0 ,$item[giant needle]);&lt;br /&gt;
cli_execute (&amp;quot;undercut&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Script parsing error (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Variable is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the same variable has been declared twice.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int Drops ;&lt;br /&gt;
int Meat ;&lt;br /&gt;
int Drops = numeric_modifier(&amp;quot;Item Drop&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Variable Drops is already defined (test.ash, line 3)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{RFI|Obviously, a lot more info is needed here.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6216</id>
		<title>ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_Errors&amp;diff=6216"/>
		<updated>2010-08-26T03:08:15Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added &amp;quot;cannot initialize parameter...&amp;quot; (finally!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Errors happen. When they do, it helps to have some idea of what what wrong.&lt;br /&gt;
&lt;br /&gt;
===Abort===&lt;br /&gt;
&lt;br /&gt;
Whenever a script runs the [[abort|abort()]] function, this error is generated.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The zero-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;KoLmafia declares world peace.&amp;lt;/span&amp;gt; Note that this message may also appear as a result of pressing Esc in the Main Interface or hitting &amp;quot;stop now&amp;quot; in the Adventure tab.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=The one-parameter form:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
abort(&amp;quot;Aborting script...&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will stop the execution and print: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Aborting script...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot initialize parameter [parameter]====&lt;br /&gt;
&lt;br /&gt;
This error is created when an assignment is attempted inside a function declaration.&lt;br /&gt;
The following code results in an error.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
/* test.ash */&lt;br /&gt;
&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
will halt the script and print: &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;Cannot initialize parameter myvar (test.ash, line X)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Cannot return [datatype] from [datatype] function===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value does not match the function&#039;s type.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff(){&lt;br /&gt;
   return &amp;quot;4&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return string value from int function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Similarly, for void functions:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff(){&lt;br /&gt;
   return 4;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Cannot return a value from a void function (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Encountered &#039;[break|continue]&#039; outside loop===&lt;br /&gt;
&lt;br /&gt;
This indicates that the control structure in question was not in a loop.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
continue;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Encountered &#039;continue&#039; outside of loop (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem (missing ending semi-colon, unmatched braces, unmatched parenthesis etc...).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int a = 1&lt;br /&gt;
print(a);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Expected ;, found print (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Function defined multiple times===&lt;br /&gt;
&lt;br /&gt;
This indicates that the function in question has already been defined.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    return a*((a&amp;gt;0).to_int()*2 - 1);&lt;br /&gt;
}&lt;br /&gt;
int abs(int a){&lt;br /&gt;
    if(a&amp;lt;0) a = -a;&lt;br /&gt;
    return a;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Function &amp;lt;nowiki&amp;gt;&#039;abs( int )&#039;&amp;lt;/nowiki&amp;gt; defined multiple times (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;if&amp;quot; requires a boolean conditional expression ===&lt;br /&gt;
&lt;br /&gt;
This indicates that the condition inside an if statement is not a boolean.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if(42) {&lt;br /&gt;
   print(&amp;quot;Don&#039;t panic.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;quot;if&amp;quot; requires a boolean conditional expression (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Index type is not a primitive type===&lt;br /&gt;
&lt;br /&gt;
This indicates that the map&#039;s index is not a standard datatype (float, int, string, etc.).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record alpha{&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
int[alpha] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Index type &#039;alpha&#039; is not a primitive type (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid field name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record does not contain the field in question.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
my_record [int] my_map;&lt;br /&gt;
my_map[1].c = &amp;quot;hello&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;c&#039; (test.ash, line 7)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this error may also be encountered when neglecting to name a field.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description= For instance:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record my_record {&lt;br /&gt;
   string;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid field name &#039;;&#039; (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Invalid type name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the specified type is not recognized by Mafia.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int[fruit] map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Invalid type name &#039;fruit&#039; (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Main method must appear at top level===&lt;br /&gt;
&lt;br /&gt;
This indicates that the script&#039;s main method is inside another method, for some reason. This is usually caused by a missing brace.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void stuff() {&lt;br /&gt;
   // stuff happens here&lt;br /&gt;
&lt;br /&gt;
void main() {&lt;br /&gt;
   stuff();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;main method must appear at top level (test.ash, line 6)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Missing return value===&lt;br /&gt;
&lt;br /&gt;
The last line of a user-defined function has to be &amp;quot;return &amp;lt;value&amp;gt;;&amp;quot; (although the [[Control_Structures#return|return]] command can be used before too).&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int my_function( int a, int b ) {	&lt;br /&gt;
    if ( a &amp;gt; b ) return a ;&lt;br /&gt;
    else return b ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Missing return value (test.ash, line 4)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===No closing found===&lt;br /&gt;
&lt;br /&gt;
This can be caused by forgetting to put a &#039;&#039;&#039;&amp;quot;&#039;&#039;&#039; or a &#039;&#039;&#039;]&#039;&#039;&#039; at the end of an argument&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
buy(1000 , $item[disco ball, 225);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;No closing ] found (testing.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record expected===&lt;br /&gt;
&lt;br /&gt;
This indicates that an unrecognized record was found. This often appears when you forget to append &amp;quot;()&amp;quot; to a function name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(4.to_string);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record expected (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Record name is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the record name has already been defined, and so cannot be reused. The solution is to change the record name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record str {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
record str {&lt;br /&gt;
   int a;&lt;br /&gt;
   int b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Record name &#039;str&#039; is already defined (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Return needs [datatype] value===&lt;br /&gt;
&lt;br /&gt;
This indicates that the return value is void when the function is not.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int stuff() {&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Return needs int value (test.ash, line 2)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reserved word cannot be a [function|record|variable] name===&lt;br /&gt;
&lt;br /&gt;
This indicates that the desired name has been [[Reserved Words|reserved]], and so cannot be used. The solution is to use a different name.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int float(float a) {&lt;br /&gt;
   return round(a);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;float&#039; cannot be used as a function name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interesting point to note is that ASH functions take precedent over identically named custom functions rather than throw an exception.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid record name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record string {&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;string&#039; cannot be a record name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=An invalid variable name:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string item = &amp;quot;bottle of gin&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Reserved word &#039;item&#039; cannot be a variable name (test.ash, line 1)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Script parsing error===&lt;br /&gt;
&lt;br /&gt;
This generally indicates a syntax problem, as in having an excess amount of braces or a variable/function/record name that starts with an invalid character.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
put_shop(0 ,0 ,$item[wolf mask]);&lt;br /&gt;
put_shop(0 ,0 ,$item[rave whistle]);&lt;br /&gt;
put_shop(0 ,0 ,$item[giant needle]);&lt;br /&gt;
cli_execute (&amp;quot;undercut&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Script parsing error (test.ash, line 5)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Variable is already defined===&lt;br /&gt;
&lt;br /&gt;
This indicates that the same variable has been declared twice.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=Example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int Drops ;&lt;br /&gt;
int Meat ;&lt;br /&gt;
int Drops = numeric_modifier(&amp;quot;Item Drop&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
will cause this error: &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Variable Drops is already defined (test.ash, line 3)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{RFI|Obviously, a lot more info is needed here.}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Regex&amp;diff=7128</id>
		<title>Regex</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Regex&amp;diff=7128"/>
		<updated>2010-08-26T01:59:30Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Redirected page to Regular Expressions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Regular Expressions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Mall_price&amp;diff=2745</id>
		<title>Mall price</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Mall_price&amp;diff=2745"/>
		<updated>2010-08-26T01:25:23Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: A bit of information about untradeable items.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|mall_price}}{{&lt;br /&gt;
#vardefine:return_type|int}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|item|shop_for}}|&lt;br /&gt;
p1desc={{Pspan|shop_for}} is the item to inquire on the mall price of|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the current mall price of the given item, ignoring the first five items listed to compensate for stores with limits and min-priced sales. This function runs a new check each time it is called, so if you call this function and then purchase some of {{pspan|shop_for}} in the mall, calling this function again will return the new price of the item, again ignoring the first five.|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|historical_price|buy|retrieve_item}}|&lt;br /&gt;
cli_equiv=The CLI command &amp;quot;searchmall&amp;quot; also returns current mall prices.|&lt;br /&gt;
special=Items not listed in the mall will return 0 (untradeable items will return 0 without any server requests). When not logged in, this function returns -1.|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Item Management]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Weapon_type&amp;diff=4978</id>
		<title>Weapon type</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Weapon_type&amp;diff=4978"/>
		<updated>2010-08-23T02:17:49Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: A few tests (Gnollish pie server, eggbeater, etc) tell me that weapons without stat requirements still yield stats based on their type (melee/ranged/mysticality weapon)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|weapon_type}}{{&lt;br /&gt;
#vardefine:return_type|stat}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|item|check_me}}|&lt;br /&gt;
p1desc={{Pspan|check_me}} is the item to check|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Returns the equip requirement stat for {{pspan|check_me}}, even if the weapon does not have any stat requirements. If {{pspan|check_me}} is not a weapon, this function returns $stat[none].|&lt;br /&gt;
&lt;br /&gt;
needscode=yes|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|weapon_hands}}|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Equipment]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Get_version&amp;diff=7027</id>
		<title>Get version</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Get_version&amp;diff=7027"/>
		<updated>2010-07-30T15:03:38Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added another code sample. I&amp;#039;m not sure whether checking for version/revision is the best method of feature detection.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|get_version}}{{&lt;br /&gt;
#vardefine:return_type|string}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}&lt;br /&gt;
}}|&lt;br /&gt;
function_description=Returns the latest version of KoLmafia pertaining to your current build.|&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Will tell you when there is a new version of mafia|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string vers = get_version();&lt;br /&gt;
string page = visit_url(&amp;quot;http://sourceforge.net/projects/kolmafia/files/&amp;quot;);&lt;br /&gt;
string current = substring ( page, index_of ( page , &amp;quot;Download Now&amp;quot; ) , last_index_of ( page , &amp;quot;View all files&amp;quot; ) );&lt;br /&gt;
if (!contains_text( current , vers ))&lt;br /&gt;
   print (&amp;quot;There is a new version. Go get it here http://sourceforge.net/projects/kolmafia/files/&amp;quot;, &amp;quot;red&amp;quot;);&lt;br /&gt;
else&lt;br /&gt;
   print (&amp;quot;You are already using the most current version of KoLmafia.&amp;quot;, &amp;quot;blue&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
code2={{CodeSample|&lt;br /&gt;
description=The following example prompts the user to update KoLmafia so as to handle newly introduced items and locations.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
if ( to_float( get_version() ) &amp;lt; 14.1 ) //Check Vanya&#039;s Castle and Kegger in the Woods&lt;br /&gt;
   abort( &amp;quot;The current version does not support Uncle P&#039;s maps. Please update KoLmafia.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
more_info=Note that a revision is distinct from a build in that a revision is a developer-sanctioned release of enough significance as to be promoted for the general public&#039;s use. When using a daily build, this function returns the most recent official version.|&lt;br /&gt;
see_also={{SeeAlso|get_revision}}|&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6255</id>
		<title>Talk:ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6255"/>
		<updated>2010-07-29T13:17:55Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Thanks for input, but does anyone know whether there exists other forms of code that can cause this error?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this like were things like &amp;lt;font color=&amp;quot;#ff7000&amp;quot;&amp;gt;Script parsing error (X.ash, line Y)&amp;lt;/font&amp;gt; are listed?--[[User:Icon315|Icon315]] 22:33, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It&#039;s where they WILL be listed, once they are listed. --[[User:Bale|Bale]] 22:52, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
What Bale said. Also, I changed that to orange; I kept trying to click on it. :( --[[User:StDoodle|StDoodle (#1059825)]] 00:35, 15 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Also, if anyone&#039;s feeling particularly ambitious, https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java should help. Just look for all the instances of parseException. (Speaking of which, would it be useful if these were presented in the order that they&#039;re checked?) --[[User:Heeheehee|Heeheehee]] 00:17, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think alphabetical order would be better: this page is going to be excellent for first-time ASH scripters to understand what&#039;s wrong with their script. --[[User:Slyz|Slyz]] 10:41, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Should we add the correct examples? Or are the fixes clear enough?&lt;br /&gt;
--[[User:Slyz|Slyz]] 08:36, 18 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
If anything particularly complicated shows, we can give both. But so far, if you can&#039;t follow as written, I&#039;m not sure you ever will. (That&#039;s the hypothetical &amp;quot;you,&amp;quot; not the specific &amp;quot;hey Slyz what&#039;s wrong with you, you&amp;quot;). --[[User:StDoodle|StDoodle (#1059825)]] 23:35, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=The following code results in an error.&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Error message: &amp;lt;blockquote&amp;gt;Cannot initialize parameter myvar (filename.ash, line X)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
I&#039;d like to add this to the article myself, but I&#039;m not sure how to explain its exact nature. Would this message appear only in a situation like the above code? --[[User:PhilmASTErpLus|PhilmASTErpLus]] 09:30, 28 July 2010 (UTC)&lt;br /&gt;
: Looks like a conflict of functionality -- the two ways to initialize a variable are &#039;&#039;&#039;string myvar&#039;&#039;&#039; and &#039;&#039;&#039;string myvar = &amp;quot;value&amp;quot;&#039;&#039;&#039;. The only proper way to define a parameter is the former. So basically you&#039;re defining a parameter, which then gets initialized with a value. This would lead to all sorts of problems, so the parser catches this exception and throws an error. I&#039;m not really sure why anyone would want to do this, but I guess you can add it? (fun fact: the value that you set the parameter to doesn&#039;t actually have to match the datatype for this error to appear) --[[User:Heeheehee|Heeheehee]] 16:47, 28 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I&#039;m guessing he tried it for the same reason I did; in some languages, that&#039;s how you provide a default value for a parameter. It&#039;s usually functionally equivalent to having two different versions of my_function() defined, one which accepts a single string, and one which accepts no parameters, and calls the other with the default value. Usually it isn&#039;t a big deal to do things one way or the other, but the method given above can actually be much simpler if you get into a large number of overloaded versions of a single function. --[[User:StDoodle|StDoodle (#1059825)]] 18:30, 28 July 2010 (UTC)&lt;br /&gt;
: In that case, would this be a reasonable low-priority feature request? --[[User:Heeheehee|Heeheehee]] 18:44, 28 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
That&#039;s up to the devs, but I have a feeling it would be a non-trivial change to get a trivial benefit, and therefore ignored. Unless someone has a good argument for a situation in which it would make a huge difference. --[[User:StDoodle|StDoodle (#1059825)]] 21:08, 28 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=Hardly worth suggesting. The KoLmafia method works just fine:&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void my_function()&lt;br /&gt;
{&lt;br /&gt;
   my_function(&amp;quot;value&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
--[[User:Bale|Bale]] 04:31, 29 July 2010 (UTC)&lt;br /&gt;
:Yeah, when I posted that code, I wasn&#039;t thinking about requesting for a default parameter feature. All I&#039;d like to know is whether there is a general case that will trigger this particular error message; for example, I would have expected this instead of &amp;quot;expected ) but got =&amp;quot; message when I tried assignment in the conditional for the &amp;lt;code&amp;gt;if&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;while&amp;lt;/code&amp;gt; statements. --[[User:PhilmASTErpLus|PhilmASTErpLus]] 13:17, 29 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6249</id>
		<title>Talk:ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6249"/>
		<updated>2010-07-28T09:35:14Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this like were things like &amp;lt;font color=&amp;quot;#ff7000&amp;quot;&amp;gt;Script parsing error (X.ash, line Y)&amp;lt;/font&amp;gt; are listed?--[[User:Icon315|Icon315]] 22:33, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It&#039;s where they WILL be listed, once they are listed. --[[User:Bale|Bale]] 22:52, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
What Bale said. Also, I changed that to orange; I kept trying to click on it. :( --[[User:StDoodle|StDoodle (#1059825)]] 00:35, 15 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Also, if anyone&#039;s feeling particularly ambitious, https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java should help. Just look for all the instances of parseException. (Speaking of which, would it be useful if these were presented in the order that they&#039;re checked?) --[[User:Heeheehee|Heeheehee]] 00:17, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think alphabetical order would be better: this page is going to be excellent for first-time ASH scripters to understand what&#039;s wrong with their script. --[[User:Slyz|Slyz]] 10:41, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Should we add the correct examples? Or are the fixes clear enough?&lt;br /&gt;
--[[User:Slyz|Slyz]] 08:36, 18 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
If anything particularly complicated shows, we can give both. But so far, if you can&#039;t follow as written, I&#039;m not sure you ever will. (That&#039;s the hypothetical &amp;quot;you,&amp;quot; not the specific &amp;quot;hey Slyz what&#039;s wrong with you, you&amp;quot;). --[[User:StDoodle|StDoodle (#1059825)]] 23:35, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=The following code results in an error.&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Error message: &amp;lt;blockquote&amp;gt;Cannot initialize parameter myvar (filename.ash, line X)&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
I&#039;d like to add this to the article myself, but I&#039;m not sure how to explain its exact nature. Would this message appear only in a situation like the above code? --[[User:PhilmASTErpLus|PhilmASTErpLus]] 09:30, 28 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6248</id>
		<title>Talk:ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6248"/>
		<updated>2010-07-28T09:31:04Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this like were things like &amp;lt;font color=&amp;quot;#ff7000&amp;quot;&amp;gt;Script parsing error (X.ash, line Y)&amp;lt;/font&amp;gt; are listed?--[[User:Icon315|Icon315]] 22:33, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It&#039;s where they WILL be listed, once they are listed. --[[User:Bale|Bale]] 22:52, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
What Bale said. Also, I changed that to orange; I kept trying to click on it. :( --[[User:StDoodle|StDoodle (#1059825)]] 00:35, 15 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Also, if anyone&#039;s feeling particularly ambitious, https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java should help. Just look for all the instances of parseException. (Speaking of which, would it be useful if these were presented in the order that they&#039;re checked?) --[[User:Heeheehee|Heeheehee]] 00:17, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think alphabetical order would be better: this page is going to be excellent for first-time ASH scripters to understand what&#039;s wrong with their script. --[[User:Slyz|Slyz]] 10:41, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Should we add the correct examples? Or are the fixes clear enough?&lt;br /&gt;
--[[User:Slyz|Slyz]] 08:36, 18 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
If anything particularly complicated shows, we can give both. But so far, if you can&#039;t follow as written, I&#039;m not sure you ever will. (That&#039;s the hypothetical &amp;quot;you,&amp;quot; not the specific &amp;quot;hey Slyz what&#039;s wrong with you, you&amp;quot;). --[[User:StDoodle|StDoodle (#1059825)]] 23:35, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|description=The following code results in an error.&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Error message: &amp;lt;blockquote&amp;gt;Cannot initialize parameter myvar (filename.ash, line X)&amp;lt;/blockquote&amp;gt; --[[User:PhilmASTErpLus|PhilmASTErpLus]] 09:30, 28 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6247</id>
		<title>Talk:ASH Errors</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:ASH_Errors&amp;diff=6247"/>
		<updated>2010-07-28T09:30:08Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Another error message I found.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is this like were things like &amp;lt;font color=&amp;quot;#ff7000&amp;quot;&amp;gt;Script parsing error (X.ash, line Y)&amp;lt;/font&amp;gt; are listed?--[[User:Icon315|Icon315]] 22:33, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It&#039;s where they WILL be listed, once they are listed. --[[User:Bale|Bale]] 22:52, 14 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
What Bale said. Also, I changed that to orange; I kept trying to click on it. :( --[[User:StDoodle|StDoodle (#1059825)]] 00:35, 15 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Also, if anyone&#039;s feeling particularly ambitious, https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java should help. Just look for all the instances of parseException. (Speaking of which, would it be useful if these were presented in the order that they&#039;re checked?) --[[User:Heeheehee|Heeheehee]] 00:17, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
I think alphabetical order would be better: this page is going to be excellent for first-time ASH scripters to understand what&#039;s wrong with their script. --[[User:Slyz|Slyz]] 10:41, 17 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Should we add the correct examples? Or are the fixes clear enough?&lt;br /&gt;
--[[User:Slyz|Slyz]] 08:36, 18 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
If anything particularly complicated shows, we can give both. But so far, if you can&#039;t follow as written, I&#039;m not sure you ever will. (That&#039;s the hypothetical &amp;quot;you,&amp;quot; not the specific &amp;quot;hey Slyz what&#039;s wrong with you, you&amp;quot;). --[[User:StDoodle|StDoodle (#1059825)]] 23:35, 19 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
void my_function( string myvar = &amp;quot;value&amp;quot; )&lt;br /&gt;
{&lt;br /&gt;
   /* Do something */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Results in an error message: &amp;lt;blockquote&amp;gt;Cannot initialize parameter myvar (filename.ash, line X)&amp;lt;/blockquote&amp;gt; --[[User:PhilmASTErpLus|PhilmASTErpLus]] 09:30, 28 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6331</id>
		<title>ASH For Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6331"/>
		<updated>2010-07-27T08:08:54Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Undo revision 9457 by PhilmASTErpLus (Talk) - erm, okay.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==File Editing==&lt;br /&gt;
To create and edit ASH scripts, you need a text editing program that doesn&#039;t automatically add line-breaks for word wrapping.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
While the built in editor TextEdit will work fine (as long as you remember to write only in plaintext), [http://www.barebones.com/products/textwrangler/ TextWrangler] is a much more powerful tool. It may not be designed for ASH scripting specifically, but it was written for a similar purpose.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
If you use Linux, you probably already know about the options available for text editing. Emacs, Vi, etc. are all fine for creating ASH scripts.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Windows users beware; using Microsoft Word to create ASH files will lead to no end of headaches! The built-in program notepad will work, as can wordpad when configured with the option &amp;quot;No Wrap&amp;quot; for text. However, having a program that can handle syntax-highlighting can be very beneficial. Many scripters recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] for ASH (and other programmatic) scripting. In this case, it&#039;s also beneficial to have a style configuration that works well with ASH, and one example can be found [http://kolmafia.us/showthread.php?3164-How-do-you-write-an-ASH-file&amp;amp;p=21567&amp;amp;viewfull=1#post21567 here].&lt;br /&gt;
&lt;br /&gt;
==Saving==&lt;br /&gt;
ASH scripts need to be saved with the file extension &amp;quot;.ash&amp;quot; to be properly recognized by KoLmafia. If you&#039;re using a built-in text editor on a Windows machine, it may automatically save your files with the &amp;quot;.txt&amp;quot; extension by default. (So you may end up with a file called &amp;quot;script.ash.txt&amp;quot; instead of the desired &amp;quot;script.ash&amp;quot;.) One way around this on Windows that usually works is to put quotes around the file name when you save it, including the extension.&lt;br /&gt;
&lt;br /&gt;
Most advanced text editors (such as Notepad++) will save files as specified, without the need for the quotes-trick.&lt;br /&gt;
&lt;br /&gt;
Most files should be saved in the &amp;quot;scripts&amp;quot; directory, which is located by default at the same directory level as the KoLmafia .jar or .exe file on Windows. You can also create a sub-directory under &amp;quot;scripts,&amp;quot; and it will be listed in KoLmafia&#039;s Scripts Menu.&lt;br /&gt;
&lt;br /&gt;
Relay browser scripts are the exception to the rule: they must be saved in the &amp;quot;relay&amp;quot; directory. Relay browser overrides need to be saved in the top level of &amp;quot;relay,&amp;quot; and must be named the same as the page they will override, except with an &amp;quot;.ash&amp;quot; extension. For example, to override &amp;quot;charpane.php&amp;quot; your script would need to be named &amp;quot;charpane.ash&amp;quot;. For user-interface scripts, the script name needs to start with &amp;quot;relay_&amp;quot; and end with &amp;quot;.ash&amp;quot;. These scripts must also be saved in the top-level of the &amp;quot;relay&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Programming==&lt;br /&gt;
You should first read through the various pages listed under &amp;quot;LANGUAGE CONVENTIONS&amp;quot; on the [[Main Page]]. One should also be aware that, with the exception of [[Control Structures]], all ASH commands need to end with a semi-colon.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Variables are used to hold information that you need to access multiple times. They must be declared before they can be used, by specifying the [[Data Types|Data Type]] that they will hold, followed by the variable name.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare a variable named &amp;quot;count&amp;quot; of an integer type. You can also set the initial value of a variable on the same line it is declared.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count = 6;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare the variable &amp;quot;count&amp;quot; again, with an initial value of 6.&lt;br /&gt;
&lt;br /&gt;
Notice that you would not want to have both of the above lines in your script! Variables operate under what&#039;s referred to as their scope. In a nutshell, scope defines where a variables is accessible. Scope &amp;quot;cascades&amp;quot; down, similar to stylesheets for those familiar with web programming. A variable declared at the top-level of a script (a &amp;quot;global&amp;quot; variable), outside of any functions, will be accessible anywhere in your script, or in any other scripts that import it. A variable declared inside of a function will be accessible only inside that function (including inside of control structures), but is considered to not exist by other functions.&lt;br /&gt;
&lt;br /&gt;
Declaring a variable multiple times will generate an [[ASH Errors#Variable is already defined|error]]. Note that this only applies to variable with overlapping scope; if one function uses a variable named &amp;quot;bob&amp;quot; that is declared inside of the function, another function can declare another variable with the same name, even as a different datatype. However, the error will still occur if you have a globally-defined variable, and then declare a variable with the same name inside of a function (as their scopes overlap).&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
Functions are groupings of operations that can be applied multiple times by referencing the function name. Basically, they avoid having to re-type the same code over and over. Many functions are built-in to KoLmafia, and examples can be found all over this wiki. It&#039;s also possible to write your own functions. To do so, you declare them similarly to a variable as above. However, a function can also have the datatype of &amp;quot;void,&amp;quot; which is not allowed for variables. A &amp;quot;void&amp;quot; function is one that does not return any value; it simply does what it&#039;s programmed to do and the rest of your program moves on, regardless of the results (unless of course an [[ASH Errors|error]] occurs, including a call to [[abort|abort()]].)&lt;br /&gt;
{{CodeSample|description=For example, this simple function will double an integer:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int double_it(int value) {&lt;br /&gt;
   return 2 * value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=Furthermore, there are two distinct ways to call functions, user-defined or built-in:&amp;lt;br /&amp;gt;Conventional,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function(param1[,param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=and &amp;quot;Java style&amp;quot;:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
param1.function([param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The only difference between the two forms is aesthetics, as they are functionally equivalent.&lt;br /&gt;
{{CodeSample|description=Also somewhat important to note is that these commands can be chained together, and they will be executed from left-to-right. So, for instance,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;quot;polka pop&amp;quot;.to_item().to_int()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=will return the item number for $item[Polka Pop], 4342. This is one instance where &amp;quot;Java style&amp;quot; is more aesthetically pleasing compared to the conventional|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
to_int(to_item(&amp;quot;polka pop&amp;quot;))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===String Concatenation===&lt;br /&gt;
The basics to string concatenation: &amp;quot;Hello&amp;quot; + &amp;quot;world&amp;quot; yields &amp;quot;Helloworld&amp;quot;. Likewise, variables can be strung together in this fashion. Unless the variables are both numbers (floats, booleans, or ints), they will be converted to strings, then concatenated.&lt;br /&gt;
Argh, me tired, finish later.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6330</id>
		<title>ASH For Beginners</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=ASH_For_Beginners&amp;diff=6330"/>
		<updated>2010-07-27T04:20:07Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Programming */ Rather blunt information on references.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==File Editing==&lt;br /&gt;
To create and edit ASH scripts, you need a text editing program that doesn&#039;t automatically add line-breaks for word wrapping.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
While the built in editor TextEdit will work fine (as long as you remember to write only in plaintext), [http://www.barebones.com/products/textwrangler/ TextWrangler] is a much more powerful tool. It may not be designed for ASH scripting specifically, but it was written for a similar purpose.&lt;br /&gt;
&lt;br /&gt;
===Linux===&lt;br /&gt;
If you use Linux, you probably already know about the options available for text editing. Emacs, Vi, etc. are all fine for creating ASH scripts.&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
Windows users beware; using Microsoft Word to create ASH files will lead to no end of headaches! The built-in program notepad will work, as can wordpad when configured with the option &amp;quot;No Wrap&amp;quot; for text. However, having a program that can handle syntax-highlighting can be very beneficial. Many scripters recommend [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++] for ASH (and other programmatic) scripting. In this case, it&#039;s also beneficial to have a style configuration that works well with ASH, and one example can be found [http://kolmafia.us/showthread.php?3164-How-do-you-write-an-ASH-file&amp;amp;p=21567&amp;amp;viewfull=1#post21567 here].&lt;br /&gt;
&lt;br /&gt;
==Saving==&lt;br /&gt;
ASH scripts need to be saved with the file extension &amp;quot;.ash&amp;quot; to be properly recognized by KoLmafia. If you&#039;re using a built-in text editor on a Windows machine, it may automatically save your files with the &amp;quot;.txt&amp;quot; extension by default. (So you may end up with a file called &amp;quot;script.ash.txt&amp;quot; instead of the desired &amp;quot;script.ash&amp;quot;.) One way around this on Windows that usually works is to put quotes around the file name when you save it, including the extension.&lt;br /&gt;
&lt;br /&gt;
Most advanced text editors (such as Notepad++) will save files as specified, without the need for the quotes-trick.&lt;br /&gt;
&lt;br /&gt;
Most files should be saved in the &amp;quot;scripts&amp;quot; directory, which is located by default at the same directory level as the KoLmafia .jar or .exe file on Windows. You can also create a sub-directory under &amp;quot;scripts,&amp;quot; and it will be listed in KoLmafia&#039;s Scripts Menu.&lt;br /&gt;
&lt;br /&gt;
Relay browser scripts are the exception to the rule: they must be saved in the &amp;quot;relay&amp;quot; directory. Relay browser overrides need to be saved in the top level of &amp;quot;relay,&amp;quot; and must be named the same as the page they will override, except with an &amp;quot;.ash&amp;quot; extension. For example, to override &amp;quot;charpane.php&amp;quot; your script would need to be named &amp;quot;charpane.ash&amp;quot;. For user-interface scripts, the script name needs to start with &amp;quot;relay_&amp;quot; and end with &amp;quot;.ash&amp;quot;. These scripts must also be saved in the top-level of the &amp;quot;relay&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
==Programming==&lt;br /&gt;
You should first read through the various pages listed under &amp;quot;LANGUAGE CONVENTIONS&amp;quot; on the [[Main Page]]. One should also be aware that, with the exception of [[Control Structures]], all ASH commands need to end with a semi-colon.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
Variables are used to hold information that you need to access multiple times. They must be declared before they can be used, by specifying the [[Data Types|Data Type]] that they will hold, followed by the variable name.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare a variable named &amp;quot;count&amp;quot; of an integer type. You can also set the initial value of a variable on the same line it is declared.&lt;br /&gt;
{{CodeSample|description=For example:|code=&amp;lt;syntaxhighlight&amp;gt;int count = 6;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
would declare the variable &amp;quot;count&amp;quot; again, with an initial value of 6.&lt;br /&gt;
&lt;br /&gt;
Notice that you would not want to have both of the above lines in your script! Variables operate under what&#039;s referred to as their scope. In a nutshell, scope defines where a variables is accessible. Scope &amp;quot;cascades&amp;quot; down, similar to stylesheets for those familiar with web programming. A variable declared at the top-level of a script (a &amp;quot;global&amp;quot; variable), outside of any functions, will be accessible anywhere in your script, or in any other scripts that import it. A variable declared inside of a function will be accessible only inside that function (including inside of control structures), but is considered to not exist by other functions.&lt;br /&gt;
&lt;br /&gt;
Declaring a variable multiple times will generate an [[ASH Errors#Variable is already defined|error]]. Note that this only applies to variable with overlapping scope; if one function uses a variable named &amp;quot;bob&amp;quot; that is declared inside of the function, another function can declare another variable with the same name, even as a different datatype. However, the error will still occur if you have a globally-defined variable, and then declare a variable with the same name inside of a function (as their scopes overlap).&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
Functions are groupings of operations that can be applied multiple times by referencing the function name. Basically, they avoid having to re-type the same code over and over. Many functions are built-in to KoLmafia, and examples can be found all over this wiki. It&#039;s also possible to write your own functions. To do so, you declare them similarly to a variable as above. However, a function can also have the datatype of &amp;quot;void,&amp;quot; which is not allowed for variables. A &amp;quot;void&amp;quot; function is one that does not return any value; it simply does what it&#039;s programmed to do and the rest of your program moves on, regardless of the results (unless of course an [[ASH Errors|error]] occurs, including a call to [[abort|abort()]].)&lt;br /&gt;
{{CodeSample|description=For example, this simple function will double an integer:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int double_it(int value) {&lt;br /&gt;
   return 2 * value;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=Furthermore, there are two distinct ways to call functions, user-defined or built-in:&amp;lt;br /&amp;gt;Conventional,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
function(param1[,param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=and &amp;quot;Java style&amp;quot;:|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
param1.function([param2,param3,...]);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The only difference between the two forms is aesthetics, as they are functionally equivalent.&lt;br /&gt;
{{CodeSample|description=Also somewhat important to note is that these commands can be chained together, and they will be executed from left-to-right. So, for instance,|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;quot;polka pop&amp;quot;.to_item().to_int();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
{{CodeSample|description=will return the item number for $item[Polka Pop], 4342. This is one instance where &amp;quot;Java style&amp;quot; is more aesthetically pleasing compared to the conventional|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
to_int(to_item(&amp;quot;polka pop&amp;quot;));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===String Concatenation===&lt;br /&gt;
The basics to string concatenation: &amp;quot;Hello&amp;quot; + &amp;quot;world&amp;quot; yields &amp;quot;Helloworld&amp;quot;. Likewise, variables can be strung together in this fashion. Unless the variables are both numbers (floats, booleans, or ints), they will be converted to strings, then concatenated.&lt;br /&gt;
Argh, me tired, finish later.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;!-- added by PhilmASTErpLus --&amp;gt;&lt;br /&gt;
Most variables in ASH are called or passed &amp;quot;by value&amp;quot;&amp;amp;mdash;when they are given to other variables, they actually receive a copy of the variable. Such copies are transparently created in these cases:&lt;br /&gt;
*Passing variables as function arguments&lt;br /&gt;
*Returning a variable from a function&lt;br /&gt;
*Assigning a variable with a value.&lt;br /&gt;
However, some variables and data structures are often too large to make copies whenever you want to pass them to functions or assign other variables with their values. In such cases, ASH performs a call or pass &amp;quot;by reference&amp;quot;, and makes the variables/data structures point to the same data in memory.&lt;br /&gt;
{{CodeSample|description=For example, assigning a map to another map will make them access a single map in memory.&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string [int] mymap1 , mymap2;&lt;br /&gt;
file_to_map( &amp;quot;some_file.txt&amp;quot; , mymap1 ); //Fill mymap1 with data&lt;br /&gt;
mymap2 = mymap1; //Now, mymap2 points to mymap1&lt;br /&gt;
&lt;br /&gt;
mymap2[ 12345 ] = &amp;quot;test value&amp;quot;;&lt;br /&gt;
print( mymap1 [12345] ); //Displays: test value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Most [[Data Types|data types]] are passed by value, whereas all aggregates and &amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt;s are passed by reference. Note that &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;s are passed by value; therefore, you should use &amp;lt;code&amp;gt;buffer&amp;lt;/code&amp;gt;s instead when performing many string-related operations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=File_to_map&amp;diff=3069</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=3069"/>
		<updated>2010-07-17T04:46:51Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: The entire contents of the map is wiped before loading new data from the file. Verified with KoLmafia r8532.&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;
&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. Any data originally stored in the {{pspan|map_to_fill}} are wiped before loading the file. 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 delcared, this function will abort (as oppossed to returning false).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;You can also directly load internal data files used by KoLmafia, such as concoctions.txt and fullness.txt, by specifying their name--KoLmafia will automatically load the file for you. For a full list of internal data files used by KoLmafia, see the [http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/data/ KoLmafia source repository].|&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;
}}&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;
{{CodeSample|&lt;br /&gt;
description=The following sample loads the full list of {{kolwiki|Category:Spleentacular Items|spleen-damaging items}} from [http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/data/spleenhit.txt spleenhit.txt].|&lt;br /&gt;
code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int [item] spleen_hits;&lt;br /&gt;
file_to_map( &amp;quot;spleenhit.txt&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
foreach itm, spleen_hit in spleen_hits&lt;br /&gt;
   print( itm + &amp;quot; will damage &amp;quot; + spleen_hit + &amp;quot; of your spleen.&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|map_to_file|}}|&lt;br /&gt;
more_info=You can load any information stored in a data file, as long as your map contains the appropriate [[Data Types]] separated by tabs. Spaces are just considered to be part of a string.&amp;lt;br /&amp;gt;&lt;br /&gt;
Any line that begins with a number sign (&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;) is considered a comment, and is ignored by KoLmafia.|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2729</id>
		<title>Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Print&amp;diff=2729"/>
		<updated>2010-07-17T04:35:11Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added link to W3C CSS color specs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&lt;br /&gt;
#vardefine:name|print}}{{&lt;br /&gt;
#vardefine:return_type|void}}{{&lt;br /&gt;
&lt;br /&gt;
FunctionPage|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
&lt;br /&gt;
function1={{Function|&lt;br /&gt;
name={{#var:name}}|&lt;br /&gt;
aggregate={{#var:aggregate}}|&lt;br /&gt;
return_type={{#var:return_type}}|&lt;br /&gt;
return_also={{#var:return_also}}|&lt;br /&gt;
parameter1={{Param|string|message}}|&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|message}}|&lt;br /&gt;
parameter2={{Param|string|color}}|&lt;br /&gt;
p1desc={{Pspan|message}} is the text to print|&lt;br /&gt;
p2desc={{Pspan|color}} is an html color name or code|&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
function_description=Print the specified text {{pspan|message}} to the CLI. If the optional {{pspan|color}} parameter is specified and a valid html color code or entity, it will print in that color. See the [http://www.w3.org/TR/CSS21/syndata.html#color-units CSS 2.1 color specification] for a description of valid color syntax and keywords.|&lt;br /&gt;
&lt;br /&gt;
code1={{CodeSample|&lt;br /&gt;
title=Code Sample|&lt;br /&gt;
description=Prints stuff in color and black. Note that it prints black twice: first and last.|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
print(&amp;quot;This is black.&amp;quot;);&lt;br /&gt;
foreach color in $strings[blue, green, olive, darkorange, magenta, black]&lt;br /&gt;
   print(&amp;quot;This is &amp;quot;+color+&amp;quot;.&amp;quot;, color);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}|&lt;br /&gt;
&lt;br /&gt;
see_also={{SeeAlso|logprint|print_html}}|&lt;br /&gt;
cli_equiv=The CLI commands &amp;quot;fprint,&amp;quot; &amp;quot;echo&amp;quot; and &amp;quot;fecho&amp;quot; have similar functionality, minus the color option. However, &amp;quot;cecho&amp;quot; (also &amp;quot;colorecho&amp;quot;) does have this option for color.|&lt;br /&gt;
special= Using an invalid color name or code can cause odd colors to be chosen; see the [[Talk:Print|Talk Page]] for details.|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Miscellaneous Functions]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Print&amp;diff=5241</id>
		<title>Talk:Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Print&amp;diff=5241"/>
		<updated>2010-07-17T04:32:12Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Browsing through KoLmafia tells me it uses the Swing HTML parser, which probably explains why it doesn&amp;#039;t understand colornames like &amp;quot;AliceBlue&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Re: &amp;quot;How does color selection work when the specified color name / entity is invalid?&amp;quot; &amp;lt;br /&amp;gt;&lt;br /&gt;
It returns with the default, black. That is, unless &#039;&amp;gt; ash print(&amp;quot;Hello world!&amp;quot;,&amp;quot;apple-orange&amp;quot;);&#039; returns a color that looks really close to black. (No, I&#039;m not color-blind. It returns black. Even for faulty entities, like &amp;quot;42&amp;quot;.) &amp;lt;br /&amp;gt;&lt;br /&gt;
Edit: Apparently it doesn&#039;t recognize somewhat uncommon colors, like &amp;quot;lavender&amp;quot;. &lt;br /&gt;
--[[User:Heeheehee|Heeheehee]] 06:47, 10 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
That&#039;s true for named colors, but for numbers it appears to interpret some part of the number and chop the rest off; it was just a bit more than I wanted to look up in the moment. For instance, if you supply &amp;quot;#ff00000&amp;quot; (which is red with an extra 0), it used red; the &amp;quot;#&amp;quot; appears to make it choose the first 6 digits. However, you can leave off the &amp;quot;#&amp;quot; and it still works as expected with a 6-digit or 3-digit number; but anything else seems to be a weird substring match for which I can&#039;t find the logic.--[[User:StDoodle|StDoodle]] 13:26, 10 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Okay. I think I&#039;ve fully worked out the logic for the numbers.&lt;br /&gt;
# If there&#039;s a # in front, take the first 6 digits that follow.&lt;br /&gt;
# If length = 6, skip to the last step.&lt;br /&gt;
# Remove all zeroes in the front of the string (e.g. &amp;quot;#00 00 F0 00 00&amp;quot; becomes &amp;quot;F0 00 00&amp;quot;).&lt;br /&gt;
# If length &amp;gt; 7, replace the whole thing with &amp;quot;#00 00 00&amp;quot; (i.e. black).&lt;br /&gt;
# If length = 7, remove the first character (e.g. the red displayed from &amp;quot;#ff0 00 00&amp;quot; is actually &amp;quot;#f0 00 00&amp;quot;).&lt;br /&gt;
# If length &amp;lt; 6, add zeroes to the front until length = 6 (e.g. &amp;quot;#42&amp;quot; becomes &amp;quot;#00 00 42&amp;quot;, which looks pretty close to black --  hence my earlier misunderstanding).&lt;br /&gt;
# Pass the resultant value as your color.&lt;br /&gt;
&lt;br /&gt;
:Perhaps KoLmafia uses some variant of the color parsing/interpreting scheme used in CSS, as it apparently supports the syntax &amp;lt;code&amp;gt;&amp;quot;rgb(148, 0, 211)&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;rgb(148 0 211)&amp;quot;&amp;lt;/code&amp;gt;. We would need to look at the source code to confirm this... --[[User:PhilmASTErpLus|PhilmASTErpLus]] 17:00, 16 July 2010 (UTC)&lt;br /&gt;
:: IIRC, it passes it directly to HTML -- &#039;&#039;&#039;print(a,b)&#039;&#039;&#039; is functionally equivalent to &#039;&#039;&#039;print_html(&amp;quot;&amp;amp;lt;font color=&#039;&amp;quot;+b+&amp;quot;&#039;&amp;amp;gt;&amp;quot;+a+&amp;quot;&amp;amp;lt;/font&amp;amp;gt;&amp;quot;)&#039;&#039;&#039;. --[[User:Heeheehee|Heeheehee]] 17:18, 16 July 2010 (UTC)&lt;br /&gt;
:::It seems to use the native Swing HTML parser, which does not understand many unofficial colornames (see [http://www.w3.org/TR/CSS21/syndata.html#color-units CSS 2.1 color specification] and [http://www.w3.org/TR/html401/types.html#h-6.5 HTML 4.01 color specification] for color syntax. W3schools has a [http://www.w3schools.com/css/css_colornames.asp list of non-standard color names] supported by all major browsers.). --[[User:PhilmASTErpLus|PhilmASTErpLus]] 04:32, 17 July 2010 (UTC)&lt;br /&gt;
This ASH function might help with understanding:&lt;br /&gt;
  string color (string input) {&lt;br /&gt;
     if(index_of(input, &amp;quot;#&amp;quot; &amp;amp;&amp;amp; length(input)&amp;gt;6) == 0) return substring(input, 0, 6);&lt;br /&gt;
     if(length(input) == 6) return input;&lt;br /&gt;
     while(index_of(input, &amp;quot;0&amp;quot;) == 0) input = substring(input, 1);&lt;br /&gt;
     if(length(input)&amp;gt;7) return &amp;quot;000000&amp;quot;;&lt;br /&gt;
     if(length(input)==7) return substring(input, 1);&lt;br /&gt;
     while(length&amp;lt;6) input = &amp;quot;0&amp;quot; + input;&lt;br /&gt;
     return input;&lt;br /&gt;
  }&lt;br /&gt;
(is that too much string manipulation?)&lt;br /&gt;
--[[User:Heeheehee|Heeheehee]] 02:44, 14 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Re: the former RFI (echoing print statements to the adventuring status line)&lt;br /&gt;
&lt;br /&gt;
I was referring to the version of such that is also shown on the login / logout screen, which I feel is relevant as there isn&#039;t a good way to give feedback on a logout script otherwise (currently, I have a logout script that uses a user_confirm() for the clunky purpose of getting around this). If there&#039;s a way I&#039;m unaware of to deal with this, that would be fine; but otherwise I&#039;d like to know if print() could once again place text there, or if I&#039;m mis-remembering. --[[User:StDoodle|StDoodle (#1059825)]] 00:53, 30 April 2010 (UTC)&lt;br /&gt;
:Ah. I can see why you&#039;d want that. Post it in a feature request on the mafia forums. That&#039;s the proper place for it. Then if your desire is granted we can update this page. :D --[[User:Bale|Bale]] 02:07, 30 April 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=New&amp;diff=6956</id>
		<title>New</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=New&amp;diff=6956"/>
		<updated>2010-07-16T17:17:38Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Whoops, didn&amp;#039;t know it accepted parameters. Shouldn&amp;#039;t have looked at it while sleepy. Fixed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:new}}&lt;br /&gt;
Syntax: new &#039;&#039;record&#039;&#039; ( param, ... );&lt;br /&gt;
: &#039;&#039;record&#039;&#039; is the record to use.&lt;br /&gt;
&lt;br /&gt;
Returns an instance of the given record, filling each field of the record with the given parameters. If no parameter is given, each field is filled with the default value of that type. For the default values of various types, see [[Data Types]].&lt;br /&gt;
&lt;br /&gt;
For instance:&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record dblstr{&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
dblstr test;&lt;br /&gt;
test.a = &amp;quot;hello&amp;quot;;&lt;br /&gt;
test.b = &amp;quot;world&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
is functionally identical to&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record dblstr{&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
dblstr test = new dblstr(&amp;quot;hello&amp;quot;,&amp;quot;world&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Format}}&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6772</id>
		<title>User:PhilmASTErpLus</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=User:PhilmASTErpLus&amp;diff=6772"/>
		<updated>2010-07-16T17:13:11Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added link to test_new.ash&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m using this page as my own personal sandbox :) Please contribute your comments, opinions, and ideas in the [[User Talk:PhilmASTErpLus|talk page]].&lt;br /&gt;
&lt;br /&gt;
--[[User:PhilmASTErpLus|PhilmASTErpLus]] 02:36, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Datatype constants&amp;quot; are literals that begin with a dollar sign($), such as &amp;lt;code&amp;gt;$item[]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;$effect[]&amp;lt;/code&amp;gt;, etc. Types of data, such as &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;, are called [http://en.wikipedia.org/wiki/Data_type Data Types].&lt;br /&gt;
&lt;br /&gt;
That is true, and deserves fixing; but please don&#039;t do so in a way that breaks a massive amount of links, ktx. --[[User:StDoodle|StDoodle (#1059825)]] 04:18, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Heh, that&#039;s okay (re: discussion on Datatype Constants). For most pages it isn&#039;t a huge issue, but that one... it requires fixing in quite a few places, some of which unfortunately won&#039;t be automatically be fixed by redirects during a page move (this seems to happen when some of the links are from templates, which this page has a massive number of). For reference, this wiki has problems with both the &amp;quot;design by committee&amp;quot; philosophy &amp;amp; the &amp;quot;legacy problems&amp;quot; philosophy. Originally, the stuff here was simply copy &amp;amp; pasted from an guide that had been hosted elsewhere, which itself was about 2/3 original material and 1/3 copied from Hola&#039;s old reference material. That led to the problem of pages having inappropriate names, as by the time the issue was given thought, they were deeply ingrained in the wiki structure. Then there&#039;s the &amp;quot;committee&amp;quot; issue, which resulted in some over-elaborate templates. For the most part, the last issue doesn&#039;t present any issues with searching and display, but does up the learning curve for &amp;quot;proper&amp;quot; page editing in some places (mostly on the function pages). In the end, I&#039;m glad to have another person interested in helping; but please, before making any massive-scale (many pages) edits, or moving pages, a discussion would be appreciated. As you now know, there are &amp;quot;methods in the madness&amp;quot; for some of this stuff... ;)  Also, if you want to help with getting Datatype Constants corrected, I&#039;d be happy to jot down some notes on what needs to be done in the next day or so. --[[User:StDoodle|StDoodle (#1059825)]] 15:51, 21 June 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
P.S. User pages such as this are the perfect places for sandboxing &amp;amp; discussion; you can even make sub-pages in your own wiki-space by linking to them from here, with a &amp;quot;/&amp;quot; as the first character of the page name. Since user pages are outside of the normal search parameters, feel free to use them however you wish.&lt;br /&gt;
&lt;br /&gt;
== To-Do ==&lt;br /&gt;
&lt;br /&gt;
*Report &amp;amp; document ASH quirks&lt;br /&gt;
**{{f|print}} displays a blank line when given a string starting with a slash (&amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;). To prevent this, the text color must be explicitly given. Easy to bypass, but weird.&lt;br /&gt;
**{{f|file_to_map}} ignores lines beginning with a sharp character (&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;), or any line that does not have a tab character in it.&lt;br /&gt;
*Make a [[Functions|page about functions in general]].&lt;br /&gt;
**Clarify call-by-value and call-by-reference, somewhere...&lt;br /&gt;
***Results from a [http://sites.google.com/site/philmasterplus/files/callby.ash test script] I made:&lt;br /&gt;
****Call by value: most types (boolean, int, float, string, item, effect, class, stat, skill, familiar, slot, location)&lt;br /&gt;
****Call by reference: aggregates (maps, records), buffer&lt;br /&gt;
**Notes: KoLmafia makes no implicit type conversion, unless the function itself supports one. Buffers and strings seem to be an exception.&lt;br /&gt;
&lt;br /&gt;
=== Done ===&lt;br /&gt;
&lt;br /&gt;
*Add information on directly accessing kolmafia data files--equipment.txt, pulverize.txt, etc. =&amp;gt; see {{f|file_to_map}}&lt;br /&gt;
*[[Image:item_category.png|150px]] would go nicely in the pages for [[Item Management]]-related functions.&lt;br /&gt;
*To anyone who cares: the image above was created in Microsoft PowerPoint. You can get it [http://sites.google.com/site/philmasterplus/files/kolmafia_wiki.ppt here].&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
*[http://sites.google.com/site/philmasterplus/files/test_new.ash test_new.ash] - tests the [[new]] command.&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Data_Types&amp;diff=6783</id>
		<title>Data Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Data_Types&amp;diff=6783"/>
		<updated>2010-07-16T17:09:28Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Added information about default values for various types, tested myself with KoLmafia r8532. See my user page for the code that was used to test this (using the &amp;#039;new&amp;#039; command)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==Primitive Datatypes==&lt;br /&gt;
&lt;br /&gt;
===void===&lt;br /&gt;
Can be thought of better as the absence of a datatype. No value can be assigned to &#039;&#039;&#039;void&#039;&#039;&#039; nor can a value be returned from a function of datatype &#039;&#039;&#039;void&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===boolean===&lt;br /&gt;
A boolean value is either &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;. By default, a boolean variable is set to false.&lt;br /&gt;
&lt;br /&gt;
===int===&lt;br /&gt;
&lt;br /&gt;
A whole number (short for &amp;quot;integer&amp;quot;), either positive or negative (or 0).  The int used by KoLmafia is a 32-bit signed int, meaning it has a maximum value of 2,147,483,647 and a minimum value of -2,147,483,648. The default value of a integer variable is 0.&lt;br /&gt;
&lt;br /&gt;
===float===&lt;br /&gt;
&lt;br /&gt;
The float data type is a single-precision 32-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in section 4.2.3 of the Java Language Specification. [http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2.3]&lt;br /&gt;
&lt;br /&gt;
When assigning to a variable of type float, one should be careful to always enter numbers in decimal form, as unwanted behavior can result from supplying a value that KoLmafia may interpret as an int type without the decimal point.&lt;br /&gt;
&lt;br /&gt;
Note that float is not infinitely precise; it intrinsically rounds off after a certain point. This loss of accuracy is for the sake of storage, but beware of the possibility of small errors compounding from multiple float types.&lt;br /&gt;
{{&lt;br /&gt;
CodeSample|&lt;br /&gt;
description=For instance, try the following code as an example of how rather long post-decimal portions are handled:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
float f;&lt;br /&gt;
f = 4.9999999;&lt;br /&gt;
print( f );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The default value of a &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; variable is 0.0.&lt;br /&gt;
&lt;br /&gt;
===string===&lt;br /&gt;
&lt;br /&gt;
A group of characters including, but not limited to: lowercase letters, uppercase characters, numbers, and various control characters. When assigning a value to a string, always enclose the desired value in either single or double quotes (note you must use the same quote type on both ends of the string assignment). If you need to include the same character inside of the string itself, you will need to escape it first with a backslash.{{CodeSample|&lt;br /&gt;
description=For example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string s = &amp;quot;This is my \&amp;quot;friend\&amp;quot; Pete.&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|&lt;br /&gt;
moreinfo=&lt;br /&gt;
Will result in the following being stored to s:&lt;br /&gt;
&amp;lt;pre&amp;gt;This is my &amp;quot;friend&amp;quot; Pete&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
The default value of a string is an empty string, or literally &amp;lt;code&amp;gt;&amp;quot;&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===buffer===&lt;br /&gt;
&lt;br /&gt;
Similar to a string, but more efficient in certain operations, including concatenation and passing as function arguments. For the most part, you can interchange references to strings and buffers. However, you should test all such actions first, as a few functions require a specific datatype to be supplied as a parameter. (Most notably, those listed under [[String Handling Routines#Regular Expressions|Regular Expressions]].)&lt;br /&gt;
&lt;br /&gt;
==Special Datatypes==&lt;br /&gt;
&lt;br /&gt;
Several datatypes are included in KoLmafia to represent common categories within the KoL universe.&lt;br /&gt;
&lt;br /&gt;
Note that while variables of these types are declared in the same way as for Primitive Datatypes; assigning and referencing them is done differently.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, to declare an item datatype and assign it a value, you would use the following line of code:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item it = $item[ broken skull ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The default values of any variable of one of the following types is &amp;lt;code&amp;gt;$&#039;&#039;type&#039;&#039;[ none ]&amp;lt;/code&amp;gt;. For example, the default value of a &amp;lt;code&amp;gt;item&amp;lt;/code&amp;gt; variable is &amp;lt;code&amp;gt;$item[ none ]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===class===&lt;br /&gt;
&lt;br /&gt;
Besides $class[ none ], there are six possible values for this datatype:&lt;br /&gt;
&lt;br /&gt;
* Seal Clubber&lt;br /&gt;
* Turtle Tamer&lt;br /&gt;
* Pastamancer&lt;br /&gt;
* Sauceror&lt;br /&gt;
* Disco Bandit&lt;br /&gt;
* Accordion Thief &lt;br /&gt;
&lt;br /&gt;
===effect===&lt;br /&gt;
&lt;br /&gt;
Any effect you can be under in KoL, whether from items, skills, or what-have-you, is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $effect[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Effects Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===element===&lt;br /&gt;
&lt;br /&gt;
Besides $element[ none ], there are six possible values for this datatype. (Note that &amp;quot;Bad Spelling&amp;quot; is not considered a true element.)&lt;br /&gt;
Also note that these names are case-sensitive (referencing $element[ Spooky ] will generate an error).&lt;br /&gt;
&lt;br /&gt;
* cold&lt;br /&gt;
* hot&lt;br /&gt;
* sleaze&lt;br /&gt;
* spooky&lt;br /&gt;
* stench&lt;br /&gt;
* slime&lt;br /&gt;
&lt;br /&gt;
===familiar===&lt;br /&gt;
&lt;br /&gt;
Any familiar available in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $familiar[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Familiars Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===item===&lt;br /&gt;
&lt;br /&gt;
Any item in all of KoL is valid for this datatype. Note that unlike most special datatypes, item references can make use of the item ID number.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, you could assign the item plexiglass pants as follows:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item it = $item[ 1234 ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The full range, besides $item[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Items Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===location===&lt;br /&gt;
&lt;br /&gt;
Any location one can adventure at in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $location[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Locations Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===monster===&lt;br /&gt;
&lt;br /&gt;
Any monster you can encounter in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $monster[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Monster_Compendium Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===skill===&lt;br /&gt;
&lt;br /&gt;
Any skill you can have in KoL (whether permable or not, granted by items, etc.) is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $skill[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Skills Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===slot===&lt;br /&gt;
&lt;br /&gt;
Besides $slot[ none ], there are 13 possible values for this datatype.&lt;br /&gt;
&lt;br /&gt;
* hat&lt;br /&gt;
* weapon&lt;br /&gt;
* off-hand&lt;br /&gt;
* shirt&lt;br /&gt;
* pants&lt;br /&gt;
* acc1&lt;br /&gt;
* acc2&lt;br /&gt;
* acc3&lt;br /&gt;
* familiar&lt;br /&gt;
* sticker1&lt;br /&gt;
* sticker2&lt;br /&gt;
* sticker3&lt;br /&gt;
* fakehand&lt;br /&gt;
&lt;br /&gt;
===stat===&lt;br /&gt;
&lt;br /&gt;
Besides $stat[ none ], there are six possible values for this datatype (the last three are for referencing sub-stats).&lt;br /&gt;
&lt;br /&gt;
* muscle&lt;br /&gt;
* mysticality&lt;br /&gt;
* moxie&lt;br /&gt;
* submuscle&lt;br /&gt;
* submysticality&lt;br /&gt;
* submoxie&lt;br /&gt;
&lt;br /&gt;
==Aggregate==&lt;br /&gt;
&lt;br /&gt;
An aggregate is a complex datatype composed of two or more primitive or special datatypes. For more information, see [[Data Structures]].&lt;br /&gt;
&lt;br /&gt;
==Record==&lt;br /&gt;
&lt;br /&gt;
Records are user-defined datatypes that hold as many sub-datatypes as desired. For more information, see the page for [[Data Structures]].&lt;br /&gt;
&lt;br /&gt;
==Plural Typed Constants==&lt;br /&gt;
&lt;br /&gt;
(see http://kolmafia.us/showthread.php?p=15592, from which this section is reproduced)&lt;br /&gt;
&lt;br /&gt;
Plural typed constants allow you to easily do something with a list of specified objects, without having to replicate code or laboriously build up an array of the objects so that you can iterate over it. Here&#039;s a quick example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
foreach weapon in $items[star sword, star staff, star crossbow] {&lt;br /&gt;
   if (available_amount(weapon) &amp;gt; 0) {&lt;br /&gt;
      equip(weapon);&lt;br /&gt;
      break;&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The syntax is basically the same as the existing typed constant feature, but with an &amp;quot;s&amp;quot; or &amp;quot;es&amp;quot; after the type name. (The &amp;quot;es&amp;quot; case is there so that you can properly pluralize &amp;quot;class&amp;quot;.) The text between the square brackets is interpreted as a comma-separated list of elements, each of which is converted to the specified type as if it were an individual constant. More details:&lt;br /&gt;
* The list can span multiple lines.&lt;br /&gt;
* Whitespace before or after elements is ignored.&lt;br /&gt;
* Completely empty elements are ignored (so that you can leave a comma at the end of the list).&lt;br /&gt;
* You can include a comma or closing square bracket in an element by writing it as &amp;quot;\,&amp;quot; or &amp;quot;\]&amp;quot;.&lt;br /&gt;
* All the other escape sequences allowed in strings are possible, such as &amp;quot;\n&amp;quot; (newline), &amp;quot;\t&amp;quot; (tab), and &amp;quot;\uXXXX&amp;quot; (Unicode character value). To put an actual backslash in an element, you have to write it as &amp;quot;\\&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The value generated by a plural constant is of type boolean[type], with the keys being the specified elements, and the boolean value always being true - although you won&#039;t normally do anything with the boolean, you&#039;d use a foreach loop to iterate over the keys. You can assign a plural constant to a variable declared as that type, but note that the value differs from a normal map in three important respects:&lt;br /&gt;
* Since the expression that generates it is syntactically a constant, the value has to be immutable. If you were allowed to change it in any way, those changes would appear in every future use of the same constant.&lt;br /&gt;
* There can be multiple instances of the same key - $ints[1,1,2,3,5,8] is perfectly valid, and will result in the value 1 appearing twice in a foreach loop.&lt;br /&gt;
* The keys will appear in the order you wrote them, rather than being sorted alphanumerically as maps usually do.&lt;br /&gt;
&lt;br /&gt;
In addition to being used in a foreach loop, plural constants also efficiently support membership testing via the &#039;contains&#039; operator. Here&#039;s another example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
for hour from 1 to 12 {&lt;br /&gt;
   print(&amp;quot;It&#039;s &amp;quot; + hour + &amp;quot; o&#039;clock.&amp;quot;);&lt;br /&gt;
   if ($ints[10, 2, 4] contains hour) {&lt;br /&gt;
      print(&amp;quot;Time to drink a Dr Pepper!&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
(Yes, that example could just as easily have been done with a switch statement.)&lt;br /&gt;
&lt;br /&gt;
Iterating over an empty list is rather pointless, so plural constants with no elements are given a different meaning: they represent every value of the specified type, where this is practical. (The &#039;none&#039; value, if defined for a given type, is omitted.) The biggest benefit here is $items[], which lets you loop over every defined item, more efficiently than you could otherwise write in a script (since the list is generated once per session and then cached), and without having to hard-code a maximum item ID number in your script. Example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
foreach it in $items[] {&lt;br /&gt;
   if (autosell_price(it) == 42) print(it);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Enumeration of all possible values works with the following types:&lt;br /&gt;
* $booleans[] - false and true.&lt;br /&gt;
* $items[]&lt;br /&gt;
* $locations[]&lt;br /&gt;
* $classes[]&lt;br /&gt;
* $stats[] - Muscle, Mysticality, Moxie: the substat values are omitted.&lt;br /&gt;
* $skills[]&lt;br /&gt;
* $effects[]&lt;br /&gt;
* $familiars[]&lt;br /&gt;
* $slots[] - includes sticker slots and fake hands, which you might not want to consider as normal slots.&lt;br /&gt;
* $monsters[]&lt;br /&gt;
* $elements[] - includes slime now, and possibly other not-quite-elements like cute in the future.&lt;br /&gt;
&lt;br /&gt;
The remaining types that can be used in plural constants require an explicit list of elements, since there are too many possible values:&lt;br /&gt;
* $ints[] - you don&#039;t have enough RAM to store a list with 4 billion elements.&lt;br /&gt;
* $floats[] - ditto.&lt;br /&gt;
* $strings[] - nobody has that much RAM.&lt;br /&gt;
&lt;br /&gt;
==Custom==&lt;br /&gt;
&lt;br /&gt;
===matcher===&lt;br /&gt;
&lt;br /&gt;
A matcher isn&#039;t really a datatype so much as it&#039;s a class, but it is included here for reference, as it is used much as datatypes are in ASH. It can only be declared through the function {{f|create_matcher}}, using two strings. One is the string to find matches in, the other a regular expression to test against. For more information on using a matcher, see [[Regular Expressions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=New&amp;diff=6955</id>
		<title>New</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=New&amp;diff=6955"/>
		<updated>2010-07-16T17:01:45Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: Brief explanation. Also, we need to explain what the default value of each type is.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:new}}&lt;br /&gt;
Syntax: new &#039;&#039;record&#039;&#039; ( param, ... );&lt;br /&gt;
: &#039;&#039;record&#039;&#039; is the record to use.&lt;br /&gt;
&lt;br /&gt;
Returns an instance of the given record, where each field is filled with the default value of that type. For the default values of various types, see [[Data Types]].&lt;br /&gt;
&lt;br /&gt;
For instance:&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record dblstr{&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
dblstr test;&lt;br /&gt;
test.a = &amp;quot;hello&amp;quot;;&lt;br /&gt;
test.b = &amp;quot;world&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
is functionally identical to&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-bottom: 1em; border: dashed 1px green; padding: 1em; margin:0px 20px;&amp;quot;&amp;gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
record dblstr{&lt;br /&gt;
   string a;&lt;br /&gt;
   string b;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
dblstr test = new dblstr(&amp;quot;hello&amp;quot;,&amp;quot;world&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Format}}&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:Print&amp;diff=5239</id>
		<title>Talk:Print</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:Print&amp;diff=5239"/>
		<updated>2010-07-16T17:00:41Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: KoLmafia can also interpret &amp;quot;rgb(x, y, z)&amp;quot;. Should we try to clarify this once and for all (by looking at the source code) and explain it on the main page?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Re: &amp;quot;How does color selection work when the specified color name / entity is invalid?&amp;quot; &amp;lt;br /&amp;gt;&lt;br /&gt;
It returns with the default, black. That is, unless &#039;&amp;gt; ash print(&amp;quot;Hello world!&amp;quot;,&amp;quot;apple-orange&amp;quot;);&#039; returns a color that looks really close to black. (No, I&#039;m not color-blind. It returns black. Even for faulty entities, like &amp;quot;42&amp;quot;.) &amp;lt;br /&amp;gt;&lt;br /&gt;
Edit: Apparently it doesn&#039;t recognize somewhat uncommon colors, like &amp;quot;lavender&amp;quot;. &lt;br /&gt;
--[[User:Heeheehee|Heeheehee]] 06:47, 10 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
That&#039;s true for named colors, but for numbers it appears to interpret some part of the number and chop the rest off; it was just a bit more than I wanted to look up in the moment. For instance, if you supply &amp;quot;#ff00000&amp;quot; (which is red with an extra 0), it used red; the &amp;quot;#&amp;quot; appears to make it choose the first 6 digits. However, you can leave off the &amp;quot;#&amp;quot; and it still works as expected with a 6-digit or 3-digit number; but anything else seems to be a weird substring match for which I can&#039;t find the logic.--[[User:StDoodle|StDoodle]] 13:26, 10 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Okay. I think I&#039;ve fully worked out the logic for the numbers.&lt;br /&gt;
# If there&#039;s a # in front, take the first 6 digits that follow.&lt;br /&gt;
# If length = 6, skip to the last step.&lt;br /&gt;
# Remove all zeroes in the front of the string (e.g. &amp;quot;#00 00 F0 00 00&amp;quot; becomes &amp;quot;F0 00 00&amp;quot;).&lt;br /&gt;
# If length &amp;gt; 7, replace the whole thing with &amp;quot;#00 00 00&amp;quot; (i.e. black).&lt;br /&gt;
# If length = 7, remove the first character (e.g. the red displayed from &amp;quot;#ff0 00 00&amp;quot; is actually &amp;quot;#f0 00 00&amp;quot;).&lt;br /&gt;
# If length &amp;lt; 6, add zeroes to the front until length = 6 (e.g. &amp;quot;#42&amp;quot; becomes &amp;quot;#00 00 42&amp;quot;, which looks pretty close to black --  hence my earlier misunderstanding).&lt;br /&gt;
# Pass the resultant value as your color.&lt;br /&gt;
&lt;br /&gt;
:Perhaps KoLmafia uses some variant of the color parsing/interpreting scheme used in CSS, as it apparently supports the syntax &amp;lt;code&amp;gt;&amp;quot;rgb(148, 0, 211)&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;rgb(148 0 211)&amp;quot;&amp;lt;/code&amp;gt;. We would need to look at the source code to confirm this... --[[User:PhilmASTErpLus|PhilmASTErpLus]] 17:00, 16 July 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
This ASH function might help with understanding:&lt;br /&gt;
  string color (string input) {&lt;br /&gt;
     if(index_of(input, &amp;quot;#&amp;quot; &amp;amp;&amp;amp; length(input)&amp;gt;6) == 0) return substring(input, 0, 6);&lt;br /&gt;
     if(length(input) == 6) return input;&lt;br /&gt;
     while(index_of(input, &amp;quot;0&amp;quot;) == 0) input = substring(input, 1);&lt;br /&gt;
     if(length(input)&amp;gt;7) return &amp;quot;000000&amp;quot;;&lt;br /&gt;
     if(length(input)==7) return substring(input, 1);&lt;br /&gt;
     while(length&amp;lt;6) input = &amp;quot;0&amp;quot; + input;&lt;br /&gt;
     return input;&lt;br /&gt;
  }&lt;br /&gt;
(is that too much string manipulation?)&lt;br /&gt;
--[[User:Heeheehee|Heeheehee]] 02:44, 14 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Re: the former RFI (echoing print statements to the adventuring status line)&lt;br /&gt;
&lt;br /&gt;
I was referring to the version of such that is also shown on the login / logout screen, which I feel is relevant as there isn&#039;t a good way to give feedback on a logout script otherwise (currently, I have a logout script that uses a user_confirm() for the clunky purpose of getting around this). If there&#039;s a way I&#039;m unaware of to deal with this, that would be fine; but otherwise I&#039;d like to know if print() could once again place text there, or if I&#039;m mis-remembering. --[[User:StDoodle|StDoodle (#1059825)]] 00:53, 30 April 2010 (UTC)&lt;br /&gt;
:Ah. I can see why you&#039;d want that. Post it in a feature request on the mafia forums. That&#039;s the proper place for it. Then if your desire is granted we can update this page. :D --[[User:Bale|Bale]] 02:07, 30 April 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Data_Structures&amp;diff=3197</id>
		<title>Data Structures</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Data_Structures&amp;diff=3197"/>
		<updated>2010-07-15T14:22:15Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Clear */ clear() is a function, not a command.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
KoLmafia supports complex data structures such as maps and records made from simple [[Data Types|data types]].&lt;br /&gt;
&lt;br /&gt;
== Maps ==&lt;br /&gt;
Most of this information was copied directly from ASH Maps Tutorial, by Veracity (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 another map. This effectively allows multi-dimensional maps and. In fact, that&#039;s how the syntax we provide for multi-dimensional maps actually operate: 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;
=== 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;pre&amp;gt;&lt;br /&gt;
&amp;lt;data type&amp;gt; [ &amp;lt;key type&amp;gt;, ... ] &amp;lt;aggregate_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
{{CodeSample&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string [item] map1;&lt;br /&gt;
float [class, string, int] another_map;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&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.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int [item] my_pricelist;&lt;br /&gt;
int [item] new_pricelist;&lt;br /&gt;
&lt;br /&gt;
/* Some code that updates new_pricelist */&lt;br /&gt;
&lt;br /&gt;
my_pricelist = new_pricelist;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{{CodeSample&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
int [item] my_pricelist;&lt;br /&gt;
my_pricelist[ $item[ pail ] ] = 1000;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
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;
{{CodeSample&lt;br /&gt;
|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
float [string, int, string] my_map;&lt;br /&gt;
float [int, string] slice1;&lt;br /&gt;
&lt;br /&gt;
/* Some code that fills slice1 */&lt;br /&gt;
my_map[ &amp;quot;slice1&amp;quot; ] = slice1;&lt;br /&gt;
&amp;lt;/syntaxhighlight&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;pre&amp;gt;&lt;br /&gt;
&amp;lt;aggregate name&amp;gt;[ &amp;lt;key expression&amp;gt;, ... ]&lt;br /&gt;
&amp;lt;/pre&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;
CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
boolean [string, string] props; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&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;
CodeSample|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
references:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&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;pre&amp;gt;&lt;br /&gt;
&amp;lt;aggregate reference expression&amp;gt; contains &amp;lt;key expression&amp;gt;&lt;br /&gt;
&amp;lt;/pre&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;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&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;
&amp;lt;pre&amp;gt;&lt;br /&gt;
remove &amp;lt;aggregate reference&amp;gt;&lt;br /&gt;
&amp;lt;/pre&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;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
yields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Clear ===&lt;br /&gt;
&lt;br /&gt;
You can remove all &amp;lt;code&amp;gt;key =&amp;gt; value&amp;lt;/code&amp;gt; entries from a map using the {{f|clear}} function:&lt;br /&gt;
&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;clear( &amp;lt;aggregate&amp;gt; );&amp;lt;/syntaxhighlight&amp;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;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;sort aggregate by keyExpr;&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&amp;lt;code&amp;gt;aggregate&amp;lt;/code&amp;gt; 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 &amp;lt;code&amp;gt;sort()&amp;lt;/code&amp;gt; - which is still perfectly valid, &amp;quot;sort&amp;quot; has not become a [[Reserved Words|reserved word]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;keyExpr&amp;lt;/code&amp;gt; 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;&amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&#039; and &#039;&amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;&#039;, holding the details of that entry. The value of the &amp;lt;code&amp;gt;keyExpr&amp;lt;/code&amp;gt; is used as the sort key; typically it would be an &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;, 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;&amp;lt;code&amp;gt;sort ... by value&amp;lt;/code&amp;gt;&amp;quot;, but many useful things can be done with the use of a more complex &amp;lt;code&amp;gt;keyExpr&amp;lt;/code&amp;gt; - 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;&amp;lt;code&amp;gt;by autosell_price(value)&amp;lt;/code&amp;gt;&amp;quot;. An array of weapon items could be sorted &amp;quot;&amp;lt;code&amp;gt;by -get_power(value)&amp;lt;/code&amp;gt;&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;&amp;lt;code&amp;gt;by value.fieldName&amp;lt;/code&amp;gt;&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;&amp;lt;code&amp;gt;by -value&amp;lt;/code&amp;gt;&amp;quot; sorts integers in decreasing order (there&#039;s no similar trick for &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; values).&lt;br /&gt;
* &amp;quot;&amp;lt;code&amp;gt;by -index&amp;lt;/code&amp;gt;&amp;quot; reverses the existing order of an array (or map with integer keys).&lt;br /&gt;
* &amp;quot;&amp;lt;code&amp;gt;by random(1000000)&amp;lt;/code&amp;gt;&amp;quot; shuffles into a random order.&lt;br /&gt;
* &amp;quot;&amp;lt;code&amp;gt;by otherArray[index]&amp;lt;/code&amp;gt;&amp;quot; uses values from a parallel array as the sort keys (you&#039;d then need to do &amp;quot;&amp;lt;code&amp;gt;sort otherArray by value;&amp;lt;/code&amp;gt;&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;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;}}&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;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;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;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&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;br /&gt;
{{RFI|I, for one, don&#039;t have a good handle on multi-dimensional maps. Any effort to clarify how they are defined &amp;amp; accessed would be greatly appreciated.|Don&#039;t worry about formatting for now; I&#039;ll get to that once the info is there, unless you&#039;re feeling super-ambitious.}}&lt;br /&gt;
{{Format}}&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Data_Types&amp;diff=6782</id>
		<title>Data Types</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Data_Types&amp;diff=6782"/>
		<updated>2010-07-15T14:16:33Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* buffer */ Slightly more information on efficiency -- should probably expand later.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
==Primitive Datatypes==&lt;br /&gt;
&lt;br /&gt;
===void===&lt;br /&gt;
Can be thought of better as the absence of a datatype. No value can be assigned to &#039;&#039;&#039;void&#039;&#039;&#039; nor can a value be returned from a function of datatype &#039;&#039;&#039;void&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===boolean===&lt;br /&gt;
A boolean value is either &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===int===&lt;br /&gt;
&lt;br /&gt;
A whole number (short for &amp;quot;integer&amp;quot;), either positive or negative (or 0).  The int used by KoLmafia is a 32-bit signed int, meaning it has a maximum value of 2,147,483,647 and a minimum value of -2,147,483,648.&lt;br /&gt;
&lt;br /&gt;
===float===&lt;br /&gt;
&lt;br /&gt;
The float data type is a single-precision 32-bit IEEE 754 floating point. Its range of values is beyond the scope of this discussion, but is specified in section 4.2.3 of the Java Language Specification. [http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2.3]&lt;br /&gt;
&lt;br /&gt;
When assigning to a variable of type float, one should be careful to always enter numbers in decimal form, as unwanted behavior can result from supplying a value that KoLmafia may interpret as an int type without the decimal point.&lt;br /&gt;
&lt;br /&gt;
Note that float is not infinitely precise; it intrinsically rounds off after a certain point. This loss of accuracy is for the sake of storage, but beware of the possibility of small errors compounding from multiple float types.&lt;br /&gt;
{{&lt;br /&gt;
CodeSample|&lt;br /&gt;
description=For instance, try the following code as an example of how rather long post-decimal portions are handled:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
float f;&lt;br /&gt;
f = 4.9999999;&lt;br /&gt;
print( f );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===string===&lt;br /&gt;
&lt;br /&gt;
A group of characters including, but not limited to: lowercase letters, uppercase characters, numbers, and various control characters. When assigning a value to a string, always enclose the desired value in either single or double quotes (note you must use the same quote type on both ends of the string assignment). If you need to include the same character inside of the string itself, you will need to escape it first with a backslash.{{CodeSample|&lt;br /&gt;
description=For example:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
string s = &amp;quot;This is my \&amp;quot;friend\&amp;quot; Pete.&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|&lt;br /&gt;
moreinfo=&lt;br /&gt;
Will result in the following being stored to s:&lt;br /&gt;
&amp;lt;pre&amp;gt;This is my &amp;quot;friend&amp;quot; Pete&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===buffer===&lt;br /&gt;
&lt;br /&gt;
Similar to a string, but more efficient in certain operations, including concatenation and passing as function arguments. For the most part, you can interchange references to strings and buffers. However, you should test all such actions first, as a few functions require a specific datatype to be supplied as a parameter. (Most notably, those listed under [[String Handling Routines#Regular Expressions|Regular Expressions]].)&lt;br /&gt;
&lt;br /&gt;
==Special Datatypes==&lt;br /&gt;
&lt;br /&gt;
Several datatypes are included in KoLmafia to represent common categories within the KoL universe.&lt;br /&gt;
&lt;br /&gt;
Note that while variables of these types are declared in the same way as for Primitive Datatypes; assigning and referencing them is done differently.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, to declare an item datatype and assign it a value, you would use the following line of code:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item it = $item[ broken skull ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
===class===&lt;br /&gt;
&lt;br /&gt;
Besides $class[ none ], there are six possible values for this datatype:&lt;br /&gt;
&lt;br /&gt;
* Seal Clubber&lt;br /&gt;
* Turtle Tamer&lt;br /&gt;
* Pastamancer&lt;br /&gt;
* Sauceror&lt;br /&gt;
* Disco Bandit&lt;br /&gt;
* Accordion Thief &lt;br /&gt;
&lt;br /&gt;
===effect===&lt;br /&gt;
&lt;br /&gt;
Any effect you can be under in KoL, whether from items, skills, or what-have-you, is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $effect[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Effects Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===element===&lt;br /&gt;
&lt;br /&gt;
Besides $element[ none ], there are six possible values for this datatype. (Note that &amp;quot;Bad Spelling&amp;quot; is not considered a true element.)&lt;br /&gt;
Also note that these names are case-sensitive (referencing $element[ Spooky ] will generate an error).&lt;br /&gt;
&lt;br /&gt;
* cold&lt;br /&gt;
* hot&lt;br /&gt;
* sleaze&lt;br /&gt;
* spooky&lt;br /&gt;
* stench&lt;br /&gt;
* slime&lt;br /&gt;
&lt;br /&gt;
===familiar===&lt;br /&gt;
&lt;br /&gt;
Any familiar available in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $familiar[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Familiars Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===item===&lt;br /&gt;
&lt;br /&gt;
Any item in all of KoL is valid for this datatype. Note that unlike most special datatypes, item references can make use of the item ID number.&lt;br /&gt;
{{CodeSample|&lt;br /&gt;
description=For example, you could assign the item plexiglass pants as follows:|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
item it = $item[ 1234 ];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The full range, besides $item[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Items Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===location===&lt;br /&gt;
&lt;br /&gt;
Any location one can adventure at in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $location[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Locations Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===monster===&lt;br /&gt;
&lt;br /&gt;
Any monster you can encounter in KoL is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $monster[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Monster_Compendium Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===skill===&lt;br /&gt;
&lt;br /&gt;
Any skill you can have in KoL (whether permable or not, granted by items, etc.) is valid for this datatype.&lt;br /&gt;
&lt;br /&gt;
The full range, besides $skill[ none ], is too much to list and keep up with here: please see the [http://kol.coldfront.net/thekolwiki/index.php/Skills Coldfront Wiki] page for more information.&lt;br /&gt;
&lt;br /&gt;
===slot===&lt;br /&gt;
&lt;br /&gt;
Besides $slot[ none ], there are 13 possible values for this datatype.&lt;br /&gt;
&lt;br /&gt;
* hat&lt;br /&gt;
* weapon&lt;br /&gt;
* off-hand&lt;br /&gt;
* shirt&lt;br /&gt;
* pants&lt;br /&gt;
* acc1&lt;br /&gt;
* acc2&lt;br /&gt;
* acc3&lt;br /&gt;
* familiar&lt;br /&gt;
* sticker1&lt;br /&gt;
* sticker2&lt;br /&gt;
* sticker3&lt;br /&gt;
* fakehand&lt;br /&gt;
&lt;br /&gt;
===stat===&lt;br /&gt;
&lt;br /&gt;
Besides $stat[ none ], there are six possible values for this datatype (the last three are for referencing sub-stats).&lt;br /&gt;
&lt;br /&gt;
* muscle&lt;br /&gt;
* mysticality&lt;br /&gt;
* moxie&lt;br /&gt;
* submuscle&lt;br /&gt;
* submysticality&lt;br /&gt;
* submoxie&lt;br /&gt;
&lt;br /&gt;
==Aggregate==&lt;br /&gt;
&lt;br /&gt;
An aggregate is a complex datatype composed of two or more primitive or special datatypes. For more information, see [[Data Structures]].&lt;br /&gt;
&lt;br /&gt;
==Record==&lt;br /&gt;
&lt;br /&gt;
Records are user-defined datatypes that hold as many sub-datatypes as desired. For more information, see the page for [[Data Structures]].&lt;br /&gt;
&lt;br /&gt;
==Plural Typed Constants==&lt;br /&gt;
&lt;br /&gt;
(see http://kolmafia.us/showthread.php?p=15592, from which this section is reproduced)&lt;br /&gt;
&lt;br /&gt;
Plural typed constants allow you to easily do something with a list of specified objects, without having to replicate code or laboriously build up an array of the objects so that you can iterate over it. Here&#039;s a quick example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
foreach weapon in $items[star sword, star staff, star crossbow] {&lt;br /&gt;
   if (available_amount(weapon) &amp;gt; 0) {&lt;br /&gt;
      equip(weapon);&lt;br /&gt;
      break;&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
The syntax is basically the same as the existing typed constant feature, but with an &amp;quot;s&amp;quot; or &amp;quot;es&amp;quot; after the type name. (The &amp;quot;es&amp;quot; case is there so that you can properly pluralize &amp;quot;class&amp;quot;.) The text between the square brackets is interpreted as a comma-separated list of elements, each of which is converted to the specified type as if it were an individual constant. More details:&lt;br /&gt;
* The list can span multiple lines.&lt;br /&gt;
* Whitespace before or after elements is ignored.&lt;br /&gt;
* Completely empty elements are ignored (so that you can leave a comma at the end of the list).&lt;br /&gt;
* You can include a comma or closing square bracket in an element by writing it as &amp;quot;\,&amp;quot; or &amp;quot;\]&amp;quot;.&lt;br /&gt;
* All the other escape sequences allowed in strings are possible, such as &amp;quot;\n&amp;quot; (newline), &amp;quot;\t&amp;quot; (tab), and &amp;quot;\uXXXX&amp;quot; (Unicode character value). To put an actual backslash in an element, you have to write it as &amp;quot;\\&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The value generated by a plural constant is of type boolean[type], with the keys being the specified elements, and the boolean value always being true - although you won&#039;t normally do anything with the boolean, you&#039;d use a foreach loop to iterate over the keys. You can assign a plural constant to a variable declared as that type, but note that the value differs from a normal map in three important respects:&lt;br /&gt;
* Since the expression that generates it is syntactically a constant, the value has to be immutable. If you were allowed to change it in any way, those changes would appear in every future use of the same constant.&lt;br /&gt;
* There can be multiple instances of the same key - $ints[1,1,2,3,5,8] is perfectly valid, and will result in the value 1 appearing twice in a foreach loop.&lt;br /&gt;
* The keys will appear in the order you wrote them, rather than being sorted alphanumerically as maps usually do.&lt;br /&gt;
&lt;br /&gt;
In addition to being used in a foreach loop, plural constants also efficiently support membership testing via the &#039;contains&#039; operator. Here&#039;s another example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
for hour from 1 to 12 {&lt;br /&gt;
   print(&amp;quot;It&#039;s &amp;quot; + hour + &amp;quot; o&#039;clock.&amp;quot;);&lt;br /&gt;
   if ($ints[10, 2, 4] contains hour) {&lt;br /&gt;
      print(&amp;quot;Time to drink a Dr Pepper!&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
(Yes, that example could just as easily have been done with a switch statement.)&lt;br /&gt;
&lt;br /&gt;
Iterating over an empty list is rather pointless, so plural constants with no elements are given a different meaning: they represent every value of the specified type, where this is practical. (The &#039;none&#039; value, if defined for a given type, is omitted.) The biggest benefit here is $items[], which lets you loop over every defined item, more efficiently than you could otherwise write in a script (since the list is generated once per session and then cached), and without having to hard-code a maximum item ID number in your script. Example:&lt;br /&gt;
{{CodeSample|code=&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
foreach it in $items[] {&lt;br /&gt;
   if (autosell_price(it) == 42) print(it);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
Enumeration of all possible values works with the following types:&lt;br /&gt;
* $booleans[] - false and true.&lt;br /&gt;
* $items[]&lt;br /&gt;
* $locations[]&lt;br /&gt;
* $classes[]&lt;br /&gt;
* $stats[] - Muscle, Mysticality, Moxie: the substat values are omitted.&lt;br /&gt;
* $skills[]&lt;br /&gt;
* $effects[]&lt;br /&gt;
* $familiars[]&lt;br /&gt;
* $slots[] - includes sticker slots and fake hands, which you might not want to consider as normal slots.&lt;br /&gt;
* $monsters[]&lt;br /&gt;
* $elements[] - includes slime now, and possibly other not-quite-elements like cute in the future.&lt;br /&gt;
&lt;br /&gt;
The remaining types that can be used in plural constants require an explicit list of elements, since there are too many possible values:&lt;br /&gt;
* $ints[] - you don&#039;t have enough RAM to store a list with 4 billion elements.&lt;br /&gt;
* $floats[] - ditto.&lt;br /&gt;
* $strings[] - nobody has that much RAM.&lt;br /&gt;
&lt;br /&gt;
==Custom==&lt;br /&gt;
&lt;br /&gt;
===matcher===&lt;br /&gt;
&lt;br /&gt;
A matcher isn&#039;t really a datatype so much as it&#039;s a class, but it is included here for reference, as it is used much as datatypes are in ASH. It can only be declared through the function {{f|create_matcher}}, using two strings. One is the string to find matches in, the other a regular expression to test against. For more information on using a matcher, see [[Regular Expressions]].&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=KoLmafia_Properties&amp;diff=1243</id>
		<title>KoLmafia Properties</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=KoLmafia_Properties&amp;diff=1243"/>
		<updated>2010-07-14T08:18:14Z</updated>

		<summary type="html">&lt;p&gt;PhilmASTErpLus: /* Per-Account Variables */ Added info about lastEmptiedStorage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOCright}}&lt;br /&gt;
Inside your KoLmafia &amp;quot;settings&amp;quot; directory, you should find several files. KoLmafia properties are stored in the files that end with &amp;quot;_prefs.txt&amp;quot;. One of these files will start with &amp;quot;GLOBAL&amp;quot;; the settings inside are shared by all characters using the program (and some of these properties are needed by KoLmafia even when no character is logged in). The other files ending with &amp;quot;_prefs.txt&amp;quot; will start with the name of a character, one for each who has been logged in to date. (Note: the names will all be converted to lowercase.)&lt;br /&gt;
&lt;br /&gt;
==Choice Adventures==&lt;br /&gt;
A large number of the preferences saved by KoLmafia are used to determine the default behavior when a choice adventure is automated (either through auto-adventuring or use of the &amp;quot;auto&amp;quot; button in the relay browser). The number of choice adventures in KoL is too large and too often updated to list each individual preference here. Please consult the main wiki&#039;s [http://kol.coldfront.net/thekolwiki/index.php/Choice_Adventures_by_Number Choice Adventures by Number] page for a comprehensive list. Note that each preference follows the same numbering scheme as KoL itself. For example, the adventure &amp;quot;Minnesota Incorporeals&amp;quot; is number 77 in KoL, and its KoLmafia preference is &amp;quot;choiceAdventure77&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each choiceAdventure is set to a number, which corresponds to which choice you want to make from the available options in KoL (or in the GUI, in the case that mafia provides more options than KoL).  According to Holatuwol ([http://kolmafia.us/index.php/topic,1155.0.html here]), the settings map to &amp;quot;X=pick the Xth Option&amp;quot; and &amp;quot;X+1=pick an item you don&#039;t have&amp;quot; (i.e., complete the outfit). Many preferences also have a &amp;quot;Show in [Mini] Browser&amp;quot; option, which corresponds to a setting of 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a list of all the Property variables included in KoLmafia. It was automatically generated from r7582. Note that, however, the latest (and most up-to-date) data is located in Mafia&#039;s internally-stored datafile defaults.txt (available for viewing at [https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/data/defaults.txt the SourceForge page]).&lt;br /&gt;
&lt;br /&gt;
==Global Variables==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Variable Name&lt;br /&gt;
!  Default Value&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  addChatCommandLine&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  addCreationQueue&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  addStatusBarToFrames&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  allowCloseableDesktopTabs&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  allowNegativeTally&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  allowNonMoodBurning&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  alwaysGetBreakfast&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoLogin&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  allowSocketTimeout&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoHighlightOnFocus&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoPlantHardcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoPlantSoftcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoSatisfyWithCloset&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoSatisfyWithMall&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoSatisfyWithNPCs&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  autoSatisfyWithStash&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  breakfastHardcore&lt;br /&gt;
|  Advanced Saucecrafting,Pastamastery,Advanced Cocktailcrafting&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  breakfastSoftcore&lt;br /&gt;
|  Advanced Saucecrafting,Pastamastery,Advanced Cocktailcrafting&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  browserBookmarks&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cacheMallSearches&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  charsheetDropdown&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chatFontSize&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chatLinksUseRelay&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chatStyle&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cloverProtectActive&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey0&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey4&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey5&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey6&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey7&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey8&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  combatHotkey9&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  commandLineNamespace&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  connectViaAddress&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cookies.inventory&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  copyAsHTML&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  createHackerSummons&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  customizedTabs&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  debugPathnames&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultBorderColor&lt;br /&gt;
|  blue&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultDropdown1&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultDropdown2&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultDropdownSplit&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultLimit&lt;br /&gt;
|  5&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultLoginServer&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  displayName&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  eSoluScriptType&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  getBreakfast&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grabCloversHardcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grabCloversSoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  greenScreenProtection&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grimoireSkillsHardcore&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grimoireSkillsSoftcore&lt;br /&gt;
|  Summon Hilarious Objects&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  guiUsesOneWindow&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hideServerDebugText&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  highlightList&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  http.proxyHost&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  http.proxyPassword&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  http.proxyPort&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  http.proxyUser&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  initialDesktop&lt;br /&gt;
|  AdventureFrame,CommandDisplayFrame,MallSearchFrame,GearChangeFrame,SkillBuffFrame&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  initialFrames&lt;br /&gt;
|  RecentEventsFrame&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  innerChatColor&lt;br /&gt;
|  #ffa98c&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  innerTabColor&lt;br /&gt;
|  #8ca9ff&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  itemManagerIndex&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBuffRequestType&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastRelayUpdate&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastRssUpdate&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastRssVersion&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastUserAgent&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastUsername&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  libramSkillsHardcore&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  libramSkillsSoftcore&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logAcquiredItems&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logBattleAction&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logBrowserInteractions&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logChatMessages&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logDecoratedResponses&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logFamiliarActions&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logGainMessages&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logReadableHTML&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  loginRecoveryHardcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  loginRecoverySoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  loginScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  loginServerName&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  loginWindowLogo&lt;br /&gt;
|  lantern.jpg&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logMonsterHealth&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logoutScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logReverseOrder&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logStatGains&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logStatusEffects&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  logStatusOnLogin&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mementoListActive&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mergeHobopolisChat&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  outerChatColor&lt;br /&gt;
|  #b4460f&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  outerTabColor&lt;br /&gt;
|  #0f46b4&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pathedSummonsHardcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pathedSummonsSoftcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  preferredWebBrowser&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  previousNotifyList&lt;br /&gt;
|  &amp;lt;&amp;gt;&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  previousUpdateVersion&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  protectAgainstOverdrink&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  proxySet&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  readManualHardcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  readManualSoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsCustomCombat&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsGraphicalCLI&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsKoLSimulator&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsQuickScripts&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsRestoreLinks&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsRoundNumber&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsUpArrowLinks&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsUseLinks&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAddsWikiLinks&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayAllowsOverrides&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayBrowserOnly&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayBrowserOnly&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayFormatsChatText&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayHidesJunkMallItems&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayMaintainsEffects&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayMaintainsHealth&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayMaintainsMana&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayTextualizesEffects&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayTrimsZapList&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayUsesCachedImages&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayUsesInlineLinks&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayUsesIntegratedChat&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayViewsCustomItems&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  removeMalignantEffects&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  saveSettingsOnSet&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  saveState&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  saveStateActive&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  scriptButtonPosition&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  scriptList&lt;br /&gt;
|  restore hp | restore mp&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  showAllRequests&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stealthLogin&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  swingLookAndFeel&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  switchEquipmentForBuffs&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  tomeSkillsHardcore&lt;br /&gt;
|  Summon Snowcone&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  tomeSkillsSoftcore&lt;br /&gt;
|  Summon Snowcone&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  toolbarPosition&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useChatMonitor&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useChatToolbar&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useContactsFrame&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useCrimboToysHardcore&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useCrimboToysSoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useDecoratedTabs&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useLastUserAgent&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useSeparateChannels&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useShinyTabbedChat&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useSystemTrayIcon&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useTabbedChatFrame&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useToolbars&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  useZoneComboBox&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  userAgent&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  visitLoungeHardcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  visitLoungeSoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  visitRumpusHardcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  visitRumpusSoftcore&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Per-Account Variables==&lt;br /&gt;
Choice adventure preferences have been omitted (see above).&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Variable Name&lt;br /&gt;
!  Default Value&lt;br /&gt;
!  Notes&lt;br /&gt;
|-&lt;br /&gt;
|  autoAbortThreshold&lt;br /&gt;
|  -0.05&lt;br /&gt;
|  Abort adventuring at this percentage of HP. (-0.05 means if HP restoration failed)&lt;br /&gt;
|-&lt;br /&gt;
|  autoAntidote&lt;br /&gt;
|  0&lt;br /&gt;
|  Use antidotes in combat&lt;br /&gt;
|-&lt;br /&gt;
|  autoBuyPriceLimit&lt;br /&gt;
|  20000&lt;br /&gt;
|  Don&#039;t auto purchase anything that costs more than this&lt;br /&gt;
|-&lt;br /&gt;
|  autoEntangle&lt;br /&gt;
|  false&lt;br /&gt;
|  Use Entangling Noodles at the beginning of combat&lt;br /&gt;
|-&lt;br /&gt;
|  autoManaRestore&lt;br /&gt;
|  true&lt;br /&gt;
|  Restore MP in combat&lt;br /&gt;
|-&lt;br /&gt;
|  autoOlfact&lt;br /&gt;
|  &lt;br /&gt;
|  Automatically cast Olfaction&lt;br /&gt;
|-&lt;br /&gt;
|  autoPotionID&lt;br /&gt;
|  false&lt;br /&gt;
|  Attempt to ID ! potions in combat&lt;br /&gt;
|-&lt;br /&gt;
|  autoPutty&lt;br /&gt;
|  &lt;br /&gt;
|  Automatically use Spooky Putty&lt;br /&gt;
|-&lt;br /&gt;
|  autoRepairBoxServants&lt;br /&gt;
|  true&lt;br /&gt;
|  Create in-a-boxen before cooking or mixing &lt;br /&gt;
|-&lt;br /&gt;
|  autoSphereID&lt;br /&gt;
|  false&lt;br /&gt;
|  Attempt to ID spheres from the Hidden City&lt;br /&gt;
|-&lt;br /&gt;
|  autoSteal&lt;br /&gt;
|  true&lt;br /&gt;
|  Attempt to pickpocket in combat&lt;br /&gt;
|-&lt;br /&gt;
|  autostartGalaktikQuest&lt;br /&gt;
|  true&lt;br /&gt;
|  Get Doc Galaktik&#039;s Quest at the start of ascension&lt;br /&gt;
|-&lt;br /&gt;
|  availableDimes&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  availableLucre&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  availableQuarters&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  availableSandDollars&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  barrelGoal&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  barrelLayout&lt;br /&gt;
|  ?????????&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  basementMallPrices&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  battleAction&lt;br /&gt;
|  attack with weapon&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  betweenBattleScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformCold&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformHot&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformRoc&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformSleaze&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformSpooky&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  birdformStench&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  blackPuddingsDefeated&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  breakfastCompleted&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  buffBotCasting&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  buffBotMessageDisposal&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  buffBotPhilanthropyType&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  burrowgrubHiveUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  burrowgrubSummonsRemaining&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  buyScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cameraMonster&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cellarLayout&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chatbotScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chatbotScriptExecuted&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  chosenTrip&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  clanAttacksEnabled&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  cocktailSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  concertVisited&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentBountyItem&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentFullness&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentHippyStore&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentJunkyardTool&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentJunkyardLocation&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentMojoFilters&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentMood&lt;br /&gt;
|  default&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentNunneryMeat&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentPvpVictories&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentSpleenUse&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  currentWheelPosition&lt;br /&gt;
|  muscle&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  customCombatScript&lt;br /&gt;
|  default&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  dailyDungeonDone&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultAutoAttack&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultFlowerLossMessage&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  defaultFlowerWinMessage&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName4&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName5&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName6&lt;br /&gt;
|  Tatter&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonName7&lt;br /&gt;
|  Ak&#039;gyxoth&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  demonSummoned&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  expressCardUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  extraRolloverAdventures&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  flyeredML&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  fratboysDefeated&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  friarsBlessingReceived&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  gongPath&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  gourdItemCount&lt;br /&gt;
|  5&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grimoire1Summons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  grimoire2Summons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  guardTurtlesFreed&lt;br /&gt;
|  0&lt;br /&gt;
|  Number of times that [http://kol.coldfront.net/thekolwiki/index.php/Cold-Blooded_Warm_Fuzzies guard turtles have been freed] this ascension.&lt;br /&gt;
|-&lt;br /&gt;
|  guyMadeOfBeesCount&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  guyMadeOfBeesDefeated&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hiddenCityLayout&lt;br /&gt;
|  0000000000000000000000000&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hiddenCitySquare&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hippiesDefeated&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hpAutoRecovery&lt;br /&gt;
|  -0.05&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hpAutoRecoveryItems&lt;br /&gt;
|  cannelloni cocoon;scroll of drastic healing;tongue of the walrus;lasagna bandages;doc galaktik&#039;s ailment ointment&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  hpAutoRecoveryTarget&lt;br /&gt;
|  1.0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  invalidBuffMessage&lt;br /&gt;
|  You sent an amount which does not correspond to a valid buff amount.&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  kingLiberated&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  knownAscensions&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastAdventure&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBarrelSmashed&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion819&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion820&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion821&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion822&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion823&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion824&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion825&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion826&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotion827&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBangPotionReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBarrelSmashed&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBattlefieldReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastBreakfast&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastCellarReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastCouncilVisit&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastCounterDay&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2271&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2272&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2273&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2274&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2275&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottle2276&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDustyBottleReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfDiceRolls&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfDigitRunes&lt;br /&gt;
|  -------&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfEquipmentRunes&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem118&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem119&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem120&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem360&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem361&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem362&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem363&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem364&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem365&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem910&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryItem3199&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3208&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3209&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3210&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3211&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3212&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3213&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOfficeItem3214&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfOreRunes&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfFactoryReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfHopper1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfHopper2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfHopper3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastDwarfHopper4&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastEVHelmetValue&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastEVHelmetReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastEmptiedStorage&lt;br /&gt;
|  -1&lt;br /&gt;
|  Stores whether the storage was empty the last time it was checked.&lt;br /&gt;
|-&lt;br /&gt;
|  lastFilthClearance&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastGalleryUnlock&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastGuildStoreOpen&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastGuyMadeOfBeesReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastHiddenCityAscension&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastFratboyCall&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastHippyCall&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastKingLiberation&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastLouvreMap&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastMessageId&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastMiningReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStripReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip3144&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4138&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4139&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4140&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4141&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4142&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4143&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPaperStrip4144&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPastamancerGhostReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateEphemera&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateEphemeraReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult1&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult2&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult3&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult4&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult5&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult6&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult7&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsult8&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPirateInsultReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastPyramidReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastQuartetAscension&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastQuartetRequest&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastSecondFloorUnlock&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastSemirareReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastStoneSphere2174&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastStoneSphere2175&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastStoneSphere2176&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastStoneSphere2177&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastStoneSphereReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastTavernAscension&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastTavernSquare&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastTelescopeReset&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastTowerClimb&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastVioletFogMap&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  lastZapperWand&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  libramSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  libraryCardUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  louvreDesiredGoal&lt;br /&gt;
|  7&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  louvreGoal&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  louvreLayout&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  louvreOverride&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  luckySewerAdventure&lt;br /&gt;
|  stolen accordion&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  manaBurnSummonThreshold&lt;br /&gt;
|  10&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  manaBurningThreshold&lt;br /&gt;
|  -0.05&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
| mayflyExperience&lt;br /&gt;
| 0&lt;br /&gt;
| Uses of mayfly bait necklace. Reset each ascension.&lt;br /&gt;
|-&lt;br /&gt;
|  mineLayout1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mineLayout2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mineLayout3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  moleTunnelLevel&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mpAutoRecovery&lt;br /&gt;
|  0.0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mpAutoRecoveryItems&lt;br /&gt;
|  phonics down;knob goblin superseltzer;mountain stream soda;magical mystery juice;knob goblin seltzer;cherry cloaca cola;soda water&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  mpAutoRecoveryTarget&lt;br /&gt;
|  0.3&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  munchiesPillsUsed&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  noodleSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  nunsVisits&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  oceanAction&lt;br /&gt;
|  savecontinue&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  oceanDestination&lt;br /&gt;
|  manual&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  olfactedMonster&lt;br /&gt;
|  unknown&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  oscusSodaUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  outrageousSombreroUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pastamancerGhostExperience&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pastamancerGhostName&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pastamancerGhostSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pastamancerGhostType&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  plantingDate&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  plantingDay&lt;br /&gt;
|  -1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  plantingLength&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  plantingScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  postAscensionScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  preAscensionScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  preBlackbirdFamiliar&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  prismaticSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pyramidPosition&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  pyramidBombUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  rageGlandVented&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  reagentSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  recentLocations&lt;br /&gt;
|  5&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  recoveryScript&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  relayCounters&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  requireBoxServants&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  requireSewerTestItems&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  retrieveContacts&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  seaodesFound&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  semirareCounter&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  semirareLocation&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  serverAddsCustomCombat&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  setAutoAttack&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  showGainsPerUnit&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sideDefeated&lt;br /&gt;
|  neither&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestArenaCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestFarmCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestJunkyardCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestLighthouseCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestNunsCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sidequestOrchardCompleted&lt;br /&gt;
|  none&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  skillLevel46&lt;br /&gt;
|  2&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  skillLevel47&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  skillLevel48&lt;br /&gt;
|  2&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  slimelingFullness&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  sortByRoom&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  spadingData&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  spiceMelangeUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  spookyPuttyCopiesMade&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  spookyPuttyMonster&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stationaryButton1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stationaryButton2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stationaryButton3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stationaryButton4&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  stationaryButton5&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  styxPixieVisited&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  tavernLayout&lt;br /&gt;
|  0000000000000000000000000&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope1&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope2&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope3&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope4&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope5&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope6&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescope7&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescopeLookedHigh&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  telescopeUpgrades&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  tempuraSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  thanksMessage&lt;br /&gt;
|  Thank you for the donation!&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  timesRested&lt;br /&gt;
|  99&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  tomeSummons&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  trapperOre&lt;br /&gt;
|  chrome ore&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usable1HWeapons&lt;br /&gt;
|  3&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usable1xAccs&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usable2HWeapons&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usable3HWeapons&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usableAccessories&lt;br /&gt;
|  3&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usableHats&lt;br /&gt;
|  2&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usableOffhands&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usableOther&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usablePants&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  usableShirts&lt;br /&gt;
|  1&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  violetFogGoal&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  violetFogLayout&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  warProgress&lt;br /&gt;
|  unstarted&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  welcomeBackAdv&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _absintheDrops&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _aguaDrops&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _astralDrops&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _banderRunaways&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _cameraUsed&lt;br /&gt;
|  false&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _gongDrops&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _hotTubSoaks&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
| _mayflySummons&lt;br /&gt;
| 0&lt;br /&gt;
| Mayfly summonings today&lt;br /&gt;
|-&lt;br /&gt;
|  _navelRunaways&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _sealsSummoned&lt;br /&gt;
|  0&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  _skateBuff1&lt;br /&gt;
|  false&lt;br /&gt;
|  lutz&lt;br /&gt;
|-&lt;br /&gt;
|  _skateBuff2&lt;br /&gt;
|  false&lt;br /&gt;
|  comet&lt;br /&gt;
|-&lt;br /&gt;
|  _skateBuff3&lt;br /&gt;
|  false&lt;br /&gt;
|  band shell&lt;br /&gt;
|-&lt;br /&gt;
|  _skateBuff4&lt;br /&gt;
|  false&lt;br /&gt;
|  skate eels&lt;br /&gt;
|-&lt;br /&gt;
|  _skateBuff5&lt;br /&gt;
|  false&lt;br /&gt;
|  merry-go-round&lt;br /&gt;
|-&lt;br /&gt;
|  _userMods&lt;br /&gt;
|  &lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3542&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3543&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3544&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3545&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3546&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3547&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3548&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3749&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe3751&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe4172&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe4173&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|-&lt;br /&gt;
|  unknownRecipe4174&lt;br /&gt;
|  true&lt;br /&gt;
|  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==User-defined variables==&lt;br /&gt;
In addition to setting the variables that KoLmafia predefines, you can also create any others to cover any information you wish.  As you do so, keep in mind that while you can clear a variable&amp;amp;#8217;s value to the null string, there is currently no way to delete a key (aside from editing the .txt file in the text processor of your choice and deleting the line that contains the key).&lt;br /&gt;
{{SeeAlso|get_property|set_property}}&lt;br /&gt;
&lt;br /&gt;
[[Category:ASH Scripting]]&lt;/div&gt;</summary>
		<author><name>PhilmASTErpLus</name></author>
	</entry>
</feed>