<?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=EEPiccolo</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=EEPiccolo"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/EEPiccolo"/>
	<updated>2026-04-25T02:51:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2086</id>
		<title>Talk:String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2086"/>
		<updated>2007-09-24T14:55:10Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: Revert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So wtf does group_string actually do?  The linked &amp;quot;descriptive&amp;quot; post has an utterly unhelpful example.  Has anyone ever used it for anything?&lt;br /&gt;
&lt;br /&gt;
Groups a string into a map using a regular expression. To understand the function you must know.&lt;br /&gt;
1. What maps are and how they are used.&lt;br /&gt;
2. Understand what regular expressions are and how to create them.&lt;br /&gt;
&lt;br /&gt;
Using the original post:&lt;br /&gt;
&lt;br /&gt;
FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )&lt;br /&gt;
EXAMPLE: string [int,int] test = group_string( &amp;quot;This is a test&amp;quot;, &amp;quot;([a-z] ) &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Example Breakdown:&lt;br /&gt;
&#039;&#039;&#039;string [int,int]&#039;&#039;&#039; Define a map. Two dimensional. The indices are integers. The data is stored as a string.&lt;br /&gt;
&#039;&#039;&#039;test&#039;&#039;&#039; Define the map with name &#039;&#039;&#039;test&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;group_string&#039;&#039;&#039; Call the function.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;This is a Test&amp;quot;&#039;&#039;&#039; Feeding the function a sample string.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;([a-z] ) &amp;quot;&#039;&#039;&#039; Your regular expression.&lt;br /&gt;
&lt;br /&gt;
Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? &lt;br /&gt;
&#039;&#039;&#039;The Parenthesis ():&#039;&#039;&#039; Tell the function this is a group of characters.&lt;br /&gt;
&#039;&#039;&#039;[a-z]:&#039;&#039;&#039; Tell us they will be lower case letters.&lt;br /&gt;
&#039;&#039;&#039; :&#039;&#039;&#039; Tell us to look for one or more characters.&lt;br /&gt;
That space between the ) and &amp;quot; Tells us the pattern ends in a space.&lt;br /&gt;
&lt;br /&gt;
Thus reading down the string.&lt;br /&gt;
T = Does not match [a-z] is a capital letter.&lt;br /&gt;
h = Matches [a-z]. Starting Group&lt;br /&gt;
i = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. First group found and is &amp;quot;his &amp;quot;&lt;br /&gt;
i = Matches [a-z]. Starting Group&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. Second group found, and is &amp;quot;is &amp;quot;&lt;br /&gt;
a = Matches [a-z]. Starting Group&lt;br /&gt;
  = Matches space. Third group found, and is &amp;quot;a &amp;quot;&lt;br /&gt;
t = Matches [a-z]. Starting Group&lt;br /&gt;
e = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
t = Matches [a-z]&lt;br /&gt;
End of line. No more matches. Stop.&lt;br /&gt;
&lt;br /&gt;
Thus, trusting the post, the map would be:&lt;br /&gt;
&lt;br /&gt;
test[0][0] =&amp;gt; &amp;quot;his &amp;quot;&lt;br /&gt;
test[0][1] =&amp;gt; &amp;quot;his&amp;quot;&lt;br /&gt;
test[1][0] =&amp;gt; &amp;quot;is &amp;quot;&lt;br /&gt;
test[1][1] =&amp;gt; &amp;quot;is&amp;quot;&lt;br /&gt;
test[2][0] =&amp;gt; &amp;quot;a &amp;quot;&lt;br /&gt;
test[2][1] =&amp;gt; &amp;quot;a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I personally haven&#039;t used it. Would be used in parsing a page by hand.&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=982</id>
		<title>Miscellaneous Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=982"/>
		<updated>2007-09-24T14:54:17Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part 7 - Miscellaneous ==&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Mostly internal stuff. Some good for everyone, some only for ASH wizards.&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void print( string helloworld )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Prints the given string to the graphical CLI window and to the status line of the main Adventuring window&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean cli_execute( string command )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Executes the given command as if it were entered into the graphical CLI window. This can be used for CLI commands or, if you&amp;amp;#8217;re careful and not an asshat, for raw URLs.&amp;lt;br /&amp;gt;&lt;br /&gt;
