Difference between revisions of "Miscellaneous Functions"

From Kolmafia
Jump to navigation Jump to search
(Add "gCLI Command Functions" section)
 
(228 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[http://lokelseyn.ifrance.com/copertina-robbie/ copertina robbie williams] [http://bekleem.ifrance.com/content/la-gabbia1/ la gabbia mid] [http://maramsde.ifrance.com/directory/custodia-stagna/ custodia stagna] [http://bekleem.ifrance.com/content/gucci-cintura/ gucci cintura donna] [http://maramsde.ifrance.com/directory/batteria-cellulare4/ batteria cellulare sharp gx20] [http://nipierre.ifrance.com/articles/dj-danny.htm dj danny s] [http://mejordan.ifrance.com/bazzana.htm bazzana] [http://nipierre.ifrance.com/articles/jvc-uxg.htm jvc uxg1] [http://nipierre.ifrance.com/articles/val-d1.htm val d aosta] [http://nipierre.ifrance.com/articles/dunjo.htm dunjo] [http://maramsde.ifrance.com/directory/prezioso-feat1/ prezioso feat marvin] [http://maramsde.ifrance.com/directory/lezioni-damore/ lezioni damore alla svedese] [http://lokelseyn.ifrance.com/livorno-banche/ livorno banche] [http://mejordan.ifrance.com/persiane.htm persiane] [http://mejordan.ifrance.com/kighine.htm kighine] [http://mejordan.ifrance.com/haakon-vi.htm haakon vi] [http://lokelseyn.ifrance.com/what-a3/ what a wonderful world neil armstrong] [http://nipierre.ifrance.com/articles/dady-dj.htm dady dj] [http://veredda.ifrance.com/resources/ogr.htm ogr] [http://mejordan.ifrance.com/maglie-gucci.htm maglie gucci] [http://sthuckst.ifrance.com/xbox-champions/ xbox champions league 2005] [http://trermer.ifrance.com/small/goccie-di/ goccie di memoria] [http://lokelseyn.ifrance.com/brexton/ brexton] [http://nipierre.ifrance.com/articles/www-mte.htm www mte gov br] [http://mejordan.ifrance.com/fotos-de58.htm fotos de michelle viet] [http://lokelseyn.ifrance.com/sciopero-medici/ sciopero medici di famiglia] [http://nipierre.ifrance.com/articles/bicicletta-bmx.htm bicicletta bmx] [http://maramsde.ifrance.com/directory/auto-asus/ auto asus accessori palmari] [http://sthuckst.ifrance.com/agenzia-viaggio3/ agenzia viaggio blu vacanza] [http://lokelseyn.ifrance.com/staffa-plasma/ staffa plasma hitachi] [http://mejordan.ifrance.com/classifiche-del.htm classifiche del 1996] [http://bekleem.ifrance.com/content/friesche-eilanden/ friesche eilanden] [http://sthuckst.ifrance.com/biliardo-esplosivo/ biliardo esplosivo] [http://mejordan.ifrance.com/panasonic-gs4.htm panasonic gs70] [http://maramsde.ifrance.com/directory/handcap-legge/ handcap legge 104 92] [http://mejordan.ifrance.com/il-giardino11.htm il giardino di mezzanotte] [http://bekleem.ifrance.com/content/www-google12/ www google c0m pe] [http://maramsde.ifrance.com/directory/teresa-berganza/ teresa berganza] [http://sthuckst.ifrance.com/i-want4/ i want you elvis costello] [http://nipierre.ifrance.com/articles/immagini-grecia.htm immagini grecia antica] [http://bekleem.ifrance.com/content/toronto-ristorante/ toronto ristorante] [http://mejordan.ifrance.com/una-donna11.htm una donna per ringo] [http://bekleem.ifrance.com/content/af-nikon/ af nikon] [http://mejordan.ifrance.com/azur-culla.htm azur culla] [http://nipierre.ifrance.com/articles/lg-monitor2.htm lg monitor l1720b] [http://lokelseyn.ifrance.com/la-mascotte/ la mascotte dei diavoli blu] [http://mejordan.ifrance.com/router-cisco3.htm router cisco 827  4v] [http://bekleem.ifrance.com/content/fiat-punto37/ fiat punto td] [http://mejordan.ifrance.com/tv-combi2.htm tv combi samsung] [http://veredda.ifrance.com/resources/lettore-barcode1.htm lettore barcode] [http://maramsde.ifrance.com/directory/land-rover11/ land rover freelander verde] [http://trermer.ifrance.com/small/samsonite-spinner/ samsonite spinner] [http://maramsde.ifrance.com/directory/aspa/ aspa] [http://lokelseyn.ifrance.com/download-tardes/ download tardes negras mp3] [http://veredda.ifrance.com/resources/foto-seni.htm foto seni vip] [http://maramsde.ifrance.com/directory/piccolo-chopin/ piccolo chopin] [http://veredda.ifrance.com/resources/www-audi2.htm www audi italia com] [http://maramsde.ifrance.com/directory/performance-management/ performance management] [http://nipierre.ifrance.com/articles/elton-john5.htm elton john greatest hits] [http://lokelseyn.ifrance.com/porsche-boxster4/ porsche boxster s] [http://trermer.ifrance.com/small/gualdi/ gualdi] [http://nipierre.ifrance.com/articles/pornoclip.htm pornoclip] [http://veredda.ifrance.com/resources/lavanderia-self.htm lavanderia self service] [http://veredda.ifrance.com/resources/www-salgemma.htm www salgemma] [http://veredda.ifrance.com/resources/roraima-stato.htm roraima (stato)] [http://maramsde.ifrance.com/directory/preluders/ preluders] [http://mejordan.ifrance.com/tutti-i19.htm tutti i mami gratis] [http://bekleem.ifrance.com/content/jaguar-xk/ jaguar xk 1997] [http://bekleem.ifrance.com/content/samsung-clp2/ samsung clp] [http://trermer.ifrance.com/small/auto-a3/ auto a motore a scoppio] [http://lokelseyn.ifrance.com/we-are12/ we are the word] [http://maramsde.ifrance.com/directory/film-sesso/ film sesso] [http://lokelseyn.ifrance.com/desktop-pentium/ desktop pentium 4 2 80ghz] [http://trermer.ifrance.com/small/gabri-point/ gabri point] [http://nipierre.ifrance.com/articles/campeggi-villaggi.htm campeggi villaggi turistici] [http://maramsde.ifrance.com/directory/umfolozi-game/ umfolozi game reserve] [http://trermer.ifrance.com/small/hung-nhung/ hung nhung] [http://bekleem.ifrance.com/content/tri-band3/ tri band cellulari] [http://veredda.ifrance.com/resources/donne-altissime.htm donne altissime] [http://maramsde.ifrance.com/directory/management-risorse/ management risorse umane libri] [http://nipierre.ifrance.com/articles/granfield.htm granfield] [http://sthuckst.ifrance.com/vbdb/ vb5db] [http://lokelseyn.ifrance.com/hotmajl/ hotmajl] [http://sthuckst.ifrance.com/la-vedova2/ la vedova americana] [http://mejordan.ifrance.com/video-americano3.htm video americano condannato] [http://sthuckst.ifrance.com/dragostei/ dragostei] [http://sthuckst.ifrance.com/toner-hp16/ toner hp laserjet 3500] [http://sthuckst.ifrance.com/cisti/ cisti] [http://maramsde.ifrance.com/directory/marillion-tales/ marillion tales from the engine room] [http://trermer.ifrance.com/small/fucile-oleopneumatico/ fucile oleopneumatico] [http://trermer.ifrance.com/small/n-e2/ n e r d maybe] [http://maramsde.ifrance.com/directory/fotos-de51/ fotos de nodoubt] [http://veredda.ifrance.com/resources/storia-damore2.htm storia damore con delitto] [http://lokelseyn.ifrance.com/mario-brunello/ mario brunello cd musicali] [http://trermer.ifrance.com/small/fiction-noi/ fiction noi] [http://nipierre.ifrance.com/articles/radio-argentina.htm radio argentina] [http://bekleem.ifrance.com/content/sborrata-libera/ sborrata libera] [http://mejordan.ifrance.com/fernando.htm fernando] [http://veredda.ifrance.com/resources/www-aia.htm www aia spa it] [http://maramsde.ifrance.com/directory/mariti-inculati/ mariti inculati] [http://www.hiidenkivenpaivakoti.fi/help/new/jwbgoi.html Settimo cielo ostia] [http://www.worthwhilehosting.com/banners/auto/acsbxl.html Data recovery recupero dato] [http://www.worthwhilehosting.com/banners/auto/cuhoxq.html Myfirstsexteacher com] [http://www.startonlineweb.com/help/new/gmfpxm.html Horse cum video] [http://www.ccrs.uzh.ch/user/root/quclss.html Driver stampante postscript] [http://www.ccrs.uzh.ch/user/root/ffrrxk.html Foto dragonball] [http://www.startonlineweb.com/help/new/dvnkii.html Tette mega] [http://www.startonlineweb.com/help/new/jktfgr.html Preparazione portieri calcio] [http://www.worthwhilehosting.com/banners/auto/uevipx.html Trasloco padova] [http://www.startonlineweb.com/help/new/fblmhv.html Video hentai lamu] [http://www.worthwhilehosting.com/banners/auto/qmjaml.html Vendita racchetta tennis] [http://www.worthwhilehosting.com/banners/auto/urqiec.html Amputee] [http://www.hiidenkivenpaivakoti.fi/help/new/iuqaot.html Auto semestrali milano] [http://www.worthwhilehosting.com/banners/auto/shxiuf.html Macchina fotografica zenit] [http://www.hiidenkivenpaivakoti.fi/help/new/ijaoai.html Assicurazione polizza vita] [http://www.hiidenkivenpaivakoti.fi/help/new/hclflu.html Accompagnatrice escort] [http://www.ccrs.uzh.ch/user/root/blhpgv.html Kiss natasha] [http://www.worthwhilehosting.com/banners/auto/rpvvir.html Annuncio incontro treviso] [http://www.hiidenkivenpaivakoti.fi/help/new/sratvh.html Handjobs] [http://www.worthwhilehosting.com/banners/auto/buultk.html Hotel bellaria] [http://www.worthwhilehosting.com/banners/auto/mjbtie.html Morellato it] [http://www.ccrs.uzh.ch/user/root/wmksoa.html Easy gals] [http://www.worthwhilehosting.com/banners/auto/obhpkw.html Doujinshi hentai ita] [http://www.hiidenkivenpaivakoti.fi/help/new/isohmj.html Sculacciate] [http://www.worthwhilehosting.com/banners/auto/hrngss.html Agenzia viaggi on line] [http://www.startonlineweb.com/help/new/ftwftv.html Carolina kostner nuda] [http://www.worthwhilehosting.com/banners/auto/ojmviu.html Ciccioni nudi] [http://www.startonlineweb.com/help/new/ktmidq.html Aforisma magritte] [http://www.startonlineweb.com/help/new/malsrd.html Spaghetti con le cozze] [http://www.worthwhilehosting.com/banners/auto/giikeg.html Boscolo tour hotel dublino] [http://www.worthwhilehosting.com/banners/auto/rlhiit.html Verginelle foto e video gratis] [http://www.worthwhilehosting.com/banners/auto/orubtv.html Prurito alle gambe] [http://www.worthwhilehosting.com/banners/auto/mngsoj.html Colosseo] [http://www.startonlineweb.com/help/new/hxblpt.html Isola di capraia] [http://www.hiidenkivenpaivakoti.fi/help/new/ksvqkw.html ken shiro xxx] [http://www.worthwhilehosting.com/banners/auto/newfkf.html Heineken jammin] [http://www.startonlineweb.com/help/new/gpjnon.html Mutuo immobiliare] [http://www.ccrs.uzh.ch/user/root/wxxgqs.html Pamporncom] [http://www.startonlineweb.com/help/new/upqsoa.html Cazzi sfondano nere] [http://www.worthwhilehosting.com/banners/auto/cpqcen.html Fotoracconti eros] [http://www.startonlineweb.com/help/new/rnucnq.html Mp3 canzoni scaricare] [http://www.hiidenkivenpaivakoti.fi/help/new/mtwqle.html Felixxx imgsrc] [http://www.worthwhilehosting.com/banners/auto/tnsmtt.html Topo canguro] [http://www.worthwhilehosting.com/banners/auto/fxdugv.html Casa prefabbricata cemento] [http://www.startonlineweb.com/help/new/iqfnnk.html Isola d elba vacanza] [http://www.worthwhilehosting.com/banners/auto/nkbegh.html Video ninfomani] [http://www.hiidenkivenpaivakoti.fi/help/new/npaisv.html Massaggiatrice cinese milano] [http://www.startonlineweb.com/help/new/rpfgio.html Volantinaggio catania] [http://www.worthwhilehosting.com/banners/auto/krmpcv.html Camxcam net] [http://www.startonlineweb.com/help/new/hflnps.html Camping grotta] [http://www.ccrs.uzh.ch/user/root/btboxc.html Ewa sonnet] [http://www.hiidenkivenpaivakoti.fi/help/new/ietghl.html Obiettivo nikon] [http://www.startonlineweb.com/help/new/ihmpcn.html Troie manga] [http://www.ccrs.uzh.ch/user/root/brdlkp.html Agenzia investigativa] [http://www.startonlineweb.com/help/new/itrhxl.html Pompini con animali] [http://www.hiidenkivenpaivakoti.fi/help/new/eaccvu.html Consulenza fiscale campania] [http://www.hiidenkivenpaivakoti.fi/help/new/tmhrsh.html Oroscopo rivelatore futuro] [http://www.startonlineweb.com/help/new/vtagig.html Annuncio affitto toscana] [http://www.ccrs.uzh.ch/user/root/qesufa.html Aperitivo panoramici milano] [http://www.hiidenkivenpaivakoti.fi/help/new/tkfued.html Hentai c18] [http://www.startonlineweb.com/help/new/cveime.html fighe russe] [http://www.worthwhilehosting.com/banners/auto/aerdme.html Brandi bella footjob] [http://www.worthwhilehosting.com/banners/auto/sntqab.html Jennifer walcott] [http://www.hiidenkivenpaivakoti.fi/help/new/qlcgfd.html Asta online sardegna] [http://www.startonlineweb.com/help/new/bqhxwl.html Torrie wilson nuda] [http://www.worthwhilehosting.com/banners/auto/cvnmge.html Dvdx] [http://www.ccrs.uzh.ch/user/root/maijbb.html Leggio] [http://www.worthwhilehosting.com/banners/auto/jbduaf.html Comacchio] [http://www.hiidenkivenpaivakoti.fi/help/new/wcanod.html Addominoplastica svizzera lugano] [http://www.startonlineweb.com/help/new/mibdvg.html Incontro forl㬠cesena] [http://www.startonlineweb.com/help/new/cqjout.html Porno capezzolo] [http://www.worthwhilehosting.com/banners/auto/cqlpmv.html Hotel stintino] [http://www.ccrs.uzh.ch/user/root/hkhcwm.html Goalslive] [http://www.worthwhilehosting.com/banners/auto/udqojm.html Disney porno movies] [http://www.worthwhilehosting.com/banners/auto/kpsdnk.html Cercasi fidanzata palermo] [http://www.worthwhilehosting.com/banners/auto/gcpatc.html Italia trasporti] [http://www.ccrs.uzh.ch/user/root/wrerwn.html Anime sex] [http://www.ccrs.uzh.ch/user/root/lfqauq.html Foto inculata scopata transex] [http://www.ccrs.uzh.ch/user/root/aqpptq.html Caldaia murale] [http://www.startonlineweb.com/help/new/fhisbs.html Unire file mp3] [http://www.hiidenkivenpaivakoti.fi/help/new/qfcmqj.html Static eliminator] [http://www.startonlineweb.com/help/new/okcdcp.html Adware spyware] [http://www.hiidenkivenpaivakoti.fi/help/new/txdkaq.html Autoradio con porta usb] [http://www.worthwhilehosting.com/banners/auto/hljknq.html Microfono senza filo] [http://www.ccrs.uzh.ch/user/root/lrotpu.html Ristorante carate brianza] [http://www.startonlineweb.com/help/new/dciwrg.html Creep ispesl] [http://www.ccrs.uzh.ch/user/root/wmlugc.html Donna culo sfondato] [http://www.ccrs.uzh.ch/user/root/fqoetg.html Milano incontri trans] [http://www.ccrs.uzh.ch/user/root/btcetc.html Animatore turistico riva etrusco] [http://www.ccrs.uzh.ch/user/root/cxjbmj.html Moro ristorante palermo] [http://www.startonlineweb.com/help/new/qefgcw.html Donne grasse troie] [http://www.worthwhilehosting.com/banners/auto/jboils.html Vecchie anziane] [http://www.worthwhilehosting.com/banners/auto/xnkqlk.html Grossi culi] [http://www.ccrs.uzh.ch/user/root/kwhajo.html Ciccione che scopano] [http://www.worthwhilehosting.com/banners/auto/xbmdnn.html Ginnastica artistica] [http://www.ccrs.uzh.ch/user/root/lhcopw.html Rita rusic foto nuda] [http://www.worthwhilehosting.com/banners/auto/urwbpe.html Relazione sociale ch video] [http://www.worthwhilehosting.com/banners/auto/ajxhrc.html Conoscersi incontri amore] [http://www.worthwhilehosting.com/banners/auto/lgacbw.html Guendalina grado] [http://www.ccrs.uzh.ch/user/root/ofhola.html Pompino gay] == 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