<?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=165.190.46.113</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=165.190.46.113"/>
	<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Special:Contributions/165.190.46.113"/>
	<updated>2026-04-25T00:22:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=1112</id>
		<title>Miscellaneous Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=Miscellaneous_Functions&amp;diff=1112"/>
		<updated>2007-11-19T23:47:31Z</updated>

		<summary type="html">&lt;p&gt;165.190.46.113: Reverted to last good revision without spam&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 output )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;void print( string output, string color )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Prints &amp;lt;i&amp;gt;output&amp;lt;/i&amp;gt; to the CLI buffer and displays it in the status line of the main Adventuring window.  If &amp;lt;i&amp;gt;color&amp;lt;/i&amp;gt; is specified any HTML in &amp;lt;i&amp;gt;output&amp;lt;/i&amp;gt; is escaped and the string is wrapped in a font tag before being printed.&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&lt;/div&gt;</summary>
		<author><name>165.190.46.113</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=String_Handling_Routines&amp;diff=1341</id>
		<title>String Handling Routines</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=String_Handling_Routines&amp;diff=1341"/>
		<updated>2007-11-19T23:45:27Z</updated>

		<summary type="html">&lt;p&gt;165.190.46.113: Removed spam&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part  8 - String Handling Routines ==&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Under Construction&amp;lt;/em&amp;gt;&amp;lt;/p&amp;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;
&amp;lt;strong&amp;gt;void echo( 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;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string visit_url( string url )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Accesses the specified URL, manages any applicable redirects (including if the page offered a choice adventure), and returns the HTML of the final response page.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string location_to_url( location place )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the URL that would need to be accessed to visit the specified location.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean contains_text( string source, string query )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Reveals if the query string is a substring of the source string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int extract_meat( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the amount of meat contained in a string passed to it in integer format. For use in k-mail parsing. *Not for use on pending trades.*&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int [item] extract_items( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
takes the text you have provided and parses it for any items that KoLmafia would have found normally.  This means you have access to the built-in pluralization handler as well as the ability to NOT have to lookup description IDs or whatever other loops you had to use to access that information. For use in k-mail parsing. *Not for use on pending trades.*&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int length( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the length of the given string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int index_of( string source, string search )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the first index of a given substring in a string.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int index_of( string source, string search, int start )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the next index of a given substring in a string starting from the given position.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int last_index_of( string source, string search )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the last index of a given substring in a string.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string substring( string source, int startfrom )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns the substring of the given string starting from the given character position in the string, and ending at the last character.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string substring( string source, int start, int end )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the substring of the given string starting from the character position indicated by start in the string, and ending at the character position indicated by end.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string replace_string( string source, string search, string replace )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
searches the source string for the search string and replaces all instances with the replace string&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string url_encode( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string url_decode( string text )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Converts a string text into a formatted string for using with raw URLs or from a formatted string back into ÃÂÃÂ¢ÃÂÃÂÃÂÃÂnormalÃÂÃÂ¢ÃÂÃÂÃÂÃÂ text.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string [int] split_string( string source )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Returns a map of strings which is the passed string split into individual lines. Originally implemented for use when parsing session logs, but may see more uses in the future.&lt;br /&gt;
http://kolmafia.us/index.php/topic,794.msg3868.html#msg3868 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int] split_string( string source, string regex )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int,int] group_string( string source, string regex )&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
see this post located on the script repository for more information:  http://kolmafia.us/index.php/topic,451.msg2235.html#msg2235 &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;string [int] session_logs( string player, int day_count )&amp;lt;/strong&amp;gt;&lt;br /&gt;
Gives access to the session logs saved by kolmafia. More details will be added when this function&#039;s own page is written. For now, more extensive details can be found here: http://kolmafia.us/index.php/topic,794.msg3879.html#msg3879&lt;/div&gt;</summary>
		<author><name>165.190.46.113</name></author>
	</entry>
	<entry>
		<id>https://wiki.kolmafia.us/index.php?title=In-combat_Consulting&amp;diff=1585</id>
		<title>In-combat Consulting</title>
		<link rel="alternate" type="text/html" href="https://wiki.kolmafia.us/index.php?title=In-combat_Consulting&amp;diff=1585"/>
		<updated>2007-11-19T23:42:46Z</updated>

		<summary type="html">&lt;p&gt;165.190.46.113: Removed Spam&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Part 6 - In-combat functions for consulting scripting ==&lt;br /&gt;
These functions are for use when handling a battle in a script using your custom combat settings. There is very little documentation of how to do this, and for most people these functions are useless.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;string attack()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string runaway()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string use_skill(  skill touse )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string throw_item(  item tothrow )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;string throw_items(  item tothrow1,  item tothrow2 )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns a string containing the html response from sending the appropriate url request for the associated action while in battle.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean use_skill( int count, skill touse )&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Will loop the specified number of times using the specified skill, never reconsulting the script until the loop is complete. This function is handled differently when not in battle.&amp;lt;br /&amp;gt;&lt;br /&gt;
See [[Skills and Effects]]&amp;lt;/p&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;element monster_attack_element()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;element monster_defense_element()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
returns the element that the monster attacks with, or defends against accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;int monster_attack()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int monster_defense()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;int monster_hp()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
returns the (current?) attack, defense, and hp of the monster.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;boolean will_usually_miss()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;boolean will_usually_dodge()&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
returns if you will normally miss, or will usually be missed in battle.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>165.190.46.113</name></author>
	</entry>
</feed>