Miscellaneous Functions: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
Add "gCLI Command Functions" section
 
(262 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[http://zodip.info/description/fermata-per.htm fermata per dodici ore] [http://hangzhau.cn/html/sistech/ sistech] [http://zodip.info/description/thermaltake-xaser.htm thermaltake xaser v] [http://italnet.net.cn/img/hit-mania/ hit mania estate 2004 titoli] [http://nibko.info/data/lorini-buonaiuto.htm lorini, buonaiuto] [http://puli.org.cn/web/cranberry-a/ cranberry a band] [http://italnet.net.cn/img/mp-acer/ mp3 acer 512 radio] [http://italnet.net.cn/img/wolkswagen-polo/ wolkswagen polo s w diesel] [http://puli.org.cn/web/mazonakis-yiorgos/ mazonakis yiorgos] [http://nibko.info/data/cu.htm cu] [http://nibko.info/data/il-decalogo.htm il decalogo sei] [http://puli.org.cn/web/say-shava/ say shava shava] [http://zodip.info/description/eors.htm eors] [http://hangzhau.cn/html/policlinico-di/ policlinico di monza] [http://hangzhau.cn/html/canon-eos/ canon eos 300d tele] [http://nibko.info/data/selphy-cp.htm selphy cp] [http://nibko.info/data/oggi-ha.htm oggi ha festivita] [http://puli.org.cn/web/diesel-salerno/ diesel salerno] [http://hangzhau.cn/html/il-giorno/ il giorno della locusta] [http://italnet.net.cn/img/noa-noa/ noa noa] [http://zodip.info/description/lexus-rx.htm lexus rx 400] [http://zodip.info/description/singolo-.htm singolo  coppie] [http://puli.org.cn/web/george-lucas/ george lucas] [http://nibko.info/data/bocchini-vip.htm bocchini vip] [http://italnet.net.cn/img/kingston-datatravel/ kingston datatravel] [http://nibko.info/data/interreg-trasporto.htm interreg trasporto] [http://italnet.net.cn/img/melissa-p/ melissa p] [http://italnet.net.cn/img/isola-di/ isola di palmarola] [http://zodip.info/description/volkswagen-buggy.htm volkswagen buggy] [http://hangzhau.cn/html/mars-reconnaissance/ mars reconnaissance orbiter 2005] [http://zodip.info/description/volkswagen-passat.htm volkswagen passat td sw] [http://italnet.net.cn/img/harry/ harry] [http://nibko.info/data/calendario-di.htm calendario di mascia 2005] [http://hangzhau.cn/html/provincia-milano/ provincia milano frassinetti] [http://puli.org.cn/web/video-pamela/ video pamela andersson] [http://italnet.net.cn/img/concessionari-rolex/ concessionari rolex] [http://nibko.info/data/registratore-usb.htm registratore usb] [http://puli.org.cn/web/colonne-sonore/ colonne sonore il gladiatore] [http://italnet.net.cn/img/spears-porno/ spears porno] [http://nibko.info/data/passo-del.htm passo del tonale] [http://nibko.info/data/nino-de.htm nino de angelo senza giacca e cravatta] [http://puli.org.cn/web/gtk/ gtk 2 0] [http://hangzhau.cn/html/tv-mobile/ tv mobile] [http://nibko.info/data/palmare-gsm.htm palmare gsm slot] [http://zodip.info/description/olio-di.htm olio di cocco] [http://puli.org.cn/web/musica-della/ musica della mafia] [http://zodip.info/description/per-sempre.htm per sempre celentano] [http://zodip.info/description/diana-spencer.htm diana spencer accident picture] [http://nibko.info/data/dri.htm dri] [http://italnet.net.cn/img/televisori-/ televisori 20 flat] [http://puli.org.cn/web/km-suzuki/ km0 suzuki vitara auto km 0] [http://hangzhau.cn/html/sensore-infrarossi/ sensore infrarossi] [http://nibko.info/data/revolver.htm revolver] [http://zodip.info/description/bonnie-raitt.htm bonnie raitt] [http://hangzhau.cn/html/stella-singole/ stella singole] [http://italnet.net.cn/img/multiplayer-ps/ multiplayer ps2] [http://nibko.info/data/porcellana-wedgwood.htm porcellana wedgwood] [http://zodip.info/description/come-arrivare.htm come arrivare a frascati da napoli] [http://zodip.info/description/telefoni-samsung.htm telefoni samsung] [http://nibko.info/data/combi-videoregistratore.htm combi videoregistratore] [http://zodip.info/description/plyboy.htm plyboy] [http://nibko.info/data/pallavolo-femminile.htm pallavolo femminile serie a] [http://puli.org.cn/web/leontodon/ leontodon] [http://zodip.info/description/shamandalie.htm shamandalie] [http://zodip.info/description/volavola.htm volavola] [http://hangzhau.cn/html/calzini/ calzini] [http://italnet.net.cn/img/yemi-di/ yemi di informatica] [http://hangzhau.cn/html/fotocamere-analogiche/ fotocamere analogiche] [http://zodip.info/description/zdob-si.htm zdob si zdub] [http://zodip.info/description/omega-doom.htm omega doom] [http://zodip.info/description/firenze-vienna.htm firenze vienna] [http://zodip.info/description/laura-pausini.htm laura pausini escucha] [http://italnet.net.cn/img/ufficio-catasto/ ufficio catasto caserta] [http://hangzhau.cn/html/bossa-per/ bossa per due] [http://nibko.info/data/foto-da.htm foto da bbb nua na sexy] [http://hangzhau.cn/html/nuove-immagini/ nuove immagini per midnight club 3] [http://italnet.net.cn/img/testo-canzone/ testo canzone just for you lionel richie] [http://nibko.info/data/sella-cavallo.htm sella cavallo] [http://nibko.info/data/gwangju.htm gwangju] [http://zodip.info/description/foto-gratis.htm foto gratis sul cantante luca di risio] [http://puli.org.cn/web/sufletul-meu/ sufletul meu] [http://puli.org.cn/web/parkhotel-villa/ parkhotel villa grazioli] [http://hangzhau.cn/html/vicentico-los/ vicentico los caminos de la vida] [http://puli.org.cn/web/furgone-volkswagen/ furgone volkswagen] [http://zodip.info/description/ne-tice.htm ne tice me se mp3] [http://italnet.net.cn/img/bosa/ bosa] [http://nibko.info/data/videos-de.htm videos de maradona] [http://puli.org.cn/web/dopo-tutto/ dopo tutto ti amo] [http://puli.org.cn/web/bull-terrier/ bull terrier] [http://puli.org.cn/web/fianco-a/ fianco a fianco nek] [http://nibko.info/data/grigia.htm grigia] [http://zodip.info/description/prada-polo.htm prada polo uomo] [http://zodip.info/description/gugu.htm gugu] [http://italnet.net.cn/img/www-musica/ www musica hardcore it] [http://italnet.net.cn/img/supporto-auto/ supporto auto per palmari qtek s100] [http://nibko.info/data/carica-alto.htm carica alto candy lavatrici e lavasciuga] [http://nibko.info/data/chatcom.htm chatcom] [http://hangzhau.cn/html/csi-vicenza/ csi vicenza] [http://hangzhau.cn/html/dragon/ dragon 8] [http://italnet.net.cn/img/il-linguaggio/ il linguaggio del cane valeria rossi de] [http://hangzhau.cn/html/feste-nazionali/ feste nazionali] [http://nibko.info/data/blondie-gratest.htm blondie. gratest video hits] [http://nibko.info/data/casa-vacanza.htm casa vacanza bibione] [http://zodip.info/description/roberto-cavalli.htm roberto cavalli orologi] [http://hangzhau.cn/html/travelmate-xmi/ travelmate 3202xmi] [http://hangzhau.cn/html/x/ x16] [http://italnet.net.cn/img/senza-vivere/ senza vivere le parole] [http://hangzhau.cn/html/cavo-sync/ cavo sync] [http://puli.org.cn/web/est-provincia/ est (provincia del camerun)] [http://italnet.net.cn/img/www-chat/ www chat comm] [http://nibko.info/data/ingrid-milord.htm ingrid milord free] [http://italnet.net.cn/img/lavoro-san/ lavoro san vincenzo] [http://puli.org.cn/web/uniroma-it/ uniroma2 it] [http://nibko.info/data/michela-elite.htm michela elite atelier] [http://hangzhau.cn/html/palmare-qtek/ palmare qtek] [http://hangzhau.cn/html/hexalot/ hexalot] [http://puli.org.cn/web/cinepresa-dvd/ cinepresa dvd] [http://nibko.info/data/yatc.htm yatc] [http://zodip.info/description/sung.htm sung] [http://hangzhau.cn/html/lexmark-x/ lexmark x] [http://nibko.info/data/toner-brother.htm toner brother 730] [http://hangzhau.cn/html/www-newyork/ www newyork it] [http://nibko.info/data/pete-yorks.htm pete yorks super drumming. vol. 02] [http://italnet.net.cn/img/moonlight-lady/ moonlight lady] [http://zodip.info/description/pixma-ip.htm pixma ip5000 canon] [http://zodip.info/description/modem.htm modem] [http://zodip.info/description/ufficio-acqui.htm ufficio acqui terme] [http://hangzhau.cn/html/mahjong-tower/ mahjong tower 2] [http://hangzhau.cn/html/dvd-kool/ dvd kool] [http://zodip.info/description/masterizzatore-combo.htm masterizzatore combo dvd] [http://puli.org.cn/web/triade-como/ triade como] [http://italnet.net.cn/img/i-owe/ i owe you di victoria adams] [http://italnet.net.cn/img/www-shop/ www shop tv] [http://hangzhau.cn/html/e-mon/ e mon36] [http://hangzhau.cn/html/mansfield-katherine/ mansfield, katherine] [http://zodip.info/description/foto-asher.htm foto asher] [http://italnet.net.cn/img/consulenti/ consulenti] [http://nibko.info/data/levoni.htm levoni] [http://nibko.info/data/sharp-xr.htm sharp xr videoproiettori] [http://hangzhau.cn/html/router-ethernet/ router ethernet 4 porte adsl printserver] [http://hangzhau.cn/html/volvo-s/ volvo s80 d5] [http://puli.org.cn/web/ford-galaxy/ ford galaxy ghia] [http://hangzhau.cn/html/troie-sarde/ troie sarde] [http://hangzhau.cn/html/www-diamante/ www diamante nero it] [http://italnet.net.cn/img/il-sosia/ il sosia innamorato] [http://zodip.info/description/nvidia-geforce.htm nvidia geforce 6600 256 mb pci express] [http://nibko.info/data/www-torre.htm www torre del moro it] [http://puli.org.cn/web/cristiana-carpentieri/ cristiana carpentieri] [http://hangzhau.cn/html/disney-com/ disney com] [http://hangzhau.cn/html/www-superpippa/ www superpippa tv] [http://zodip.info/description/scarsa-attenzione.htm scarsa attenzione in classe] [http://nibko.info/data/pannoloni.htm pannoloni] [http://nibko.info/data/ottico.htm ottico 3] [http://puli.org.cn/web/lavinio-i/ lavinio i numeri] [http://nibko.info/data/jeans-senza.htm jeans senza slip] [http://puli.org.cn/web/costantino-vitigliano/ costantino vitigliano official site] [http://nibko.info/data/gogle-con.htm gogle con] [http://hangzhau.cn/html/unicredito/ unicredito] [http://italnet.net.cn/img/mastri/ mastri] [http://puli.org.cn/web/indirizzi-parcheggi/ indirizzi parcheggi di scambio] [http://zodip.info/description/senza-fine.htm senza fine di gino paoli] [http://nibko.info/data/kyle-minogue.htm kyle minogue] [http://zodip.info/description/linfocitos-t.htm linfocitos t] [http://puli.org.cn/web/splinder/ splinder] [http://hangzhau.cn/html/interventi-ecologici/ interventi ecologici in austria] [http://nibko.info/data/lg-flatron.htm lg flatron tv lcd] [http://italnet.net.cn/img/mazda-/ mazda 3 speed] [http://italnet.net.cn/img/una-donna/ una donna una storia] [http://hangzhau.cn/html/lohmann-karl/ lohmann, karl] [http://italnet.net.cn/img/tamia/ tamia] [http://nibko.info/data/sing-il.htm sing il sogno di brooklyn] [http://zodip.info/description/corse-di.htm corse di automobiline] [http://italnet.net.cn/img/giornale-playgirl/ giornale playgirl] [http://italnet.net.cn/img/zigo/ zigo-] [http://puli.org.cn/web/stradario-riccione/ stradario riccione] [http://italnet.net.cn/img/identikus/ identikus] [http://puli.org.cn/web/sesso-fratis/ sesso fratis] [http://hangzhau.cn/html/cum-fuck/ cum fuck] [http://nibko.info/data/c-atlantide.htm c6 atlantide] [http://italnet.net.cn/img/padova-pub/ padova pub] [http://hangzhau.cn/html/my-love/ my love ghost] [http://nibko.info/data/nissan-serena.htm nissan serena 2.3] [http://puli.org.cn/web/ufficio-legnago/ ufficio legnago] [http://nibko.info/data/notte-di.htm notte di tradimento] [http://italnet.net.cn/img/ultimi-gioco/ ultimi gioco pc] [http://hangzhau.cn/html/microfono-cuffie/ microfono cuffie] [http://zodip.info/description/jdm-simpa.htm jdm simpa] [http://italnet.net.cn/img/prestito-corsico/ prestito corsico] [http://italnet.net.cn/img/il-terrore/ il terrore dei gangster] [http://nibko.info/data/pagine-bianche.htm pagine bianche numeri telefonici palermo] [http://nibko.info/data/porte-cabine.htm porte cabine enel] [http://italnet.net.cn/img/luca-de/ luca de risio] [http://puli.org.cn/web/bollettino-ufficiale/ bollettino ufficiale regionale del vene] [http://zodip.info/description/nikon-enel.htm nikon en-el3] [http://zodip.info/description/maurizio-quattrocchi.htm maurizio quattrocchi] [http://nibko.info/data/nardi-piani.htm nardi piani cottura 90] [http://puli.org.cn/web/boom-boom/ boom boom boom boom] [http://puli.org.cn/web/giornale-novella/ giornale novella 2000] [http://puli.org.cn/web/lupin/ lupin] [http://zodip.info/description/www-meetic.htm www meetic it] == 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