Difference between revisions of "Miscellaneous Functions"

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

Revision as of 16:59, 19 September 2007

Part 7 - Miscellaneous

Mostly internal stuff. Some good for everyone, some only for ASH wizards.

void print( string helloworld )
Prints the given string to the graphical CLI window and to the status line of the main Adventuring window

boolean cli_execute( string command )
Executes the given command as if it were entered into the graphical CLI window. This can be used for CLI commands or, if you’re careful and not an asshat, for raw URLs.
See the CLI manual for more details.
Sample:Hedging

void wait( int delay )
Does nothing for the desired number of seconds.

string get_property( string key )
boolean set_property( string key, string value )

Gets or sets a stored property from your character’s .kcs file.
The KoLmafia properties page contains details on many of the keys that are available for access.
Sample:Battlefield_gather

boolean file_to_map( string file_to_load, map map_to_fill )
boolean map_to_file( map map_to_save, string file_to_write )

Loads and saves maps as tab-delimited text files.

int random( int range )
Generates a random integer between 0 and (range-1) inclusive.

int round( float ratio )
int floor( float ratio )
int ceil( float ratio )
int truncate( float ratio )

Returns an integer near the given real number. Respectively, it returns the nearest, next lowest, next highest, and decimal-stripped integer.

int count( map )
Returns the number of defined keys for the aggregate.

void clear( map )
Remove all keys from a map.

void disable( string function_name )
void enable( string function_name )

For debugging purposes disables or enables the indicated function

float square_root( float value )
returns the square root of the passed value

string today_to_string()
Returns today’s (real-world) date in the form yyyymmdd. It is based on your computer’s system date