Miscellaneous Functions: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
Add "gCLI Command Functions" section
 
(277 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[http://gawelzba.t35.com/library/html/danzel.htm danzel] [http://coarmago.t35.com/content/view/scaffalature/ scaffalature] [http://coarmago.t35.com/content/view/twiddle-beats/ twiddle beats] [http://benevolently.freehostia.com/content/view/silicon-case/ silicon case s100] [http://beshennayabelka.freehostia.com/content/view/vacanza-vienna.htm vacanza vienna] [http://boreldar.t35.com/text/directory/sima-firenze.htm sima firenze] [http://saline-joy.freehostia.com/web/sony-davd.htm sony dav-d150] [http://boreldar.t35.com/text/directory/www-mns.htm www mns] [http://failtoexpress.freehostia.com/html/sena-tempo.htm sena tempo] [http://oedi.freehostia.com/text/directory/pan-jabi/ pan jabi] [http://huruple.125mb.com/text/directory/kit-veicolare/ kit veicolare nokia] [http://scaleslea.freewebpage.org/text/directory/bagno-fango/ bagno fango] [http://mauballe.125mb.com/web/arte-sonora/ arte sonora e visiva torino] [http://grahrens.125mb.com/view/new/ibiza-volo/ ibiza volo] [http://mauballe.125mb.com/web/sistema-operativo/ sistema operativo computadoras] [http://getraylo.freeweb7.com/img/styles/jane-fonda.htm jane fonda] [http://gawelzba.t35.com/library/html/iso-satellite.htm iso (satellite)] [http://oedi.freehostia.com/text/directory/y-sigo/ y sigo a ti paulina rubio] [http://flheddin.125mb.com/content/view/immagini-olimpiadi.htm immagini olimpiadi 2004] [http://licohwar.homeblock.com/library/html/vacanza-appartamento/ vacanza appartamento roma] [http://flheddin.125mb.com/content/view/powermust-ups.htm powermust ups 800 pro] [http://zoelverd.freeweb7.com/description/lib/scythe-ncu/ scythe ncu-2000] [http://licohwar.homeblock.com/library/html/samsung-vp/ samsung vp 110] [http://grahrens.125mb.com/view/new/gioco-con/ gioco con birilli] [http://zoelverd.freeweb7.com/description/lib/the-sims/ the sims ps2 videogiochi] [http://oedi.freehostia.com/text/directory/omosessuale/ omosessuale] [http://greensticky.freehostia.com/library/html/www-alongi/ www alongi it] [http://wainfan.t35.com/view/new/home-theatre.htm home theatre dvd lettore divx] [http://licohwar.homeblock.com/library/html/batteria-ibm/ batteria ibm thinkpad t20] [http://boreldar.t35.com/text/directory/festival-crociere.htm festival crociere] [http://failtoexpress.freehostia.com/html/the-best.htm the best of simple minds] [http://www.freewebtown.com/boogiejames/topic/dragonstea-din.htm dragonstea din tei o zon] [http://www.freewebtown.com/prncessprncipe/library/html/in-tutti.htm in tutti i miei giorni raf] [http://beshennayabelka.freehostia.com/content/view/www-hp.htm www hp com] [http://www.freewebtown.com/starbriteyellow/resources/articles/www-alicevip.htm www alicevip com] [http://selemku.t35.com/text/directory/cristallo-vetro.htm cristallo vetro altro arredamento] [http://oedi.freehostia.com/text/directory/revebebe/ revebebe] [http://huruple.125mb.com/text/directory/commando-zebra/ commando zebra] [http://boreldar.t35.com/text/directory/nino-scarico.htm nino scarico] [http://mcwardlo.t35.com/library/html/moon/ moon 5] [http://saline-joy.freehostia.com/web/maugeri.htm maugeri] [http://beshennayabelka.freehostia.com/content/view/distintivi-marina.htm distintivi marina militare] [http://boreldar.t35.com/text/directory/bischero.htm bischero] [http://getraylo.freeweb7.com/img/styles/congelatori-liebherr.htm congelatori liebherr] [http://mauballe.125mb.com/web/studio-immobiliare/ studio immobiliare brunelli] [http://selemku.t35.com/text/directory/ernia-del.htm ernia del disco in neurochirurgia] [http://mcwardlo.t35.com/library/html/disturbed-forsaken/ disturbed forsaken] [http://huruple.125mb.com/text/directory/riicerca/ riicerca] [http://www.freewebtown.com/starbriteyellow/resources/articles/mahj.htm mahj] [http://mauballe.125mb.com/web/pentium/ pentium 550] [http://flheddin.125mb.com/content/view/intel-prescott.htm intel prescott processori] [http://zoelverd.freeweb7.com/description/lib/wheda/ wheda] [http://benevolently.freehostia.com/content/view/siti-gratuiti/ siti gratuiti porno] [http://zoelverd.freeweb7.com/description/lib/aggiornamenti-cagliari/ aggiornamenti cagliari] [http://lorcaxon.homeblock.com/data/isola-dei/ isola dei famosi2] [http://lorcaxon.homeblock.com/data/orologio-vendita/ orologio vendita] [http://failtoexpress.freehostia.com/html/madoo-com.htm madoo com] [http://gawelzba.t35.com/library/html/giglio-infranto.htm giglio infranto] [http://failtoexpress.freehostia.com/html/preghiere-in.htm preghiere in latino] [http://benevolently.freehostia.com/content/view/la-manica/ la manica midi] [http://grahrens.125mb.com/view/new/hotel-livigno/ hotel livigno] [http://kopapguw.homeblock.com/topic/stampa-cd/ stampa cd rom] [http://beshennayabelka.freehostia.com/content/view/leona-johanson.htm leona johanson] [http://wainfan.t35.com/view/new/tavole-mistiche.htm tavole mistiche] [http://grahrens.125mb.com/view/new/www-globet/ www globet tv] [http://mcwardlo.t35.com/library/html/spirit-marte/ spirit marte] [http://getm0ney.freewebpage.org/lib/credem-mutuo/ credem mutuo] [http://mauballe.125mb.com/web/offerta-capo/ offerta capo verde] [http://getm0ney.freewebpage.org/lib/faxoutlook/ fax4outlook] [http://boreldar.t35.com/text/directory/romnesti.htm romnesti] [http://flheddin.125mb.com/content/view/i-midi.htm i midi de curtis] [http://mauballe.125mb.com/web/tariffe-parcheggio/ tariffe parcheggio] [http://oedi.freehostia.com/text/directory/crossfire-chrysler/ crossfire chrysler] [http://benevolently.freehostia.com/content/view/immagini-grand/ immagini grand theft auto san andreas] [http://grahrens.125mb.com/view/new/verme/ verme] [http://failtoexpress.freehostia.com/html/lettore-mp.htm lettore mp3 con radio e giochi] [http://saline-joy.freehostia.com/web/donne-inquiete.htm donne inquiete] [http://getm0ney.freewebpage.org/lib/bucetas/ bucetas] [http://selemku.t35.com/text/directory/old-woman.htm old woman sex] [http://kopapguw.homeblock.com/topic/insoliti/ insoliti] [http://flheddin.125mb.com/content/view/www-unifg.htm www unifg it] [http://mcwardlo.t35.com/library/html/gino-bramieri/ gino bramieri] [http://www.freewebtown.com/starbriteyellow/resources/articles/onitsuka-tiger.htm onitsuka tiger runspark] [http://kopapguw.homeblock.com/topic/inoki/ inoki] [http://flheddin.125mb.com/content/view/turn-me.htm turn me on dowland] [http://flheddin.125mb.com/content/view/baldoni-video.htm baldoni video] [http://getm0ney.freewebpage.org/lib/compatibile-lexmark/ compatibile lexmark] [http://getm0ney.freewebpage.org/lib/videos-de/ videos de floricienta y su banda] [http://getm0ney.freewebpage.org/lib/lettori-cd/ lettori cd aeron] [http://boreldar.t35.com/text/directory/roberto.htm roberto] [http://www.freewebtown.com/boogiejames/topic/le-rois.htm le rois du monde] [http://boreldar.t35.com/text/directory/spv-m.htm spv m500] [http://beshennayabelka.freehostia.com/content/view/sesy-girls.htm sesy girls] [http://licohwar.homeblock.com/library/html/televisore-con/ televisore con schermo piatto al plasma] [http://mauballe.125mb.com/web/eau-de/ eau de toilette opium] [http://saline-joy.freehostia.com/web/phpmyadmin.htm phpmyadmin] [http://huruple.125mb.com/text/directory/aass/ aass] [http://greensticky.freehostia.com/library/html/tavolino-tondo/ tavolino tondo] [http://benevolently.freehostia.com/content/view/aragoste/ aragoste] [http://benevolently.freehostia.com/content/view/pc-e/ p4c800 e] [http://boreldar.t35.com/text/directory/raccontami-renga.htm raccontami renga] [http://coarmago.t35.com/content/view/aspirapolvere-polti/ aspirapolvere polti] [http://coarmago.t35.com/content/view/microsoft-remote/ microsoft remote control] [http://selemku.t35.com/text/directory/ristoranti-dove.htm ristoranti dove si balla] [http://licohwar.homeblock.com/library/html/negozi-hi/ negozi hi fi cesena] [http://wainfan.t35.com/view/new/nikon-coolpix.htm nikon coolpix p1] [http://licohwar.homeblock.com/library/html/tranquilandia/ tranquilandia] [http://www.freewebtown.com/boogiejames/topic/grammatura.htm grammatura] [http://licohwar.homeblock.com/library/html/prenotazione-albergo/ prenotazione albergo online] [http://lorcaxon.homeblock.com/data/lumache-verona/ lumache verona] [http://huruple.125mb.com/text/directory/scene-sulla/ scene sulla mafia] [http://getraylo.freeweb7.com/img/styles/mario-rota.htm mario rota] [http://oedi.freehostia.com/text/directory/solo-musica/ solo musica] [http://gawelzba.t35.com/library/html/cattivi-ragazzi.htm cattivi ragazzi it] [http://failtoexpress.freehostia.com/html/centro-assistenza.htm centro assistenza ercsson palermo] [http://mcwardlo.t35.com/library/html/lg-dvd/ lg dvd vcr hd] [http://www.freewebtown.com/starbriteyellow/resources/articles/nel-duemila.htm nel duemila] [http://gawelzba.t35.com/library/html/cafiero.htm cafiero] [http://scaleslea.freewebpage.org/text/directory/mappa-nautiche/ mappa nautiche] [http://failtoexpress.freehostia.com/html/orari-autolinee.htm orari autolinee palermo siracusa] [http://greensticky.freehostia.com/library/html/cantante-qui/ cantante qui sconosciuta video scandalo] [http://mauballe.125mb.com/web/phil-collins/ phil collins. finally... the farewell tour] [http://selemku.t35.com/text/directory/pt-cruiser.htm pt cruiser a roma] [http://www.freewebtown.com/boogiejames/topic/e-chi.htm e chi ce lo fa fare] [http://kopapguw.homeblock.com/topic/chat-messanger/ chat messanger cellulare] [http://getm0ney.freewebpage.org/lib/cori-dello/ cori dello stadio] [http://zoelverd.freeweb7.com/description/lib/radeon-/ radeon 9550 128 bit] [http://kopapguw.homeblock.com/topic/lemon-tree/ lemon tree fool s garden] [http://huruple.125mb.com/text/directory/tatu-cantanti/ tatu cantanti immagini baci] [http://kopapguw.homeblock.com/topic/ferro-da/ ferro da stiro ariete stiromatic] [http://huruple.125mb.com/text/directory/te-canno/ te canno mai] [http://failtoexpress.freehostia.com/html/richi.htm richi] [http://getm0ney.freewebpage.org/lib/caccia-ottobre/ caccia ottobre rosso] [http://greensticky.freehostia.com/library/html/dizionario-hazon/ dizionario hazon] [http://lorcaxon.homeblock.com/data/mp-player/ mp3 player 512] [http://grahrens.125mb.com/view/new/dvdr-x/ dvd-r 8x verbatim printable] [http://failtoexpress.freehostia.com/html/oki.htm oki 5521] [http://www.freewebtown.com/prncessprncipe/library/html/to-nem.htm to nem ai] [http://kopapguw.homeblock.com/topic/www-mytmn/ www mytmn pt] [http://kopapguw.homeblock.com/topic/bobels/ bobels] [http://boreldar.t35.com/text/directory/trombate-con.htm trombate con cavalli] [http://greensticky.freehostia.com/library/html/tester-ph/ tester ph] [http://failtoexpress.freehostia.com/html/braun-oxyjet.htm braun oxyjet] [http://kopapguw.homeblock.com/topic/bancaintesa/ bancaintesa] [http://beshennayabelka.freehostia.com/content/view/deballage.htm deballage] [http://getm0ney.freewebpage.org/lib/testo-eminem/ testo eminem] [http://saline-joy.freehostia.com/web/civada.htm civada] [http://www.freewebtown.com/starbriteyellow/resources/articles/varacalli.htm varacalli] [http://huruple.125mb.com/text/directory/due-nella/ due nella folla] [http://getraylo.freeweb7.com/img/styles/navman.htm navman 4100] [http://flheddin.125mb.com/content/view/incontro-relazione.htm incontro relazione] [http://boreldar.t35.com/text/directory/tv-amstrad.htm tv amstrad 14] [http://grahrens.125mb.com/view/new/flashing/ flashing] [http://failtoexpress.freehostia.com/html/simon-james.htm simon james] [http://grahrens.125mb.com/view/new/audigy-video/ audigy video] [http://failtoexpress.freehostia.com/html/deejay-parade.htm deejay parade estate 2004] [http://failtoexpress.freehostia.com/html/fastweb-pagina.htm fastweb pagina iniziale] [http://lorcaxon.homeblock.com/data/isola-di/ isola di white] [http://kopapguw.homeblock.com/topic/rs-/ rs 60 e3] [http://www.freewebtown.com/prncessprncipe/library/html/box-.htm box 3 hd] [http://www.freewebtown.com/boogiejames/topic/nfren-m.htm nfren 190m1] [http://mcwardlo.t35.com/library/html/nino-d/ nino d angelo video] [http://www.freewebtown.com/boogiejames/topic/colonna-vertebrale.htm colonna vertebrale] [http://oedi.freehostia.com/text/directory/radio-sonnenschein/ radio sonnenschein] [http://saline-joy.freehostia.com/web/wnb.htm wnb] [http://saline-joy.freehostia.com/web/cats-eyes.htm cats eyes] [http://www.freewebtown.com/prncessprncipe/library/html/esame-maturita.htm esame maturita] [http://oedi.freehostia.com/text/directory/sogni-zie/ sogni zie] [http://kopapguw.homeblock.com/topic/esami-di/ esami di stato 2204] [http://failtoexpress.freehostia.com/html/foto-mi.htm foto mi sex] [http://scaleslea.freewebpage.org/text/directory/amateur-girl/ amateur girl] [http://selemku.t35.com/text/directory/condizionatore-portatile.htm condizionatore portatile split] [http://lorcaxon.homeblock.com/data/maiali/ maiali] [http://beshennayabelka.freehostia.com/content/view/cover-tech.htm cover tech srl] [http://kopapguw.homeblock.com/topic/home-theatre/ home theatre rds] [http://mcwardlo.t35.com/library/html/noleggio-camper/ noleggio camper sardegna] [http://licohwar.homeblock.com/library/html/bmw-td/ bmw td] [http://beshennayabelka.freehostia.com/content/view/banana.htm banana] [http://mcwardlo.t35.com/library/html/file-absat/ file absat ottobre] [http://flheddin.125mb.com/content/view/campionato-francese.htm campionato francese] [http://gawelzba.t35.com/library/html/game-bo.htm game bo] [http://www.freewebtown.com/starbriteyellow/resources/articles/flat-isdn.htm flat isdn] [http://www.freewebtown.com/boogiejames/topic/ultra-correction.htm ultra correction chanel] [http://lorcaxon.homeblock.com/data/nuovi-dettagli/ nuovi dettagli su zelda per gamecube] [http://licohwar.homeblock.com/library/html/ufficio-cuneo/ ufficio cuneo] [http://getraylo.freeweb7.com/img/styles/thousand-arms.htm thousand arms] [http://gawelzba.t35.com/library/html/bobbl.htm bobbl] [http://grahrens.125mb.com/view/new/terme-romane/ terme romane di catania] [http://mcwardlo.t35.com/library/html/la-locura/ la locura contigo si] [http://gawelzba.t35.com/library/html/shepard.htm shepard] [http://greensticky.freehostia.com/library/html/krawczyk-muniek/ krawczyk muniek] [http://www.freewebtown.com/starbriteyellow/resources/articles/rochesuryon-la.htm roche-sur-yon, la-] [http://lorcaxon.homeblock.com/data/kenwood-lettore/ kenwood lettore divx] [http://getraylo.freeweb7.com/img/styles/bidoncini.htm bidoncini] [http://getraylo.freeweb7.com/img/styles/moda-elegante.htm moda elegante] [http://www.freewebtown.com/starbriteyellow/resources/articles/jed.htm jed] [http://grahrens.125mb.com/view/new/cuore-pallido/ cuore pallido accordi] [http://huruple.125mb.com/text/directory/mila-shon/ mila shon anni 80] [http://grahrens.125mb.com/view/new/figa-bionda/ figa bionda] [http://kopapguw.homeblock.com/topic/guam-freddo/ guam freddo] == Part 6 - 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