Miscellaneous Functions: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
Add "gCLI Command Functions" section
 
(224 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[http://aipir-ine.ifrance.com/hotel-cesena/ hotel cesena] [http://away-warf.ifrance.com/new/itinerari-irlanda/ itinerari irlanda] [http://luzerna-reviver.ifrance.com/text/ariston-incasso.htm ariston incasso lavastoviglie] [http://roma-uid.ifrance.com/lib/temi-svolti27.htm temi svolti] [http://away-warf.ifrance.com/new/martin-sheen/ martin sheen] [http://vlut-enya.ifrance.com/text/acer-42/ acer 19 lcd al1912] [http://corvisn-rnum.ifrance.com/lib/stampante-portatile1/ stampante portatile canon] [http://vlut-enya.ifrance.com/text/canzone-carmina/ canzone carmina] [http://lezew0our.ifrance.com/description/sea-lion.htm sea lion sas] [http://mise-efaith.ifrance.com/balme.htm balme] [http://rjste-boat.ifrance.com/articles/strategia-formativa/ strategia formativa libri] [http://rut-hete.ifrance.com/directory/registratore-video2.htm registratore video audio] [http://luzerna-reviver.ifrance.com/text/camera-innsbruck.htm camera innsbruck] [http://vlut-enya.ifrance.com/text/codacons-roma/ codacons roma benzina] [http://kzer-ncer.ifrance.com/library/televisori-al31.htm televisori al plasma 37 pollici] [http://mise-efaith.ifrance.com/shirer-william.htm shirer william lawrence] [http://lezew0our.ifrance.com/description/ferrari-immagini.htm ferrari immagini] [http://away-warf.ifrance.com/new/la-notte26/ la notte dei demoni] [http://mani-ndon.ifrance.com/new/testi-di37/ testi di grease in italiano] [http://tanya-abramova.ifrance.com/html/ragazze-perizoma/ ragazze perizoma] [http://mise-efaith.ifrance.com/vasilis-karras.htm vasilis karras] [http://luzerna-reviver.ifrance.com/text/tv-lcd114.htm tv lcd 17 hyundai] [http://dtyc-seti.ifrance.com/new/bomboniera-milano.htm bomboniera milano] [http://lezew0our.ifrance.com/description/prestito-capri.htm prestito capri] [http://mani-ndon.ifrance.com/new/ete-indien/ ete indien] [http://away-warf.ifrance.com/new/usumacinta/ usumacinta] [http://chri-ari.ifrance.com/directory/kyd.htm kyd] [http://pho-enixt.ifrance.com/styles/discorsi-hitler/ discorsi hitler] [http://luzerna-reviver.ifrance.com/text/lupo-2.htm lupo 1 4 tdi] [http://rjste-boat.ifrance.com/articles/ospedale-gradenigo/ ospedale gradenigo torino] [http://corvisn-rnum.ifrance.com/lib/e-sia/ e sia cosi] [http://luzerna-reviver.ifrance.com/text/vinovo.htm vinovo] [http://citize-snips.ifrance.com/blog/danger-zone1/ danger zone top gun] [http://kzer-ncer.ifrance.com/library/skinhead.htm skinhead] [http://tanya-abramova.ifrance.com/html/i-cavalieri13/ i cavalieri dello zodiaco  la leggenda] [http://lezew0our.ifrance.com/description/zuma-bear.htm zuma bear and cat] [http://corvisn-rnum.ifrance.com/lib/brocure/ brocure] [http://carolli-nne.ifrance.com/text/configurazione-computer/ configurazione computer] [http://lezew0our.ifrance.com/description/smell-like3.htm smell like teen spirits] [http://luzerna-reviver.ifrance.com/text/lago-di8.htm lago di como] [http://rjste-boat.ifrance.com/articles/la-notte28/ la notte del grande assalto] [http://rjste-boat.ifrance.com/articles/tarantola-origini/ tarantola origini] [http://mise-efaith.ifrance.com/modulo-memoria.htm modulo memoria 512 mb] [http://vlut-enya.ifrance.com/text/ketchup/ ketchup] [http://rut-hete.ifrance.com/directory/porno-annunci1.htm porno annunci] [http://citize-snips.ifrance.com/blog/cinquemiglia/ cinquemiglia] [http://rjste-boat.ifrance.com/articles/profumo-valentino/ profumo valentino classic] [http://rut-hete.ifrance.com/directory/i-banditi1.htm i banditi] [http://roma-uid.ifrance.com/lib/kit-piscina.htm kit piscina] [http://chri-ari.ifrance.com/directory/www-highschool.htm www highschool com] [http://mani-ndon.ifrance.com/new/supporto-auto12/ supporto auto accessori palmari 9090] [http://dtyc-seti.ifrance.com/new/massa-di.htm massa di somma] [http://aipir-ine.ifrance.com/rcm/ rcm] [http://aipir-ine.ifrance.com/nidi-aziendali/ nidi aziendali a verona] [http://pho-enixt.ifrance.com/styles/nazional-italiana/ nazional italiana] [http://corvisn-rnum.ifrance.com/lib/www-cartoon12/ www cartoon network com ar] [http://away-warf.ifrance.com/new/mac-donald1/ mac donald] [http://citize-snips.ifrance.com/blog/www-the13/ www the darkness] [http://carolli-nne.ifrance.com/text/kiko/ kiko] [http://lezew0our.ifrance.com/description/tv-usb4.htm tv usb digitale analogico] [http://tanya-abramova.ifrance.com/html/autocad-6/ autocad 2004 ita] [http://carolli-nne.ifrance.com/text/gambe-collant/ gambe collant] [http://rut-hete.ifrance.com/directory/lumix-dmc5.htm lumix dmc fz2] [http://mani-ndon.ifrance.com/new/cool-shen/ cool shen] [http://citize-snips.ifrance.com/blog/concorsi-per10/ concorsi per call center] [http://citize-snips.ifrance.com/blog/azione-immediata/ azione immediata] [http://vlut-enya.ifrance.com/text/anthoscopus/ anthoscopus] [http://carolli-nne.ifrance.com/text/lavorazioni-meccaniche2/ lavorazioni meccaniche] [http://carolli-nne.ifrance.com/text/launeddas/ launeddas] [http://vlut-enya.ifrance.com/text/canzone-juve/ canzone juve storia di un grande amore] [http://kzer-ncer.ifrance.com/library/defend-castel.htm defend castel] [http://leg-erasin.ifrance.com/description/enercom.htm enercom] [http://away-warf.ifrance.com/new/cassa-integrazione1/ cassa integrazione regolamento] [http://vlut-enya.ifrance.com/text/accessori-per36/ accessori per palmari m500] [http://corvisn-rnum.ifrance.com/lib/www-gruesom/ www gruesom videos com] [http://leg-erasin.ifrance.com/description/dvd-di1.htm dvd di pulizia] [http://rut-hete.ifrance.com/directory/www-il16.htm www il fiume po it] [http://aipir-ine.ifrance.com/tell-me5/ tell me why did fly away] [http://rut-hete.ifrance.com/directory/designers.htm designers] [http://mani-ndon.ifrance.com/new/mar-menor/ mar menor] [http://dtyc-seti.ifrance.com/new/fisio-cellulari.htm fisio cellulari philips] [http://rjste-boat.ifrance.com/articles/uso-capione/ uso capione] [http://leg-erin.ifrance.com/new/chat-singoli/ chat singoli] [http://vlut-enya.ifrance.com/text/floyd-cramer/ floyd cramer] [http://rut-hete.ifrance.com/directory/www-djtommyvee.htm www djtommyvee com] [http://kzer-ncer.ifrance.com/library/furto-contro.htm furto contro furto] [http://away-warf.ifrance.com/new/black-jack/ black jack off] [http://citize-snips.ifrance.com/blog/robbie-willians2/ robbie willians] [http://citize-snips.ifrance.com/blog/movimento-cantautori/ movimento cantautori] [http://corvisn-rnum.ifrance.com/lib/video-soldato/ video soldato americano] [http://roma-uid.ifrance.com/lib/samsung32.htm samsung 19] [http://mani-ndon.ifrance.com/new/radeon-x20/ radeon x850 xt platinum] [http://mani-ndon.ifrance.com/new/trekking-casio/ trekking casio orologi] [http://away-warf.ifrance.com/new/giochi-psp1/ giochi psp sony] [http://leg-erin.ifrance.com/new/bubbles-trouble/ bubbles trouble 2] [http://chri-ari.ifrance.com/directory/video-hard28.htm video hard con laura andresan] [http://mise-efaith.ifrance.com/sapphicerotica.htm sapphicerotica] [http://aipir-ine.ifrance.com/hobbies/ hobbies] [http://carolli-nne.ifrance.com/text/mp-prendimi/ mp3 prendimi renato zero] [http://carolli-nne.ifrance.com/text/celler/ celler 55] [http://tanya-abramova.ifrance.com/html/inquinamento-a/ inquinamento a kabul] [http://kzer-ncer.ifrance.com/library/laszlo.htm laszlo] [http://rjste-boat.ifrance.com/articles/una-patch7/ una patch anche per world war ii frontline command] [http://lezew0our.ifrance.com/description/stivali-paciotti1.htm stivali paciotti] [http://mani-ndon.ifrance.com/new/di-capri/ di capri] [http://corvisn-rnum.ifrance.com/lib/il-cavallo/ il cavallo dacciaio] [http://mani-ndon.ifrance.com/new/ups-i/ ups i did it again] [http://away-warf.ifrance.com/new/donald-ragazzo/ donald ragazzo] [http://corvisn-rnum.ifrance.com/lib/casio-qv1/ casio qv r62] [http://corvisn-rnum.ifrance.com/lib/ris-delitti/ ris delitti imperfetti] [http://pho-enixt.ifrance.com/styles/hp-93/ hp 6110 nx] [http://leg-erasin.ifrance.com/description/de-grenet2.htm de grenet topless] [http://corvisn-rnum.ifrance.com/lib/ati-controller/ ati controller] [http://leg-erin.ifrance.com/new/all-star12/ all star converse nero] [http://leg-erasin.ifrance.com/description/la-macchina7.htm la macchina nera] [http://dtyc-seti.ifrance.com/new/microsoft-xp2.htm microsoft xp pro ita oem] [http://kzer-ncer.ifrance.com/library/ingrassata.htm ingrassata] [http://chri-ari.ifrance.com/directory/wiv1.htm wiv] [http://away-warf.ifrance.com/new/chun-hsing/ chun hsing] [http://carolli-nne.ifrance.com/text/beretta-armi/ beretta armi] [http://citize-snips.ifrance.com/blog/idee-sui/ idee sui regali di natale] [http://vlut-enya.ifrance.com/text/foame/ foame] [http://vlut-enya.ifrance.com/text/fotocamera-amstrad/ fotocamera amstrad] [http://lezew0our.ifrance.com/description/televisore-portatile4.htm televisore portatile 6] [http://dtyc-seti.ifrance.com/new/nike-parfum.htm nike parfum] [http://rjste-boat.ifrance.com/articles/gina-lee1/ gina lee nolin] [http://carolli-nne.ifrance.com/text/fred-buscaglione/ fred buscaglione] [http://lezew0our.ifrance.com/description/dupree.htm dupree] [http://away-warf.ifrance.com/new/a-story/ a story of britain] [http://lezew0our.ifrance.com/description/finanziamento-rimini.htm finanziamento rimini] [http://away-warf.ifrance.com/new/osanna-he/ osanna he] [http://vlut-enya.ifrance.com/text/club-pive/ club pive veneto] [http://carolli-nne.ifrance.com/text/www-team/ www team cristo] [http://dtyc-seti.ifrance.com/new/piedi-video1.htm piedi video gratis] [http://roma-uid.ifrance.com/lib/mid-nait.htm mid nait clab] [http://rjste-boat.ifrance.com/articles/footprint/ footprint] [http://lezew0our.ifrance.com/description/enya-mp.htm enya mp3] [http://rut-hete.ifrance.com/directory/dissipatori-per8.htm dissipatori per p4 775] [http://leg-erasin.ifrance.com/description/telefonico.htm telefonico] [http://luzerna-reviver.ifrance.com/text/hsw-nokia.htm hs11w nokia] [http://pho-enixt.ifrance.com/styles/giacobbe/ giacobbe] [http://dtyc-seti.ifrance.com/new/piccole-anime.htm piccole anime] [http://citize-snips.ifrance.com/blog/la-donna57/ la donna ombra] [http://luzerna-reviver.ifrance.com/text/video-di90.htm video di britney spears] [http://chri-ari.ifrance.com/directory/la-canzone34.htm la canzone i giovani di jovanotti] [http://chri-ari.ifrance.com/directory/california-dreaming9.htm california dreaming royal] [http://chri-ari.ifrance.com/directory/negri.htm negri] [http://leg-erasin.ifrance.com/description/elenco-abbonati11.htm elenco abbonati nome anna] [http://aipir-ine.ifrance.com/recensioni-film1/ recensioni film] [http://leg-erin.ifrance.com/new/scacchiere/ scacchiere] [http://mise-efaith.ifrance.com/dolce-.htm dolce 6 gabbana] [http://vlut-enya.ifrance.com/text/poesie-sul1/ poesie sul natale] [http://dtyc-seti.ifrance.com/new/delta-airlines.htm delta airlines] [http://lezew0our.ifrance.com/description/pizzica-minore.htm pizzica minore] [http://lezew0our.ifrance.com/description/il-comandante.htm il comandante johnny] [http://luzerna-reviver.ifrance.com/text/www-truongton.htm www truongton net] [http://vlut-enya.ifrance.com/text/dragostei-din3/ dragostei din tei dj ross] [http://away-warf.ifrance.com/new/www-dj1/ www dj ralf it] [http://tanya-abramova.ifrance.com/html/eos-d15/ eos 20d corpo] [http://carolli-nne.ifrance.com/text/commento-e/ commento e parafrasi de lo giglio quand] [http://pho-enixt.ifrance.com/styles/volim-te/ volim te mrzim te] [http://corvisn-rnum.ifrance.com/lib/memory-di/ memory di barbara streisand] [http://leg-erasin.ifrance.com/description/parole-pigro.htm parole pigro pino daniele] [http://vlut-enya.ifrance.com/text/pottery-ancient/ pottery ancient roman] [http://roma-uid.ifrance.com/lib/un-paradiso.htm un paradiso senza biliardo] [http://chri-ari.ifrance.com/directory/jacksonville-hotel.htm jacksonville hotel] [http://chri-ari.ifrance.com/directory/philips-telecomando.htm philips telecomando universale] [http://rjste-boat.ifrance.com/articles/weekend-cowboy/ weekend cowboy] [http://aipir-ine.ifrance.com/maxtor-23/ maxtor 160 gb ata] [http://away-warf.ifrance.com/new/peppino-di5/ peppino di capri midi gratis] [http://away-warf.ifrance.com/new/bagno-turco2/ bagno turco milano] [http://mise-efaith.ifrance.com/panasonic-nvgsegs3.htm panasonic nvgs150egs] [http://corvisn-rnum.ifrance.com/lib/la-figlia19/ la figlia di dartagnan] [http://lezew0our.ifrance.com/description/truchi-counter.htm truchi counter strike] [http://tanya-abramova.ifrance.com/html/inni-e4/ inni e canti fascisti] [http://vlut-enya.ifrance.com/text/fanatica/ fanatica] [http://pho-enixt.ifrance.com/styles/drivers-webcam/ drivers webcam] [http://tanya-abramova.ifrance.com/html/www-lunapop/ www lunapop com] [http://roma-uid.ifrance.com/lib/soluzioni-chase.htm soluzioni chase the express] [http://mani-ndon.ifrance.com/new/jambo-bwana/ jambo bwana] [http://leg-erasin.ifrance.com/description/fare-qualcosa.htm fare qualcosa] [http://pho-enixt.ifrance.com/styles/sexercise/ sexercise] [http://away-warf.ifrance.com/new/www-clafoutis/ www clafoutis it] [http://carolli-nne.ifrance.com/text/gemini-cd/ gemini cd] [http://leg-erasin.ifrance.com/description/fiat-punto107.htm fiat punto sporting] [http://mise-efaith.ifrance.com/occasioni.htm occasioni] [http://vlut-enya.ifrance.com/text/calamo/ calamo] [http://corvisn-rnum.ifrance.com/lib/nina-sky4/ nina sky jabba] [http://away-warf.ifrance.com/new/cruciverba-sull/ cruciverba sull economia] [http://leg-erasin.ifrance.com/description/sussudio.htm sussudio] [http://kzer-ncer.ifrance.com/library/estee-lauder13.htm estee lauder daywear plus] [http://carolli-nne.ifrance.com/text/hair-styles/ hair styles] [http://roma-uid.ifrance.com/lib/wrestling-wwe1.htm wrestling wwe survivor series] [http://tanya-abramova.ifrance.com/html/ramla/ ramla] [http://citize-snips.ifrance.com/blog/dlink-dfw/ dlink dfw500] [http://rjste-boat.ifrance.com/articles/chaquira/ chaquira] [http://mise-efaith.ifrance.com/kit-casse1.htm kit casse sony] [http://vlut-enya.ifrance.com/text/la-giacca1/ la giacca rossa] [http://leg-erasin.ifrance.com/description/dvd-rip.htm dvd rip] [http://away-warf.ifrance.com/new/plotter-hp7/ plotter hp a0] == Part 7 - Miscellaneous ==
{{TOCright}}
<p><em>Mostly internal stuff. Some good for everyone, some only for ASH wizards.</em></p>
== Chat Functions ==
{{Flink|void|chat_clan|string}}
{{Flink|void|chat_clan|string|string|desc=Sends a message to clan chat.}}
{{Flink|void|chat_macro|string|desc=Submits a chat macro to KoL.}}
{{Flink|void|chat_notify|string|string|desc=Sends a notification to the player's own chat.}}
{{Flink|void|chat_private|string|string|desc=Sends a private message to another player.}}
{{Flink|boolean|is_online|string|desc=Check to see if a player is online.}}
{{Flink|boolean [string]|who_clan|desc=Returns a list of whom is in your clan and if they are in chat.}}
{{Flink|boolean|can_faxbot|monster|desc=Check to see if a monster can be faxed.}}
{{Flink|boolean|faxbot|monster|desc=Attempts to receive a fax of a given monster.}}


<p><strong>void print( string helloworld )</strong><br />
== Debugging Functions ==
Prints the given string to the graphical CLI window and to the status line of the main Adventuring window</p>
{{Flink|void|disable|string|desc=Disables the specified function.}}
{{Flink|void|enable|string|desc=Enables the specified function.}}
{{Flink|buffer|load_html|string|desc=Works like visit_url(), but for debugging.}}
{{Flink|string|make_url|string|boolean|boolean|desc=Crafts the URL to visit.}}


<p><strong>boolean cli_execute( string command )</strong><br />
== File Input/Output Functions ==
Executes the given command as if it were entered into the graphical CLI window. This can be used for CLI commands or, if you
{{FunctionEmbed|buffer_to_file|format=signature|desc=yes}}
{{FunctionEmbed|file_to_array|format=signature|desc=yes}}
{{FunctionEmbed|file_to_buffer|format=signature|desc=yes}}
{{Flink|boolean|file_to_map|string|aggregate|desc=Loads a map from a tab-delimited text file.}}
{{Flink|boolean|map_to_file|aggregate|string|desc=Saves a map to a tab-delimited text file.}}
 
== gCLI Command Functions ==
{{FunctionEmbed|cli_execute|format=signature|desc=yes}}
{{FunctionEmbed|cli_execute_output|format=signature|desc=yes}}
 
== Map Management Functions ==
''Note: Information about maps (including creating, assigning, and removing keys, can be found at [[Data Structures#Maps|Map Data Structures]].''
 
{{Flink|int|count|aggregate|desc=Returns the number of defined keys for the specified aggregate.}}
{{Flink|void|clear|aggregate|desc=Removes all keys from the specified aggregate.}}
 
== Time Functions ==
{{Flink|string|format_date_time|string|string|string|desc=Reformats dates.}}
{{Flink|int|gameday_to_int|desc=Returns the current KoL date as an integer.}}
{{Flink|string|gameday_to_string|desc=Returns the current KoL date as a string.}}
{{Flink|int|gametime_to_int|desc=Returns the current KoL time in ms as an integer.}}
{{Flink|string|now_to_string|string|desc=Returns current local time/date in SimpleDateFormat format.}}
{{Flink|string|time_to_string|desc=Returns the current local time in HH:mm:ss z format.}}
{{Flink|string|today_to_string|desc=Returns the current local day in ISO format.}}
 
== SVN Functions ==
''There is much additional information in the [[SVN Primer]]''.
{{Flink|boolean|svn_exists|string|desc=Returns true if a valid working copy named projectname exists in the svn/ folder.}}
{{Flink|boolean|svn_at_head|string|desc=Returns true if projectname exists, is a valid working copy, and is currently at the same revision number as the repository.}}
{{Flink|record|svn_info|string|desc=Returns a record containing additional information about the given projectname: svnurl, last author, last revision, last change date.}}
 
== User Interaction ==
{{Flink|void|print|string|{{opt|string}}|desc=Prints to CLI and status line of Adventuring window, optionally in a specified color.}}
{{Flink|void|print_html|string|desc=Prints to CLI, parsing any included html.}}
{{Flink|void|logprint|string|desc=Prints to the session log.}}
{{Flink|void|wait|int}}
{{Flink|void|waitq|int|desc=Sleeps for the specified number of seconds.}}
{{Flink|boolean|user_confirm|string|desc=Allows user input in Y/N format.}}
 
== Property Functions ==
{{Flink|boolean [string]|get_all_properties|string|boolean|desc=Returns a map of all user or global properties.}}
{{FunctionEmbed|property_exists|format=signature|desc=yes}}
{{FunctionEmbed|property_has_default|format=signature|desc=yes}}
{{FunctionEmbed|property_default_value|format=signature|desc=yes}}
{{Flink|string|get_property|string}}
{{Flink|string|get_property|string|boolean|desc=Gets a global or user preference as appropriate.}}
{{Flink|void|set_property|string|string|desc=Sets a global or user preference as appropriate.}}
{{FunctionEmbed|remove_property|format=signature|desc=yes}}
{{FunctionEmbed|rename_property|format=signature|desc=yes}}
 
== Other Functions ==
{{FunctionEmbed|abort|format=signature|desc=yes}}
{{FunctionEmbed|all_monsters_with_id|format=signature|desc=yes}}
{{Flink|void|batch_open|desc=Used to mark the beginning of a block of functions to operate in batch mode (see page for {{f|batch_close}} for details).}}
{{Flink|boolean|batch_close|desc=Used to mark the end of a block of functions to operate in batch mode (see page for details).}}
{{Flink|int|get_revision|desc=Returns the current KoLmafia revision number.}}
{{Flink|string|get_version|desc=Returns the most recent KoLmafia version.}}
{{Flink|string|get_player_id|string|desc=Returns the user id number of a given player.}}
{{FunctionEmbed|is_dark_mode|format=signature|desc=yes}}
{{Flink|string|to_json|aggregate|desc=Converts a simple aggregate into JSON.}}
 
Additional functions that are considered not really to be ash functions are available in [[Miscellaneous ASH Features#Special Syntax Functions|Misc ASH Features]]
 
[[Category:Scripting]]

Latest revision as of 14:55, 23 December 2020

Chat Functions

void chat_clan( string )

void chat_clan( string, string )

Sends a message to clan chat.

void chat_macro( string )

Submits a chat macro to KoL.

void chat_notify( string, string )

Sends a notification to the player's own chat.

void chat_private( string, string )

Sends a private message to another player.

boolean is_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.

boolean can_faxbot( monster )

Check to see if a monster can be faxed.

boolean faxbot( monster )

Attempts to receive a fax of a given monster.


Debugging Functions

void disable( string )

Disables the specified function.

void enable( string )

Enables the specified function.

buffer load_html( string )

Works like visit_url(), but for debugging.

string make_url( string, boolean, boolean )

Crafts the URL to visit.


File Input/Output Functions

boolean buffer_to_filebuffer, string )

Saves a buffer to a text file. Returns true on success, false on failure.

string [int] file_to_arraystring )

Reads data from a text file and returns a map of strings containing each line.

buffer file_to_bufferstring )

Loads the entire contents of a text file into a buffer.

boolean file_to_map( string, aggregate )

Loads a map from a tab-delimited text file.

boolean map_to_file( aggregate, string )

Saves a map to a tab-delimited text file.


gCLI Command Functions

boolean cli_executestring )

Executes a string as a gCLI command. Returns true on success, false on failure.

string cli_execute_outputstring )

Executes a gCLI command, capturing and returning the gCLI output.

Map Management Functions

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

int count( aggregate )

Returns the number of defined keys for the specified aggregate.

void clear( aggregate )

Removes all keys from the specified aggregate.


Time Functions

string format_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.

string now_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.

boolean svn_exists( string )

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

boolean svn_at_head( string )

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

record svn_info( string )

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


User Interaction

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.

void wait( int )

void waitq( int )

Sleeps for the specified number of seconds.

boolean user_confirm( string )

Allows user input in Y/N format.


Property Functions

boolean [string] get_all_properties( string, boolean )

Returns a map of all user or global properties.

boolean property_existsstring, boolean? )

Checks whether a property exists.

boolean property_has_defaultstring )

Checks if a property has a built-in default value.

string property_default_valuestring )

Returns the default value of a property, or an empty string if a default value does not exist.

string get_property( string )

string get_property( string, boolean )

Gets a global or user preference as appropriate.

void set_property( string, string )

Sets a global or user preference as appropriate.

string remove_propertystring, boolean? )

Removes or resets a property and returns its previous value.

boolean rename_propertystring, string )

Renames a property. Returns true on success, false on failure.

Other Functions

void abortstring? )

Immediately halts the current script and all queued functions.

boolean [monster] all_monsters_with_id()

Returns a map of all monsters that have a non-zero monster ID.

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.

string get_player_id( string )

Returns the user id number of a given player.

boolean is_dark_mode()

Checks if the current KoLmafia theme is dark mode.

string to_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