See the [http://kolmafia.sourceforge.net/scripting.html CLI manual] for more details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;Sample&amp;lt;/em&amp;gt;:[[%28ASHRM%29_Code_Samples#Sample_4:_Hedging|Hedging]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void wait( int delay )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does nothing for the desired number of seconds.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string get_property( string key )&amp;lt;br /&amp;gt;&lt;br /&gt;
boolean set_property( string key, string value )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Gets or sets a stored property from your character&amp;amp;#8217;s .kcs file.&amp;lt;br /&amp;gt;&lt;br /&gt;
The KoLmafia [[%28ASHRM%29_KoLMafia_Properties|properties]] page contains details on many of the keys that are available for access.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;Sample&amp;lt;/em&amp;gt;:[[%28ASHRM%29_Code_Samples#Sample_2:_Battlefield_gather|Battlefield_gather]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean file_to_map( string file_to_load, map map_to_fill )&amp;lt;br /&amp;gt;&lt;br /&gt;
boolean map_to_file( map map_to_save, string file_to_write )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Loads and saves maps as tab-delimited text files.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int random( int range )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Generates a random integer between 0 and (range-1) inclusive.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int round( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int floor( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int ceil( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int truncate( float ratio )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns an integer near the given real number.  Respectively, it returns the nearest, next lowest, next highest, and decimal-stripped integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int count( map )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns the number of defined keys for the aggregate.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void clear( map )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Remove all keys from a map. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void disable( string function_name )&amp;lt;br /&amp;gt;&lt;br /&gt;
void enable( string function_name )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
For debugging purposes disables or enables the indicated function&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;float square_root( float value )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
returns the square root of the passed value&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string today_to_string()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns today&amp;amp;#8217;s (real-world) date in the form yyyymmdd.  It is based on your computer&amp;amp;#8217;s system date&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2084</id>
		<title>Talk:String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2084"/>
		<updated>2007-09-23T18:13:16Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: revert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So wtf does group_string actually do?  The linked &amp;quot;descriptive&amp;quot; post has an utterly unhelpful example.  Has anyone ever used it for anything?&lt;br /&gt;
&lt;br /&gt;
Groups a string into a map using a regular expression. To understand the function you must know.&lt;br /&gt;
1. What maps are and how they are used.&lt;br /&gt;
2. Understand what regular expressions are and how to create them.&lt;br /&gt;
&lt;br /&gt;
Using the original post:&lt;br /&gt;
&lt;br /&gt;
FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )&lt;br /&gt;
EXAMPLE: string [int,int] test = group_string( &amp;quot;This is a test&amp;quot;, &amp;quot;([a-z] ) &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Example Breakdown:&lt;br /&gt;
&#039;&#039;&#039;string [int,int]&#039;&#039;&#039; Define a map. Two dimensional. The indices are integers. The data is stored as a string.&lt;br /&gt;
&#039;&#039;&#039;test&#039;&#039;&#039; Define the map with name &#039;&#039;&#039;test&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;group_string&#039;&#039;&#039; Call the function.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;This is a Test&amp;quot;&#039;&#039;&#039; Feeding the function a sample string.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;([a-z] ) &amp;quot;&#039;&#039;&#039; Your regular expression.&lt;br /&gt;
&lt;br /&gt;
Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? &lt;br /&gt;
&#039;&#039;&#039;The Parenthesis ():&#039;&#039;&#039; Tell the function this is a group of characters.&lt;br /&gt;
&#039;&#039;&#039;[a-z]:&#039;&#039;&#039; Tell us they will be lower case letters.&lt;br /&gt;
&#039;&#039;&#039; :&#039;&#039;&#039; Tell us to look for one or more characters.&lt;br /&gt;
That space between the ) and &amp;quot; Tells us the pattern ends in a space.&lt;br /&gt;
&lt;br /&gt;
Thus reading down the string.&lt;br /&gt;
T = Does not match [a-z] is a capital letter.&lt;br /&gt;
h = Matches [a-z]. Starting Group&lt;br /&gt;
i = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. First group found and is &amp;quot;his &amp;quot;&lt;br /&gt;
i = Matches [a-z]. Starting Group&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. Second group found, and is &amp;quot;is &amp;quot;&lt;br /&gt;
a = Matches [a-z]. Starting Group&lt;br /&gt;
  = Matches space. Third group found, and is &amp;quot;a &amp;quot;&lt;br /&gt;
t = Matches [a-z]. Starting Group&lt;br /&gt;
e = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
t = Matches [a-z]&lt;br /&gt;
End of line. No more matches. Stop.&lt;br /&gt;
&lt;br /&gt;
Thus, trusting the post, the map would be:&lt;br /&gt;
&lt;br /&gt;
test[0][0] =&amp;gt; &amp;quot;his &amp;quot;&lt;br /&gt;
test[0][1] =&amp;gt; &amp;quot;his&amp;quot;&lt;br /&gt;
test[1][0] =&amp;gt; &amp;quot;is &amp;quot;&lt;br /&gt;
test[1][1] =&amp;gt; &amp;quot;is&amp;quot;&lt;br /&gt;
test[2][0] =&amp;gt; &amp;quot;a &amp;quot;&lt;br /&gt;
test[2][1] =&amp;gt; &amp;quot;a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I personally haven&#039;t used it. Would be used in parsing a page by hand.&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2082</id>
		<title>Talk:String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2082"/>
		<updated>2007-09-22T13:32:13Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: revert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So wtf does group_string actually do?  The linked &amp;quot;descriptive&amp;quot; post has an utterly unhelpful example.  Has anyone ever used it for anything?&lt;br /&gt;
&lt;br /&gt;
Groups a string into a map using a regular expression. To understand the function you must know.&lt;br /&gt;
1. What maps are and how they are used.&lt;br /&gt;
2. Understand what regular expressions are and how to create them.&lt;br /&gt;
&lt;br /&gt;
Using the original post:&lt;br /&gt;
&lt;br /&gt;
FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )&lt;br /&gt;
EXAMPLE: string [int,int] test = group_string( &amp;quot;This is a test&amp;quot;, &amp;quot;([a-z] ) &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Example Breakdown:&lt;br /&gt;
&#039;&#039;&#039;string [int,int]&#039;&#039;&#039; Define a map. Two dimensional. The indices are integers. The data is stored as a string.&lt;br /&gt;
&#039;&#039;&#039;test&#039;&#039;&#039; Define the map with name &#039;&#039;&#039;test&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;group_string&#039;&#039;&#039; Call the function.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;This is a Test&amp;quot;&#039;&#039;&#039; Feeding the function a sample string.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;([a-z] ) &amp;quot;&#039;&#039;&#039; Your regular expression.&lt;br /&gt;
&lt;br /&gt;
Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? &lt;br /&gt;
&#039;&#039;&#039;The Parenthesis ():&#039;&#039;&#039; Tell the function this is a group of characters.&lt;br /&gt;
&#039;&#039;&#039;[a-z]:&#039;&#039;&#039; Tell us they will be lower case letters.&lt;br /&gt;
&#039;&#039;&#039; :&#039;&#039;&#039; Tell us to look for one or more characters.&lt;br /&gt;
That space between the ) and &amp;quot; Tells us the pattern ends in a space.&lt;br /&gt;
&lt;br /&gt;
Thus reading down the string.&lt;br /&gt;
T = Does not match [a-z] is a capital letter.&lt;br /&gt;
h = Matches [a-z]. Starting Group&lt;br /&gt;
i = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. First group found and is &amp;quot;his &amp;quot;&lt;br /&gt;
i = Matches [a-z]. Starting Group&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. Second group found, and is &amp;quot;is &amp;quot;&lt;br /&gt;
a = Matches [a-z]. Starting Group&lt;br /&gt;
  = Matches space. Third group found, and is &amp;quot;a &amp;quot;&lt;br /&gt;
t = Matches [a-z]. Starting Group&lt;br /&gt;
e = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
t = Matches [a-z]&lt;br /&gt;
End of line. No more matches. Stop.&lt;br /&gt;
&lt;br /&gt;
Thus, trusting the post, the map would be:&lt;br /&gt;
&lt;br /&gt;
test[0][0] =&amp;gt; &amp;quot;his &amp;quot;&lt;br /&gt;
test[0][1] =&amp;gt; &amp;quot;his&amp;quot;&lt;br /&gt;
test[1][0] =&amp;gt; &amp;quot;is &amp;quot;&lt;br /&gt;
test[1][1] =&amp;gt; &amp;quot;is&amp;quot;&lt;br /&gt;
test[2][0] =&amp;gt; &amp;quot;a &amp;quot;&lt;br /&gt;
test[2][1] =&amp;gt; &amp;quot;a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I personally haven&#039;t used it. Would be used in parsing a page by hand.&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Main_Page&amp;diff=184</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Main_Page&amp;diff=184"/>
		<updated>2007-09-22T13:31:19Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: revert from spam&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the KoLmafia Wiki.&lt;br /&gt;
&lt;br /&gt;
Please pardon our dust while we remodel.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Progress level: [[Special:Statistics|{{NUMBEROFARTICLES}}]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width:80%;margin-top: .7em;background-color:#F4DF3B;border:2px solid #8663A8&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td class=&amp;quot;box_tgen&amp;quot; style=&amp;quot;text-align:center;color:#000;font-size:90%;border:none;margin: 0;padding:.1em;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Quick Links:&#039;&#039;&#039; &amp;lt;br&amp;gt; [[Your Character]] || [[Item Management]] || [[Equipment]] || [[Skills and Effects]] || [[Adventuring]] || [[In-combat functions for consult scripting]] || [[Miscellaneous]]  || [[String Handling Routines]] || [[Datatype Constants]] || [[Datatype Conversions]] || [[KoLmafia Properties]] || [[Code Samples]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Helpful Links ==&lt;br /&gt;
&lt;br /&gt;
KoLMafia:&lt;br /&gt;
&lt;br /&gt;
[http://kolmafia.sourceforge.net Download KoLMafia]&lt;br /&gt;
&lt;br /&gt;
[http://kolmafia.sourceforge.net/manual.html KoLMafia Documentation]&lt;br /&gt;
&lt;br /&gt;
[http://kolmafia.sourceforge.net/scripting.html CLI Scripting Manual]&lt;br /&gt;
&lt;br /&gt;
[http://kolmafia.sourceforge.net/advanced.html ASH Scripting Manual]&lt;br /&gt;
&lt;br /&gt;
[http://kolmafia.sourceforge.net/combat.html Custom Combat Scripting Manual]&lt;br /&gt;
&lt;br /&gt;
[http://www.kolmafia.us The KoLMafia Script Repository]&lt;br /&gt;
&lt;br /&gt;
[http://forums.kingdomofloathing.com/viewtopic.php?t=19779 The KoLMafia thread on the KoL Forums]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
KoL:&lt;br /&gt;
&lt;br /&gt;
[http://www.kingdomofloathing.com/ The Kingdom of Loathing]&lt;br /&gt;
&lt;br /&gt;
[http://forums.kingdomofloathing.com/ KoL Forums]&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2078</id>
		<title>Talk:String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Talk:String_Handling_Routines&amp;diff=2078"/>
		<updated>2007-09-21T17:04:02Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: revert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So wtf does group_string actually do?  The linked &amp;quot;descriptive&amp;quot; post has an utterly unhelpful example.  Has anyone ever used it for anything?&lt;br /&gt;
&lt;br /&gt;
Groups a string into a map using a regular expression. To understand the function you must know.&lt;br /&gt;
1. What maps are and how they are used.&lt;br /&gt;
2. Understand what regular expressions are and how to create them.&lt;br /&gt;
&lt;br /&gt;
Using the original post:&lt;br /&gt;
&lt;br /&gt;
FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )&lt;br /&gt;
EXAMPLE: string [int,int] test = group_string( &amp;quot;This is a test&amp;quot;, &amp;quot;([a-z]+) &amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Example Breakdown:&lt;br /&gt;
&#039;&#039;&#039;string [int,int]&#039;&#039;&#039; Define a map. Two dimensional. The indices are integers. The data is stored as a string.&lt;br /&gt;
&#039;&#039;&#039;test&#039;&#039;&#039; Define the map with name &#039;&#039;&#039;test&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;group_string&#039;&#039;&#039; Call the function.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;This is a Test&amp;quot;&#039;&#039;&#039; Feeding the function a sample string.&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;([a-z]+) &amp;quot;&#039;&#039;&#039; Your regular expression.&lt;br /&gt;
&lt;br /&gt;
Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? &lt;br /&gt;
&#039;&#039;&#039;The Parenthesis ():&#039;&#039;&#039; Tell the function this is a group of characters.&lt;br /&gt;
&#039;&#039;&#039;[a-z]:&#039;&#039;&#039; Tell us they will be lower case letters.&lt;br /&gt;
&#039;&#039;&#039;+:&#039;&#039;&#039; Tell us to look for one or more characters.&lt;br /&gt;
That space between the ) and &amp;quot; Tells us the pattern ends in a space.&lt;br /&gt;
&lt;br /&gt;
Thus reading down the string.&lt;br /&gt;
T = Does not match [a-z] is a capital letter.&lt;br /&gt;
h = Matches [a-z]. Starting Group&lt;br /&gt;
i = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. First group found and is &amp;quot;his &amp;quot;&lt;br /&gt;
i = Matches [a-z]. Starting Group&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
  = Matches space. Second group found, and is &amp;quot;is &amp;quot;&lt;br /&gt;
a = Matches [a-z]. Starting Group&lt;br /&gt;
  = Matches space. Third group found, and is &amp;quot;a &amp;quot;&lt;br /&gt;
t = Matches [a-z]. Starting Group&lt;br /&gt;
e = Matches [a-z]&lt;br /&gt;
s = Matches [a-z]&lt;br /&gt;
t = Matches [a-z]&lt;br /&gt;
End of line. No more matches. Stop.&lt;br /&gt;
&lt;br /&gt;
Thus, trusting the post, the map would be:&lt;br /&gt;
&lt;br /&gt;
test[0][0] =&amp;gt; &amp;quot;his &amp;quot;&lt;br /&gt;
test[0][1] =&amp;gt; &amp;quot;his&amp;quot;&lt;br /&gt;
test[1][0] =&amp;gt; &amp;quot;is &amp;quot;&lt;br /&gt;
test[1][1] =&amp;gt; &amp;quot;is&amp;quot;&lt;br /&gt;
test[2][0] =&amp;gt; &amp;quot;a &amp;quot;&lt;br /&gt;
test[2][1] =&amp;gt; &amp;quot;a&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I personally haven&#039;t used it. Would be used in parsing a page by hand.&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=976</id>
		<title>Miscellaneous Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=976"/>
		<updated>2007-09-21T16:29:30Z</updated>

		<summary type="html">&lt;p&gt;EEPiccolo: Revert&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part 7 - Miscellaneous ==&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Mostly internal stuff. Some good for everyone, some only for ASH wizards.&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void print( string helloworld )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Prints the given string to the graphical CLI window and to the status line of the main Adventuring window&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean cli_execute( string command )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Executes the given command as if it were entered into the graphical CLI window. This can be used for CLI commands or, if you&amp;amp;#8217;re careful and not an asshat, for raw URLs.&amp;lt;br /&amp;gt;&lt;br /&gt;
See the [http://kolmafia.sourceforge.net/scripting.html CLI manual] for more details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;Sample&amp;lt;/em&amp;gt;:[[%28ASHRM%29_Code_Samples#Sample_4:_Hedging|Hedging]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void wait( int delay )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Does nothing for the desired number of seconds.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string get_property( string key )&amp;lt;br /&amp;gt;&lt;br /&gt;
boolean set_property( string key, string value )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Gets or sets a stored property from your character&amp;amp;#8217;s .kcs file.&amp;lt;br /&amp;gt;&lt;br /&gt;
The KoLmafia [[%28ASHRM%29_KoLMafia_Properties|properties]] page contains details on many of the keys that are available for access.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;Sample&amp;lt;/em&amp;gt;:[[%28ASHRM%29_Code_Samples#Sample_2:_Battlefield_gather|Battlefield_gather]]&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean file_to_map( string file_to_load, map map_to_fill )&amp;lt;br /&amp;gt;&lt;br /&gt;
boolean map_to_file( map map_to_save, string file_to_write )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Loads and saves maps as tab-delimited text files.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int random( int range )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Generates a random integer between 0 and (range-1) inclusive.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int round( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int floor( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int ceil( float ratio )&amp;lt;br /&amp;gt;&lt;br /&gt;
int truncate( float ratio )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns an integer near the given real number.  Respectively, it returns the nearest, next lowest, next highest, and decimal-stripped integer.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int count( map )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns the number of defined keys for the aggregate.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void clear( map )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Remove all keys from a map. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;void disable( string function_name )&amp;lt;br /&amp;gt;&lt;br /&gt;
void enable( string function_name )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
For debugging purposes disables or enables the indicated function&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;float square_root( float value )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
returns the square root of the passed value&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string today_to_string()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns today&amp;amp;#8217;s (real-world) date in the form yyyymmdd.  It is based on your computer&amp;amp;#8217;s system date&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>EEPiccolo</name></author>
	</entry>
</feed>