Miscellaneous Functions

From KoLMafia
Jump to: navigation, search

Chat Functions

voidchat_clan( string )

voidchat_clan( string, string )

Sends a message to clan chat.

voidchat_macro( string )

Submits a chat macro to KoL.

voidchat_notify( string, string )

Sends a notification to the player's own chat.

voidchat_private( string, string )

Sends a private message to another player.

booleanis_online( string )

Check to see if a player is online.

boolean [string] who_clan()

Returns a list of whom is in your clan and if they are in chat.

booleancan_faxbot( monster )

Check to see if a monster can be faxed.

booleanfaxbot( monster )

Attempts to receive a fax of a given monster.


Debugging Functions

voiddisable( string )

Disables the specified function.

voidenable( string )

Enables the specified function.

bufferload_html( string )

Works like visit_url(), but for debugging.

stringmake_url( string, boolean, boolean )

Crafts the URL to visit.


Map Management Functions

Note: Information about maps (including creating, assigning, and removing keys, can be found at Map Data Structures.

booleanfile_to_map( string, aggregate )

Loads a map from a tab-delimited text file.

booleanmap_to_file( aggregate, string )

Saves a map to a tab-delimited text file.

intcount( aggregate )

Returns the number of defined keys for the specified aggregate.

voidclear( aggregate )

Removes all keys from the specified aggregate.


Time Functions

stringformat_date_time( string, string, string )

Reformats dates.

int gameday_to_int()

Returns the current KoL date as an integer.

string gameday_to_string()

Returns the current KoL date as a string.

int gametime_to_int()

Returns the current KoL time in ms as an integer.

stringnow_to_string( string )

Returns current local time/date in SimpleDateFormat format.

string time_to_string()

Returns the current local time in HH:mm:ss z format.

string today_to_string()

Returns the current local day in ISO format.


SVN Functions

There is much additional information in the SVN Primer.

booleansvn_exists( string )

Returns true if a valid working copy named projectname exists in the svn/ folder.

booleansvn_at_head( string )

Returns true if projectname exists, is a valid working copy, and is currently at the same revision number as the repository.

recordsvn_info( string )

Returns a record containing additional information about the given projectname: svnurl, last author, last revision, last change date.


User Interaction

voidprint( string, [string] )

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

voidprint_html( string )

Prints to CLI, parsing any included html.

voidlogprint( string )

Prints to the session log.

voidwait( int )

voidwaitq( int )

Sleeps for the specified number of seconds.

booleanuser_confirm( string )

Allows user input in Y/N format.


Other Functions

voidabort( [string] )

Aborts the current script with an optional message.

booleancli_execute( string )

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

stringget_property( string )

Gets a global or user preference as appropriate.

voidset_property( string, 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).

int get_revision()

Returns the current KoLmafia revision number.

string get_version()

Returns the most recent KoLmafia version.

stringget_player_id( string )

Returns the user id number of a given player.

stringto_json( aggregate )

Converts a simple aggregate into JSON.


Additional functions that are considered not really to be ash functions are available in Misc ASH Features