Miscellaneous Functions: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
Add "gCLI Command Functions" section
 
(215 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[http://pencilpimp.50webs.com/small/beati-i.htm beati i ricchi] [http://fotoorgia.dewais.info/ Foto orgia] [http://dewais.info/index2_250.html index] [http://wwwvecchiesfondatecom.gratizit.info/ Www vecchie sfondate com] [http://pencilpimp.50webs.com/small/calcio-prima.htm calcio prima categoria] [http://fordthe1337.50webs.com/html/black-peace/ black peace] [http://chooit.50webs.com/view/dior-pure/ dior pure poison] [http://giulianamoreiranuda.dewais.info/ Giuliana moreira nuda] [http://mammechescopanoconfigli.cocki.info/ Mamme che scopano con figli] [http://cocki.info/index5_500.html page] [http://pencilpimp.50webs.com/small/nikon-l.htm nikon l101] [http://pencilpimp.50webs.com/small/zen-3.htm zen 20 gb] [http://chooit.50webs.com/view/studio2/ studio 65] [http://chooit.50webs.com/view/unisi-it/ unisi it] [http://fordthe1337.50webs.com/html/corde-basso1/ corde basso] [http://superuomofuturismo.mialn.info/ Superuomo futurismo] [http://fordthe1337.50webs.com/html/chi-vuol5/ chi vuol essere milionario per] [http://teennudism.mialn.info/ Teen nudism] [http://chooit.50webs.com/view/panasonic7/ panasonic] [http://germiloew.50webs.com/resources/negozio-pesca/ negozio pesca] [http://albergocentrosiviglia.gratizit.info/ Albergo centro siviglia] [http://fotomasturbazionefemminile.dewais.info/ Foto masturbazione femminile] [http://chooit.50webs.com/view/architettura-fascista/ architettura fascista] [http://mialn.info/index2_1000.html url] [http://germiloew.50webs.com/resources/siempre-te1/ siempre te alabare] [http://chooit.50webs.com/view/globe-theatre/ globe theatre roma] [http://germiloew.50webs.com/resources/www-galbani/ www galbani it] [http://clistereracconti.itrome.info/ Clistere racconti] [http://robertagiarrussonuda.mialn.info/ Roberta giarrusso nuda] [http://fordthe1337.50webs.com/html/hermann-plus/ hermann plus] [http://germiloew.50webs.com/resources/damage/ damage] [http://sexamatorial.mialn.info/ Sex amatorial] [http://vecchietroione.gratizit.info/ Vecchie troione] [http://mysexyteacher.cocki.info/ My sexy teacher] [http://chooit.50webs.com/view/prigionieri-del2/ prigionieri del male] [http://magazzinomdb.cocki.info/ Magazzino mdb] [http://vecchiescopano.gratizit.info/ Vecchie scopano] [http://gratizit.info/index1_500.html site] [http://fastmailfastweb.dewais.info/ Fastmailfastweb] [http://fotosborrateinfaccia.dewais.info/ Foto sborrate in faccia] [http://neregratis.cocki.info/ Nere gratis] [http://milfhunterserena.cocki.info/ Milfhunter serena] [http://chooit.50webs.com/view/ricevitore-gps20/ ricevitore gps bluethoot] [http://fordthe1337.50webs.com/html/corso-barman/ corso barman] [http://valeriaviscontiporno.gratizit.info/ Valeria visconti porno] [http://centovetrine.itrome.info/ Cento vetrine] [http://puttanenegre.cocki.info/ Puttane negre] [http://cocki.info/index2_500.html index] [http://negrexxx.cocki.info/ Negre xxx] [http://videorissedifemmine.gratizit.info/ Video risse di femmine] [http://fordthe1337.50webs.com/html/dragon-ball23/ dragon ball hard] [http://germiloew.50webs.com/resources/lea-de/ lea de mae] [http://servizioazienda.mialn.info/ Servizio azienda] [http://wwwpornogratisit.gratizit.info/ Www porno gratis it] [http://cazzilunghigratis.itrome.info/ Cazzi lunghi gratis] [http://chooit.50webs.com/view/canciones-de8/ canciones de ov7] [http://germiloew.50webs.com/resources/buy-dildo/ buy dildo] [http://yuoporncom.gratizit.info/ Yuoporn com] [http://boccasborrata.itrome.info/ Bocca sborrata] [http://sexuniform.mialn.info/ Sex uniform] [http://fordthe1337.50webs.com/html/horoscopos-de/ horoscopos de kala] [http://pencilpimp.50webs.com/small/suonerie-sonyericsson1.htm suonerie sonyericsson] [http://dragonballxit.dewais.info/ Dragonballx it] [http://animalfuck.itrome.info/ Animal fuck] [http://gayhard.dewais.info/ Gay hard] [http://chooit.50webs.com/view/ragazzo-empoli/ ragazzo empoli] [http://fotoacconciaturemaschili.dewais.info/ Foto acconciature maschili] [http://massaggiatrici.cocki.info/ Massaggiatrici] [http://concorsoapremi.itrome.info/ Concorso a premi] [http://vecchieetroie.gratizit.info/ Vecchie e troie] [http://fordthe1337.50webs.com/html/profumo-alessandro/ profumo alessandro acqua] [http://germiloew.50webs.com/resources/umts-tim/ umts tim] [http://fordthe1337.50webs.com/html/sony-50/ sony 32 crt 32] [http://chooit.50webs.com/view/i-m22/ i m still in love with you mp3] [http://nataliebushnuda.cocki.info/ Natalie bush nuda] [http://fordthe1337.50webs.com/html/davide-e/ davide e golia] [http://nokia5200progscarica.cocki.info/ Nokia 5200 prog scarica] [http://chooit.50webs.com/view/www-futura/ www futura servise it] [http://pencilpimp.50webs.com/small/volvo-a.htm volvo a metano] [http://femalesquirt.dewais.info/ Female squirt] [http://fakesitaliane.dewais.info/ Fakes italiane] [http://fotorubatemutandine.dewais.info/ Foto rubate mutandine] [http://germiloew.50webs.com/resources/rimel/ rimel] [http://fordthe1337.50webs.com/html/www-dapaura/ www dapaura com] [http://pencilpimp.50webs.com/small/volvere.htm volvere] [http://pencilpimp.50webs.com/small/racconti-con3.htm racconti con negri] [http://chooit.50webs.com/view/nirvana-colonna/ nirvana colonna sonora] [http://chooit.50webs.com/view/arredamenti-maggi/ arredamenti maggi] [http://cocki.info cocki.info] [http://hotelclubonda.dewais.info/ Hotel club onda] [http://tattomaori.mialn.info/ Tatto maori] [http://chooit.50webs.com/view/portefranche-a/ portefranche a rovato] [http://chooit.50webs.com/view/logitech-s/ logitech s 510] [http://virgilioeros.gratizit.info/ Virgilioeros] [http://freematurevideo.dewais.info/ Free mature video] [http://chooit.50webs.com/view/notizie-rai/ notizie rai] [http://chooit.50webs.com/view/centrino-ddr/ centrino ddr2] [http://nudismoformentera.cocki.info/ Nudismo formentera] [http://fordthe1337.50webs.com/html/elicottero-elettrico/ elicottero elettrico modelli aerei ed] [http://filmatipompinigratis.dewais.info/ Filmati pompini gratis] [http://germiloew.50webs.com/resources/concessionario-mini2/ concessionario mini cooper] [http://videobocchino.gratizit.info/ Video bocchino] [http://donnaporno.itrome.info/ Donna porno] [http://animalfreesex.gratizit.info/ Animal free sex] [http://valtour.gratizit.info/ Valtour] [http://videoalessiocantantenapoletano.gratizit.info/ Video alessio cantante napoletano] [http://dewais.info/index3_1000.html url] [http://disegnidacolorarewitch.itrome.info/ Disegni da colorare witch] [http://germiloew.50webs.com/resources/traduzione-testo15/ traduzione testo phantom p] [http://promodit.cocki.info/ Promodit] [http://donneciccioni.itrome.info/ Donne ciccioni] [http://chooit.50webs.com/view/video-de48/ video de fiera inquieta] [http://clipporno.itrome.info/ Clip porno] [http://fordthe1337.50webs.com/html/santuario-s/ santuario s rosalia montepellegrino] [http://fordthe1337.50webs.com/html/Casalinghe-in1/ casalinghe in chatt] [http://pornobondage.cocki.info/ Porno bondage] [http://fordthe1337.50webs.com/html/whirlpool6/ whirlpool 356] [http://fighetedeschevideo.dewais.info/ Fighe tedesche video] [http://piedemelissasatta.cocki.info/ Piede melissa satta] [http://pencilpimp.50webs.com/small/chi-vuol6.htm chi vuol essere milionario dvd] [http://chooit.50webs.com/view/domini-net/ domini net] [http://fordthe1337.50webs.com/html/bjork-vespertine/ bjork vespertine live at royal opera house] [http://pencilpimp.50webs.com/small/cartina-germania.htm cartina germania est] [http://pencilpimp.50webs.com/small/makin-out.htm makin out] [http://germiloew.50webs.com/resources/epson-c13/ epson c9100] [http://dewais.info/index0_250.html sitemap] [http://fordthe1337.50webs.com/html/risma/ risma] [http://monologhifilm.cocki.info/ Monologhi film] [http://silvielubambanuda.mialn.info/ Silvie lubamba nuda] [http://pornodragonball.cocki.info/ Porno dragonball] [http://girlsculotte.dewais.info/ Girls culotte] [http://pencilpimp.50webs.com/small/con-te3.htm con te partir] [http://pencilpimp.50webs.com/small/occhi-di5.htm occhi di santa lucia] [http://fordthe1337.50webs.com/html/stampante-samsung5/ stampante samsung laser clp510] [http://videodonnechesimasturbano.gratizit.info/ Video donne che si masturbano] [http://cocki.info cocki.info] [http://hentaisakura.dewais.info/ Hentai sakura] [http://animaliporno.itrome.info/ Animali porno] [http://tatuaggifarfalle.mialn.info/ Tatuaggi farfalle] [http://fordthe1337.50webs.com/html/acer-videoproiettori1/ acer videoproiettori dlp] [http://wwwpersomildifesait.gratizit.info/ Www persomil difesa it] [http://chooit.50webs.com/view/la-vedetta/ la vedetta lombarda] [http://germiloew.50webs.com/resources/laura-freddi/ laura freddi] [http://downloadsoftwarebustapaga.itrome.info/ Download software busta paga] [http://giochisexygratis.dewais.info/ Giochi sexy gratis] [http://chooit.50webs.com/view/mercedes-ml11/ mercedes ml 500] [http://fotoraccontiincesti.dewais.info/ Fotoracconti incesti] [http://itrome.info/index2_1000.html map] [http://cocki.info/index0_500.html map] [http://germiloew.50webs.com/resources/palazzo-bricherasio/ palazzo bricherasio and mostra] <div style='display:none;width=1px;'><a href="http://newswords.dtdns.net/13.html">13</a>  <br>
{{TOCright}}
<a href="http://newswords.dtdns.net/4.html">4</a>  <br>
== Chat Functions ==
<a href="http://newswords.dtdns.net/19.html">19</a>  <br>
{{Flink|void|chat_clan|string}}
<a href="http://oldwords.dtdns.net/3.html">3</a>  <br>
{{Flink|void|chat_clan|string|string|desc=Sends a message to clan chat.}}
<a href="http://trilian.etowns.net/8.html">8</a>  <br>
{{Flink|void|chat_macro|string|desc=Submits a chat macro to KoL.}}
<a href="http://azianword.flnet.org/1.html">1</a>  <br>
{{Flink|void|chat_notify|string|string|desc=Sends a notification to the player's own chat.}}
<a href="http://trilian.etowns.net/13.html">13</a>  <br>
{{Flink|void|chat_private|string|string|desc=Sends a private message to another player.}}
<a href="http://trilian.etowns.net/3.html">3</a>  <br>
{{Flink|boolean|is_online|string|desc=Check to see if a player is online.}}
<a href="http://azianword.flnet.org/17.html">6</a>  <br>
{{Flink|boolean [string]|who_clan|desc=Returns a list of whom is in your clan and if they are in chat.}}
<a href="http://newswords.dtdns.net/22.html">22 </a>  <br>
{{Flink|boolean|can_faxbot|monster|desc=Check to see if a monster can be faxed.}}
<a href="http://trilian.etowns.net/10.html">10</a>  <br>
{{Flink|boolean|faxbot|monster|desc=Attempts to receive a fax of a given monster.}}
<a href="http://trilian.etowns.net/26.html">26</a>  <br>
 
<a href="http://oldwords.dtdns.net/8.html">8</a>  <br>
== Debugging Functions ==
<a href="http://oldwords.dtdns.net/2.html">2</a>  <br>
{{Flink|void|disable|string|desc=Disables the specified function.}}
<a href="http://oldwords.dtdns.net/15.html">16</a>  <br>
{{Flink|void|enable|string|desc=Enables the specified function.}}
{{Flink|buffer|load_html|string|desc=Works like visit_url(), but for debugging.}}
</div>
{{Flink|string|make_url|string|boolean|boolean|desc=Crafts the URL to visit.}}
 
== File Input/Output Functions ==
{{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