Miscellaneous Functions

From Kolmafia
Revision as of 18:46, 4 March 2010 by imported>StDoodle
Jump to navigation Jump to search

void abort( [string] )

Aborts the current script with an optional message.

void print( string, [string] )

Prints to CLI and status line of Adventuring window, optionally in a specified color.

void print_html( string )

Prints to CLI, parsing any included html.

void logprint( string )

Prints to the session log.

boolean cli_execute( string )

Executes the given command as if it were entered into the CLI.

void wait( int )

Sleeps for the specified number of seconds.

string get_property( string )

Gets a global or user preference as appropriate.

string set_property( string )

Sets a global or user preference as appropriate.

void batch_open()

Used to mark the beginning of a block of functions to operate in batch mode (see page for batch_close() for details).

boolean batch_close()

Used to mark the end of a block of functions to operate in batch mode (see page for details).

boolean file_to_map( string, aggregate )

Loads a map from a tab-delimited text file.

boolean map_to_file( string, aggregate )

Saves a map to a tab-delimited text file.

int count( aggregate )

Returns the number of defined keys for the specified aggregate.

void clear( aggregate )

Removes all keys from the specified aggregate.

int random( int )

Generates a random integer between 0 and 1 less than the specified number, inlcusive (produces an error when supplied a value of 1).

{{Flink|int|ceil|float|desc=Returns the next highest value of the specified number as an integer (returns the number if integer form if decimal portion is equal to 0). {{Flink|int|floor|float|desc=Returns the next lowest value of the specified number as an integer (returns the number if integer form if decimal portion is equal to 0). {{Flink|int|truncate|float|desc=Returns the decimal-stripped value of the specified number as an integer (returns the number if integer form if decimal portion is equal to 0).

float square_root( float )

Returns the square root of the specified value.

void disable( string )

Disables the specified function (for debugging purposes).

void enable( string )

Enables the specified function (for debugging purposes).