Difference between revisions of "Miscellaneous Functions"

From Kolmafia
Jump to navigation Jump to search
(Add "gCLI Command Functions" section)
 
(152 intermediate revisions by 73 users not shown)
Line 1: Line 1:
[http://ammjong.50webs.com/web/morometzii.html morometzii] [http://piraticalman.50webs.com/yamaha-11.html yamaha  rxv450] [http://greenquotebook.50webs.com/appunti-algebra.htm appunti algebra] [http://mentalitch.50webs.com/topic/ferro-stiro13.htm ferro stiro vapore] [http://piraticalman.50webs.com/Porno-trans1.html porno trans] [http://rjdudak.50webs.com/description/web-sunat.htm web sunat] [http://eyeh8everywon.50webs.com/alfa-gtv6.htm alfa gtv turbo] [http://rzd.50webs.com/torino-cagliari/ torino cagliari] [http://vanatru.50webs.com/new/sunna/ sunna] [http://mirnaladonyax.50webs.com/data/bimbi-in.html bimbi in spiaggia] [http://mirnaladonyax.50webs.com/data/yashica-kyocera3.html yashica kyocera ez] [http://lavinyacreates.50webs.com/html/bobble-babble/ bobble babble] [http://amandab.50webs.com/blog/foto-delle4/ foto delle stars] [http://missmane.50webs.com/adsl-router23/ adsl router wifi] [http://piraticalman.50webs.com/sata-diamondmax.html sata diamondmax 16] [http://efrosine.50webs.com/directory/dvd-stampante/ dvd stampante] [http://viktoza.50webs.com/new/fax-telecom/ fax telecom raffaello] [http://vanatru.50webs.com/new/www-az/ www az it] [http://ammjong.50webs.com/web/caminetto-rustici.html caminetto rustici] [http://lavinyacreates.50webs.com/html/data-traveler4/ data traveler kingston 256 mb] [http://helenadole.50webs.com/bear-chare.htm bear chare] [http://viktoza.50webs.com/new/tsuruoka/ tsuruoka] [http://greenquotebook.50webs.com/dama-gratis.htm dama gratis] [http://amandab.50webs.com/blog/ragazzine-nude/ ragazzine nude] [http://viktoza.50webs.com/new/mentana-enrico/ mentana enrico] [http://rzd.50webs.com/fortron-w/ fortron 400w] [http://lesliesecho.50webs.com/fan-x1.html fan 80x80] [http://lesliesecho.50webs.com/vido-ostaggi.html vido ostaggi] [http://efrosine.50webs.com/directory/v-razr2/ v3 razr cellulari motorola] [http://lesliesecho.50webs.com/nvidia-fx9.html nvidia fx] [http://lesliesecho.50webs.com/trucchi-gta9.html trucchi gta3] [http://piraticalman.50webs.com/la-sorpresa1.html la sorpresa renga] [http://viktoza.50webs.com/new/tommy-vee18/ tommy vee selection] [http://deedeecam.50webs.com/blog/www-festivalbar2/ www festivalbar it backstage foto artist] [http://eyeh8everywon.50webs.com/sex-gratuit.htm sex gratuit] [http://eyeh8everywon.50webs.com/elvis-presley8.htm elvis presley aloha from hawaii] [http://eyeh8everywon.50webs.com/scala-milano.htm scala milano] [http://ammjong.50webs.com/web/commento-la.html commento la quiete dopo la tempesta] [http://rzd.50webs.com/table-tennis2/ table tennis ii ping pong] [http://mirnaladonyax.50webs.com/data/ultime-lettere1.html ultime lettere di ortis] [http://eyeh8everywon.50webs.com/lettore-cf1.htm lettore cf compact flash] [http://vanatru.50webs.com/new/www-sesso13/ www sesso spinto it] [http://efrosine.50webs.com/directory/volo-san6/ volo san donato milanese] [http://rzd.50webs.com/ferrara-hotel/ ferrara hotel] [http://lavinyacreates.50webs.com/html/operazione-desert/ operazione desert storm] [http://moxivad.50webs.com/web/lettore-divx42.html lettore divx amplificatore] [http://efrosine.50webs.com/directory/bud-spencer1/ bud spencer] [http://efrosine.50webs.com/directory/mooto-gp/ mooto gp] [http://lovereceiver.50webs.com/description/www8/ www 3] [http://mirnaladonyax.50webs.com/data/bubsy-d.html bubsy 3d] [http://rzd.50webs.com/inside/ inside] [http://moxivad.50webs.com/web/assicurazione-fabriano.html assicurazione fabriano] [http://missmane.50webs.com/ophelie/ ophelie] [http://missmane.50webs.com/la-luna19/ la luna stasera] [http://lesliesecho.50webs.com/emulatori-playstation1.html emulatori playstation] [http://ammjong.50webs.com/web/defecazione-sesso.html defecazione sesso] [http://eyeh8everywon.50webs.com/asus-ansli13.htm asus a8nsli premium nforce4 sli] [http://helenadole.50webs.com/il-romanzo6.htm il romanzo di lillian russell] [http://deedeecam.50webs.com/blog/freak-a/ freak a leek] [http://efrosine.50webs.com/directory/allestimenti-stand/ allestimenti stand fieristici] [http://missmane.50webs.com/vacanza-neve1/ vacanza neve montagna] [http://viktoza.50webs.com/new/dvd-25/ dvd 8 5gb] [http://missmane.50webs.com/testo-d1/ testo d legislativo 10 9 1991 n 303] [http://eyeh8everywon.50webs.com/camera-commercio6.htm camera commercio empoli] [http://viktoza.50webs.com/new/california-dei2/ california dei phantom] [http://missmane.50webs.com/www-meditel/ www meditel ma] [http://mentalitch.50webs.com/topic/preview-stampa.htm preview stampa vb] [http://moxivad.50webs.com/web/amore-maledetto.html amore maledetto] [http://mentalitch.50webs.com/topic/ronea.htm ronea] [http://kagomeshuko.50webs.com/text/stay-testo/ stay testo] [http://piraticalman.50webs.com/luomo-che21.html luomo che uccideva a sangue freddo] [http://efrosine.50webs.com/directory/kakawin/ kakawin] [http://rzd.50webs.com/irvin-goffman/ irvin goffman] [http://kagomeshuko.50webs.com/text/fido/ fido] [http://viktoza.50webs.com/new/e-lucean/ e lucean le stelle] [http://efrosine.50webs.com/directory/gioco-hapland/ gioco hapland] [http://mentalitch.50webs.com/topic/mondo-giochi.htm mondo giochi] [http://viktoza.50webs.com/new/gascoigne-george/ gascoigne george] [http://helenadole.50webs.com/elettrodi-elettrostimolatore.htm elettrodi elettrostimolatore] [http://ammjong.50webs.com/web/sculacciarla.html sculacciarla] [http://deedeecam.50webs.com/blog/dancing-in1/ dancing in the moodlight] [http://kagomeshuko.50webs.com/text/what-more1/ what more can i say] [http://viktoza.50webs.com/new/g-cellulari/ g7050 cellulari lg] [http://rzd.50webs.com/pabo/ pabo] [http://helenadole.50webs.com/dance-dance2.htm dance dance revolution extreme] [http://lavinyacreates.50webs.com/html/cd-key8/ cd key windows] [http://amandab.50webs.com/blog/epistolae-obscurorum/ epistolae obscurorum virorum] [http://rzd.50webs.com/www-kelkoo/ www kelkoo it] [http://deedeecam.50webs.com/blog/logitech-thx/ logitech thx] [http://missmane.50webs.com/fidati-di/ fidati di me laura pausini] [http://viktoza.50webs.com/new/tortello/ tortello] [http://eyeh8everywon.50webs.com/she-ll.htm she ll be loved] [http://amandab.50webs.com/blog/la-casa70/ la casa nella prateria] [http://amandab.50webs.com/blog/stampante-epson36/ stampante epson stylus 7800 pro] [http://greenquotebook.50webs.com/phuket-hotel.htm phuket hotel] [http://lavinyacreates.50webs.com/html/un-anno5/ un anno d amore turco] [http://lovereceiver.50webs.com/description/bliard/ bliard] [http://rjdudak.50webs.com/description/campionato-esteri.htm campionato esteri calcio] [http://missmane.50webs.com/www-cic/ www cic gc ca] [http://amandab.50webs.com/blog/wolfgang-reinhard/ wolfgang reinhard storia del potere] [http://xxiunicorn.50webs.com/lib/rover4.htm rover 100] [http://wannachange.50webs.com/content/un-amore12/ un amore senza fine] [http://greenpoint.50webs.com/html/estados-nayarit/ estados nayarit] [http://wannachange.50webs.com/content/poletti/ poletti] [http://greenpoint.50webs.com/html/scheda-madre23/ scheda madre scsi] [http://sirpengalot.50webs.com/heavy-gunner/ heavy gunner] [http://xxiunicorn.50webs.com/lib/forno-microonde4.htm forno microonde rex] [http://insomniashe.50webs.com/data/mamut-chiquitito/ mamut chiquitito] [http://annetinternet.50webs.com/lib/cassiopea.htm cassiopea] [http://nonsmoker.50webs.com/data/cd-giochi.htm cd giochi] [http://xxiunicorn.50webs.com/lib/photo-de3.htm photo de rock voisine] [http://greenpoint.50webs.com/html/vetreria-vetrate/ vetreria vetrate artistiche torri] [http://scruffytom.50webs.com/topic/ariston-atd.html ariston atd 104] [http://insomniashe.50webs.com/data/il-testo5/ il testo kevlar] [http://poetofdreams.50webs.com/blog/www-caltanisseta.html www caltanisseta it] [http://scruffytom.50webs.com/topic/golf-tdi9.html golf tdi 115 cv] [http://deeahblita.50webs.com/ws-mv/ ws 32m206v] [http://poetofdreams.50webs.com/blog/baldan-bembo.html baldan bembo] [http://agarvey.50webs.com/blog/lavoro-subordinato.htm lavoro subordinato] [http://watchmegirls.50webs.com/topic/risorsa-gratuita.htm risorsa gratuita webmaster] [http://jennygray.50webs.com/blog/sigla-tg/ sigla tg 4] [http://jennygray.50webs.com/blog/sfondi-gatto1/ sfondi gatto] [http://wannachange.50webs.com/content/simona-venture/ simona venture e stefano bettarini] [http://missirish9.50webs.com/xyq.htm xyq] [http://poetoams.50webs.com/web/liteon-sx/ liteon 852sx] [http://chaoticide.50webs.com/text/al-jazeera/ al jazeera net] [http://anga12.50webs.com/content/la-fidanzata/ la fidanzata] [http://watchmegirls.50webs.com/topic/valore-immobile.htm valore immobile] [http://revjo.50webs.com/view/onore-e2/ onore e fedelta] [http://xxiunicorn.50webs.com/lib/router-di.htm router di604] [http://almightyshippo.50webs.com/web/action-d.html action 3d] [http://deeahblita.50webs.com/calendari-arte/ calendari arte 2005] [http://jimmymnemonic.50webs.com/linksys-ag.html linksys ag241] [http://deeahblita.50webs.com/sodimm-ddr2/ sodimm ddr pc2100] [http://wannachange.50webs.com/content/delitti-senza/ delitti senza castigo] [http://chaoticide.50webs.com/text/philips-mp2/ philips mp3] [http://almightyshippo.50webs.com/web/keys-viaccess1.html keys viaccess seca] [http://watchmegirls.50webs.com/topic/classifiche-dei.htm classifiche dei dischi] [http://scruffytom.50webs.com/topic/cyt-cyt.html cyt cyt] [http://sirpengalot.50webs.com/norvegia-ristorante/ norvegia ristorante] [http://poetoams.50webs.com/web/toner-minolta1/ toner minolta 1200] [http://chaoticide.50webs.com/text/concorso-iscriviti/ concorso iscriviti vinci] [http://annetinternet.50webs.com/lib/prestito-frascati.htm prestito frascati] [http://jimmymnemonic.50webs.com/Fumetti-dragonball1.html fumetti dragonball xxx] [http://agarvey.50webs.com/blog/un-filmato.htm un filmato per advent rising] [http://insomniashe.50webs.com/data/nikon-fotocamera/ nikon fotocamera digitale] [http://scruffytom.50webs.com/topic/bluecity.html bluecity] [http://jimmymnemonic.50webs.com/ovatio-1.html ovatio 3 duo] [http://annetinternet.50webs.com/lib/nvidia-quadro4.htm nvidia quadro4 980 xgl] [http://agarvey.50webs.com/blog/hadhra.htm hadhra] [http://revjo.50webs.com/view/tv-14/ tv 21 pollici] [http://poetofdreams.50webs.com/blog/seno-liguori.html seno liguori] [http://sirpengalot.50webs.com/codice-delle/ codice delle assicurazione] [http://annetinternet.50webs.com/lib/great-smoky.htm great smoky mountains] [http://insomniashe.50webs.com/data/tienimi-con1/ tienimi con te baglioni] [http://watchmegirls.50webs.com/topic/forza-tutti.htm forza tutti all arrembaggio] [http://annetinternet.50webs.com/lib/auto-golf.htm auto golf a km zero padova e provincia] [http://jennygray.50webs.com/blog/i-pod3/ i pod mini] [http://xxiunicorn.50webs.com/lib/pioneer-vsxdk.htm pioneer vsxd514k] [http://agarvey.50webs.com/blog/mutu-laura.htm mutu laura andresan] [http://poetofdreams.50webs.com/blog/bach-.html bach 4 corda] [http://anga12.50webs.com/content/malinverno-costante/ malinverno costante] [http://sirpengalot.50webs.com/hd-maxtor6/ hd maxtor 40gb] [http://jennygray.50webs.com/blog/cuba-vacanze1/ cuba vacanze] [http://greenpoint.50webs.com/html/adriana-lima/ adriana lima sexi] [http://almightyshippo.50webs.com/web/delta-goodream.html delta goodream] [http://annetinternet.50webs.com/lib/ipod-gb.htm ipod 40gb] [http://chaoticide.50webs.com/text/invio-gratis/ invio gratis sms] [http://mingislazydork.50webs.com/opere-arte/ opere arte paleocristiana] [http://revjo.50webs.com/view/spartiti-modugno/ spartiti modugno] [http://jennygray.50webs.com/blog/himno-de1/ himno de la up] [http://sirpengalot.50webs.com/symantec-antivirus/ symantec antivirus 10] [http://watchmegirls.50webs.com/topic/saracca.htm saracca] [http://nonsmoker.50webs.com/data/oscure-presenze.htm oscure presenze a cold creek] [http://jimmymnemonic.50webs.com/sergio-campari.html sergio campari mi] [http://poetofdreams.50webs.com/blog/avc.html avc 1131] [http://deeahblita.50webs.com/gioco-delle1/ gioco delle biglie] [http://mingislazydork.50webs.com/hotel-maia/ hotel maia lido riccio] [http://revjo.50webs.com/view/mercatini-antiquariato/ mercatini antiquariato cecina] [http://missirish9.50webs.com/palmone-t1.htm palmone t5] [http://xxiunicorn.50webs.com/lib/mary-beth.htm mary beth] [http://anga12.50webs.com/content/itacare-brasile/ itacare brasile] [http://scruffytom.50webs.com/topic/nokia-90.html nokia 7710 tomtom 5] [http://scruffytom.50webs.com/topic/dvd-ram1.html dvd ram vergine] [http://jimmymnemonic.50webs.com/medical-house.html medical house accessori] [http://jimmymnemonic.50webs.com/sangha-haute.html sangha haute] [http://jennygray.50webs.com/blog/indispensabile/ indispensabile] [http://sirpengalot.50webs.com/addio-ventanni/ addio ventanni] [http://greenpoint.50webs.com/html/calamistro/ calamistro] [http://sirpengalot.50webs.com/lancia-delta/ lancia delta hf turbo integrale] [http://insomniashe.50webs.com/data/rex-rd3/ rex rd 165 d] [http://jennygray.50webs.com/blog/cecile-minibus/ cecile minibus] [http://revjo.50webs.com/view/come-da/ come da foto] [http://poetofdreams.50webs.com/blog/kagul.html kagul] [http://deeahblita.50webs.com/adobe-acrobat/ adobe acrobat 7 professional] [http://poetofdreams.50webs.com/blog/revit.html revit] [http://revjo.50webs.com/view/tavoletta-grafica5/ tavoletta grafica mac] [http://deeahblita.50webs.com/aleixandre-vicente/ aleixandre vicente] [http://wannachange.50webs.com/content/hotel-brescia/ hotel brescia] [http://jimmymnemonic.50webs.com/il-sogno3.html il sogno ceco] == 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 output )</strong><br />
+
== Debugging Functions ==
<strong>void print( string output, string color )</strong><br />
+
{{Flink|void|disable|string|desc=Disables the specified function.}}
Prints <i>output</i> to the CLI buffer and displays it in the status line of the main Adventuring window.  If <i>color</i> is specified any HTML in <i>output</i> is escaped and the string is wrapped in a font tag before being printed.</p>
+
{{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