Difference between revisions of "Miscellaneous Functions"

From Kolmafia
Jump to navigation Jump to search
(Add "gCLI Command Functions" section)
 
(161 intermediate revisions by 81 users not shown)
Line 1: Line 1:
[http://listoksana7777777.ifrance.com/content/depurazione.htm depurazione] [http://layaah.ifrance.com/resources/ivan-segreto3.html ivan segreto u] [http://ospanaova.ifrance.com/data/tps-ob/ tps ob] [http://essaenty.ifrance.com/godesberg/ godesberg] [http://ospanaova.ifrance.com/data/ret-ruiz/ ret ruiz] [http://emoser.ifrance.com/html/gardaland.htm gardaland] [http://alexright.ifrance.com/resources/telefoni-cordless11/ telefoni cordless siemens con segreteria] [http://essaenty.ifrance.com/gigabyte-matx/ gigabyte matx] [http://listoksana7777777.ifrance.com/content/router-adsl56.htm router adsl ethernet] [http://taelonmahal.ifrance.com/north-carolina1.htm north carolina] [http://looktaomyeyes.ifrance.com/lib/foto-tatoo/ foto tatoo] [http://emoser.ifrance.com/html/u-rise.htm u rise me up] [http://taelonmahal.ifrance.com/cuando-volveras14.htm cuando volveras rmx] [http://ivaneremin.ifrance.com/library/kardia-mou2.htm kardia mou min] [http://alexright.ifrance.com/resources/vairano/ vairano] [http://ivaneremin.ifrance.com/library/the-blood1.htm the blood feast] [http://gotka9a5.ifrance.com/lib/divan-dan.html divan dan] [http://ivaneremin.ifrance.com/library/tastiera-ex1.htm tastiera ex 100 logitech] [http://gotka9a5.ifrance.com/lib/neotion-box.html neotion box 3000] [http://looktaomyeyes.ifrance.com/lib/europe-and/ europe and italy] [http://backseatjesus.ifrance.com/description/lultima-freccia/ lultima freccia] [http://listoksana7777777.ifrance.com/content/service-manager.htm service manager italia (italia  nord)] [http://nazymaa92.ifrance.com/new/canion-glider/ canion glider] [http://elixer.ifrance.com/blog/european-concert7.html european concert 1994  claudio abbado] [http://layaah.ifrance.com/resources/cercasi-cani.html cercasi cani di razza] [http://alexright.ifrance.com/resources/miusicol/ miusicol] [http://miceaonmars.ifrance.com/data/copertine-giochi.htm copertine giochi ps2] [http://taelonmahal.ifrance.com/www-dammela.htm www dammela it] [http://kommersantid.ifrance.com/articles/notebook-borsa1/ notebook borsa wide 15 4] [http://usersanto.ifrance.com/lettini-bianco/ lettini bianco] [http://kommersantid.ifrance.com/articles/hemacandra/ hemacandra] [http://backseatjesus.ifrance.com/description/caratteri/ caratteri] [http://nazymaa92.ifrance.com/new/chessmaster2/ chessmaster] [http://looktaomyeyes.ifrance.com/lib/asrock-amd1/ asrock amd 754] [http://backseatjesus.ifrance.com/description/corse-biciclette/ corse biciclette] [http://nazymaa92.ifrance.com/new/programma-scaricare7/ programma scaricare canzoni] [http://taelonmahal.ifrance.com/trattori-carraro.htm trattori carraro] [http://backseatjesus.ifrance.com/description/music-box/ music box] [http://taelonmahal.ifrance.com/la-face.htm la face] [http://taelonmahal.ifrance.com/ventole-x2.htm ventole 12x12] [http://looktaomyeyes.ifrance.com/lib/vola-via/ vola via] [http://ospanaova.ifrance.com/data/asse-stiro5/ asse stiro polti] [http://miceaonmars.ifrance.com/data/lcd-braccio.htm lcd braccio] [http://looktaomyeyes.ifrance.com/lib/www-dardania/ www dardania de] [http://backseatjesus.ifrance.com/description/mx-pentax/ mx4 pentax] [http://kommersantid.ifrance.com/articles/oakley-unknown/ oakley unknown polarized] [http://looktaomyeyes.ifrance.com/lib/midi-di9/ midi di pace] [http://ivaneremin.ifrance.com/library/noleggio-porsche4.htm noleggio porsche torino] [http://ospanaova.ifrance.com/data/system-data/ system data center spa] [http://alexright.ifrance.com/resources/bottioni/ bottioni] [http://emoser.ifrance.com/html/crmen-electra.htm crmen electra] [http://gotka9a5.ifrance.com/lib/i-mode1.html i mode] [http://ospanaova.ifrance.com/data/curtains-fall/ curtains fall blue] [http://elixer.ifrance.com/blog/cantine-emilia.html cantine emilia romagna] [http://usersanto.ifrance.com/dwinger-edwin/ dwinger edwin erich] [http://layaah.ifrance.com/resources/the-hidden.html the hidden blade] [http://nazymaa92.ifrance.com/new/baker/ baker] [http://alexright.ifrance.com/resources/bubblegumclub/ bubblegumclub] [http://kommersantid.ifrance.com/articles/porta-da/ porta da calcetto] [http://essaenty.ifrance.com/viaggi-liguria/ viaggi liguria] [http://milaya8706.ifrance.com/topic/pajabi-mc.htm pajabi mc] [http://ospanaova.ifrance.com/data/mobile-giradischi/ mobile giradischi] [http://ivaneremin.ifrance.com/library/apple-computer1.htm apple computer macintosh] [http://gotka9a5.ifrance.com/lib/guida-programmi.html guida programmi tv] [http://ospanaova.ifrance.com/data/hp-compaq52/ hp compaq nx6110 hd 60gb] [http://layaah.ifrance.com/resources/allied-telesyn2.html allied telesyn] [http://usersanto.ifrance.com/Gommoni-usati1/ gommoni usati] [http://nazymaa92.ifrance.com/new/ibm3/ ibm 206] [http://looktaomyeyes.ifrance.com/lib/xeon-2/ xeon 3 6 ghz] [http://gotka9a5.ifrance.com/lib/consolo.html consolo] [http://milaya8706.ifrance.com/topic/babyliss-elettrostimolatori.htm babyliss elettrostimolatori] [http://taelonmahal.ifrance.com/spanking-video.htm spanking video gratis] [http://usersanto.ifrance.com/jaguar-xkr3/ jaguar xkr] [http://alexright.ifrance.com/resources/l-isola18/ l isola del tesoro vol 03] [http://looktaomyeyes.ifrance.com/lib/emrah/ emrah] [http://looktaomyeyes.ifrance.com/lib/bwww/ bwww] [http://ivaneremin.ifrance.com/library/ortf.htm ortf] [http://listoksana7777777.ifrance.com/content/polar-fs2.htm polar fs3] [http://usersanto.ifrance.com/fondotinta-dior/ fondotinta dior] [http://miceaonmars.ifrance.com/data/drakojan-skies.htm drakojan skies 2] [http://emoser.ifrance.com/html/caladium.htm caladium] [http://milaya8706.ifrance.com/topic/lynndie-england.htm lynndie england] [http://ospanaova.ifrance.com/data/beattle/ beattle] [http://elixer.ifrance.com/blog/risotto-d.html risotto d osteria] [http://layaah.ifrance.com/resources/musica-lupen.html musica lupen] [http://alexright.ifrance.com/resources/rain-down/ rain down on me] [http://listoksana7777777.ifrance.com/content/coolpix11.htm coolpix 3200] [http://kommersantid.ifrance.com/articles/porno-star8/ porno star it] [http://listoksana7777777.ifrance.com/content/scrivilo.htm scrivilo] [http://ivaneremin.ifrance.com/library/telemark.htm telemark] [http://milaya8706.ifrance.com/topic/donna-karan.htm donna karan] [http://essaenty.ifrance.com/salvi-enzo/ salvi enzo] [http://alexright.ifrance.com/resources/cantanti-c/ cantanti c] [http://emoser.ifrance.com/html/reed-exhibitions.htm reed exhibitions  jck] [http://emoser.ifrance.com/html/stampanti-a18.htm stampanti a3 inkjet epson r1800] [http://alexright.ifrance.com/resources/bbb1/ bbb3] [http://usersanto.ifrance.com/wrecker/ wrecker] [http://usersanto.ifrance.com/stampanti-laser55/ stampanti laser samsung 12] [http://miceaonmars.ifrance.com/data/katia-pedrotti4.htm katia pedrotti foto sexy nuda] [http://emoser.ifrance.com/html/corso-concorso.htm corso concorso dirigenti scolastici 2005] [http://recet-5.we.bs/small/giochi-di76.html giochi di ospedale] [http://drive-cool.we.bs/content/bmw-x16/ bmw x5 usati] [http://ladgao.ifrance.com/blog/bmt.html bmt] [http://marinakaup.ifrance.com/fotomoto/ fotomoto] [http://vbkittena.ifrance.com/new/ariu.html ariu] [http://roxyisthebest.ifrance.com/lib/p-i5.html p910 i] [http://dinakeldl.ifrance.com/blog/commento-dialogo/ commento dialogo natura islandese] [http://ladgao.ifrance.com/blog/www-cosmopolitan.html www cosmopolitan it] [http://seleda.ifrance.com/html/gigaset-a5/ gigaset a250] [http://trainedactor.we.bs/affitto-ufficio12/ affitto ufficio pescara] [http://recet-5.we.bs/small/pompino-di.html pompino di pamela] [http://karolan.we.bs/description/corso-ecdl.htm corso ecdl] [http://listlisay07.ifrance.com/data/tinu-veresezan.html tinu veresezan] [http://roxyisthebest.ifrance.com/lib/sharapova-maria.html sharapova maria] [http://seleda.ifrance.com/html/jambon-dardenne/ jambon dardenne] [http://ama-det.we.bs/articles/sexi-video1.html sexi video] [http://easy-riders-50.we.bs/new/baccala-alla.html baccala alla vicentina] [http://bitchybeauty.we.bs/topic/silmar-spa/ silmar spa] [http://soulreciever.we.bs/topic/telecamere-per1/ telecamere per videosorveglianza] [http://seleda.ifrance.com/html/tuttte-le/ tuttte le foto sexy esistenti] [http://trainedactor.we.bs/demi-moor/ demi moor] [http://recet-5.we.bs/small/il-trionfo4.html il trionfo del tempo e del disinganno] [http://vbkittena.ifrance.com/new/nikon-tele2.html nikon tele 3x] [http://bitchybeauty.we.bs/topic/adattatore-svideo2/ adattatore svideo rgb] [http://listlisay07.ifrance.com/data/toshiba26.html toshiba 700] [http://seleda.ifrance.com/html/giochi-neo/ giochi neo geo] [http://easy-riders-50.we.bs/new/ixus-iis2.html ixus iis] [http://demon-zloi.we.bs/articles/ibm1.htm ibm 2391] [http://drive-cool.we.bs/content/frankie-nrg/ frankie nrg mc] [http://izvestia-ru.we.bs/library/lingerie-francesina.html lingerie francesina] [http://listcool-girl.we.bs/data/lucchetti-.htm lucchetti  per bicicletta] [http://drive-cool.we.bs/content/una-vita5/ una vita in gioco] [http://marinakaup.ifrance.com/vidio/ vidio] [http://seleda.ifrance.com/html/teeth-whitening/ teeth whitening] [http://marinakaup.ifrance.com/nike-air64/ nike air 97 max] [http://manujoie.ifrance.com/styles/amigos-de/ amigos de internet] [http://dinakeldl.ifrance.com/blog/venta-del/ venta del quijote sl] [http://mike12394.we.bs/text/logitech7/ logitech 680] [http://vbkittena.ifrance.com/new/drivers-extrema.html drivers extrema 4000] [http://listlisay07.ifrance.com/data/guida-breve.html guida breve allo studio della letteratur] [http://roxyisthebest.ifrance.com/lib/rrb.html rrb] [http://idiotgrrl.jurnalist.biz/www-loghi.html www loghi it] [http://svetik876.we.bs/web/hd-ready1/ hd ready 1366x768] [http://manujoie.ifrance.com/styles/milupa-ha/ milupa ha] [http://vbkittena.ifrance.com/new/brother-tn4.html brother tn 8000] [http://vbkittena.ifrance.com/new/magia-riti1.html magia riti sul successo] [http://seleda.ifrance.com/html/cartoline-compleanno1/ cartoline compleanno] [http://easy-riders-50.we.bs/new/koh-tao.html koh tao] [http://listlisay07.ifrance.com/data/supporto-qtek2.html supporto qtek auto] [http://listlisay07.ifrance.com/data/liberta-al.html liberta al bano] [http://roxyisthebest.ifrance.com/lib/mp-stick1.html mp3 stick 1gb] [http://sasha-feather.contabil.org/description/anyplace-anytime.htm anyplace anytime anywhere mit kim wilde] [http://ama-det.we.bs/articles/nikon-mirino.html nikon mirino angolare] [http://listlisay07.ifrance.com/data/video-google.html video google] [http://vbkittena.ifrance.com/new/societa-di4.html societa di textile] [http://karolan.we.bs/description/sms-internet.htm sms internet] [http://easy-riders-50.we.bs/new/multi-mailer.html multi mailer] [http://roxyisthebest.ifrance.com/lib/irland.html irland] [http://trainedactor.we.bs/voli-per23/ voli per cuba] [http://seleda.ifrance.com/html/la-romana/ la romana] [http://karolan.we.bs/description/san-quirino.htm san quirino] [http://drive-cool.we.bs/content/samsung-clp5/ samsung clp510] [http://svetik876.we.bs/web/boom-mid/ boom mid anastacia] [http://manujoie.ifrance.com/styles/gt-racing/ gt racing] [http://bitchybeauty.we.bs/topic/warhammer-fantasy/ warhammer fantasy] [http://easy-riders-50.we.bs/new/a-15.html a 7 samsung] [http://karolan.we.bs/description/usb-driver6.htm usb driver c350] [http://easy-riders-50.we.bs/new/non-mi13.html non mi lo so spiegare] [http://drive-cool.we.bs/content/marrickville/ marrickville] [http://svetik876.we.bs/web/estrazione-superenalotto1/ estrazione superenalotto] [http://listcool-girl.we.bs/data/camini-metallici.htm camini metallici] [http://vbkittena.ifrance.com/new/fairchild-c.html fairchild c119] [http://ladgao.ifrance.com/blog/agp-x9.html agp 2x] [http://seleda.ifrance.com/html/gianni-dany3/ gianni dany napoli] [http://ladgao.ifrance.com/blog/el-cid1.html el cid  la leggenda] [http://dinakeldl.ifrance.com/blog/macelleria/ macelleria] [http://manujoie.ifrance.com/styles/foto-di343/ foto di britney spears] [http://demon-zloi.we.bs/articles/nissan-almera5.htm nissan almera tino] [http://recet-5.we.bs/small/coco-jambo.html coco jambo] [http://listcool-girl.we.bs/data/tracce-esame3.htm tracce esame matematica 2004] [http://seleda.ifrance.com/html/durata-tv/ durata tv al plasma] [http://izvestia-ru.we.bs/library/le-valse.html le valse d amelie] [http://soulreciever.we.bs/topic/giochi-sui/ giochi sui criceti] [http://easy-riders-50.we.bs/new/sms-gratis10.html sms gratis sunrise] [http://easy-riders-50.we.bs/new/saper-scrivere.html saper scrivere grazie] [http://manujoie.ifrance.com/styles/iriver-ifp16/ iriver ifp790] [http://marinakaup.ifrance.com/panasonic-dmcfxeg/ panasonic dmcfx7eg] [http://manujoie.ifrance.com/styles/soluzione-matematica/ soluzione matematica] [http://listlisay07.ifrance.com/data/morgan-il1.html morgan il pirata] [http://listlisay07.ifrance.com/data/giochi-per66.html giochi per cellulari] [http://demon-zloi.we.bs/articles/numeri-vodafone.htm numeri vodafone] [http://marinakaup.ifrance.com/ath/ ath] [http://dinakeldl.ifrance.com/blog/aiwa-radio/ aiwa radio] [http://trainedactor.we.bs/vitel-tsm/ vitel tsm100] [http://manujoie.ifrance.com/styles/bad-lands/ bad lands] [http://dinakeldl.ifrance.com/blog/bastie-boys/ bastie boys] [http://ladgao.ifrance.com/blog/sereupin.html sereupin] [http://recet-5.we.bs/small/jeans-miss1.html jeans miss sixty vita bassa] [http://marinakaup.ifrance.com/bomberman-tournament/ bomberman tournament] [http://marinakaup.ifrance.com/decoder-digitali9/ decoder digitali topfield] == 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