Difference between revisions of "Miscellaneous Functions"

From Kolmafia
Jump to navigation Jump to search
(Add "gCLI Command Functions" section)
 
(72 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[http://paramedic.erhear.cn/ paramedic] [http://fourteen-year-old.tiddle.cn/ fourteen year old nudist girl] [http://apparel-oklahoma.indevout.cn/ apparel oklahoma state university] [http://the-jurys-boston.moon-ray.cn/ the jurys boston ma] [http://hair-care.emetic.cn/ hair care] [http://sexy-red-heads.drongo.cn/ sexy red heads] [http://t-mobile-account.indevout.cn/ t mobile account] [http://picking-up-lol.erhear.cn/ picking up lol] [http://skinny-little.emetic.cn/ skinny little girl] [http://alex-hold-up.charie.cn/ alex hold up] [http://misoprostol.emetic.cn/ misoprostol] [http://boobs-sexy.emetic.cn/ boobs sexy] [http://trixieteen.gosailor.cn/ trixieteen] [http://teen-magazine.moon-ray.cn/ teen magazine] [http://jtt.gosailor.cn/ jtt] [http://glory-hole-men.indevout.cn/ glory hole men] [http://free-porn-vidoes.erhear.cn/ free porn vidoes] [http://adult-sex-porn.indevout.cn/ adult sex porn] [http://inhibition-definition.abjur.cn/ inhibition definition] [http://microsoft-windows.emetic.cn/ microsoft windows updates] [http://soap-opera-updates.tiddle.cn/ soap opera updates] [http://juicy-boobs.drongo.cn/ juicy boobs] [http://renting-web-sites.emetic.cn/ renting web sites] [http://juoppo-jarmo.moon-ray.cn/ juoppo jarmo] [http://freenudepics.drongo.cn/ freenudepics] [http://free-psychic.drongo.cn/ free psychic readings] [http://music-composer.abjur.cn/ music composer] [http://what-is-medical.counite.cn/ what is medical billing software] [http://pignolle.counite.cn/ pignolle] [http://online-casino.moon-ray.cn/ online casino poker] [http://lesbian-kiss.indevout.cn/ lesbian kiss] [http://transistor-biasing.gosailor.cn/ transistor biasing] [http://night-vision.drongo.cn/ night vision] [http://teenboy.tiddle.cn/ teenboy] [http://anal-sex-tips.drongo.cn/ anal sex tips] [http://turbo-tax.abjur.cn/ turbo tax] [http://hot-gurls.tiddle.cn/ hot gurls] [http://boxing-betting.abjur.cn/ boxing betting] [http://amanda-bynes-nudies.indevout.cn/ amanda bynes nudies] [http://equity-research.tiddle.cn/ equity research software] [http://funny-bunny.drongo.cn/ funny bunny] [http://wierd-al-yankovich.drongo.cn/ wierd al yankovich] [http://girls-fucking.gosailor.cn/ girls fucking machines] [http://x-men-nude.emetic.cn/ x men nude] [http://las-vegas-vacation.charie.cn/ las vegas vacation rental properties] [http://naked-beyonce.counite.cn/ naked beyonce] [http://hot-women-sucking.drongo.cn/ hot women sucking big dicks] [http://nice-jugs.counite.cn/ nice jugs] [http://airport.gosailor.cn/ airport] [http://crack-codes.tiddle.cn/ crack codes] [http://north-garland-high.moon-ray.cn/ north garland high school garland texas] [http://lindsey-lohan-pics.gosailor.cn/ lindsey lohan pics] [http://real-female.charie.cn/ real female orgasms] [http://watkins.emetic.cn/ watkins] [http://fire-pit.emetic.cn/ fire pit] [http://funny-animated.counite.cn/ funny animated cartoons] [http://honda-cbr.emetic.cn/ honda cbr] [http://teaching-jobs-in.counite.cn/ teaching jobs in atlanta christian schools] [http://slow-down.charie.cn/ slow down] [http://shelby-technology.erhear.cn/ shelby technology] [http://ideepthroat.gosailor.cn/ ideepthroat password] [http://sex-video-games.emetic.cn/ sex video games] [http://hoyts.tiddle.cn/ hoyts] [http://phone.emetic.cn/ phone] [http://loyola-high.moon-ray.cn/ loyola high school in illinois] [http://brown-chris-number.abjur.cn/ brown chris number phone] [http://black-sluts.drongo.cn/ black sluts] [http://brush-guard.drongo.cn/ brush guard] [http://auto-mover.gosailor.cn/ auto mover] [http://alabama-sex-offenders.counite.cn/ alabama sex offenders] [http://cock-cravers.abjur.cn/ cock cravers] [http://semen-drinking.indevout.cn/ semen drinking] [http://alex-arden.gosailor.cn/ alex arden] [http://arabic-live-sex.gosailor.cn/ arabic live sex chat] [http://little-richard.moon-ray.cn/ little richard] [http://asse.counite.cn/ asse] [http://cute-puppy-gallery.charie.cn/ cute puppy gallery] [http://it-meant-something.tiddle.cn/ it meant something to me lyrics] [http://all-the-web.erhear.cn/ all the web] [http://asset-searches.moon-ray.cn/ asset searches] [http://boys-having-gay.erhear.cn/ boys having gay sex] [http://mouthfull.abjur.cn/ mouthfull] [http://hentai-manga-comics.moon-ray.cn/ hentai manga comics] [http://play-free-games.indevout.cn/ play free games] [http://nudist.indevout.cn/ nudist] [http://kodak-easy-share.tiddle.cn/ kodak easy share] [http://dmc.moon-ray.cn/ dmc] [http://calendar-software.charie.cn/ calendar software] [http://razor-magazine.counite.cn/ razor magazine] [http://radio-virgin-thailand.charie.cn/ radio virgin thailand] [http://cute-jap-girl.indevout.cn/ cute jap girl] [http://lit.indevout.cn/ lit] [http://police-car.charie.cn/ police car] [http://custom-shirt.emetic.cn/ custom shirt] [http://net-present-values.drongo.cn/ net present values] [http://acupuncture.drongo.cn/ acupuncture cancer treatment] [http://scott-stapp.gosailor.cn/ scott stapp] [http://vance-and-hines.charie.cn/ vance and hines] [http://live-backup.indevout.cn/ live backup] [http://fishing-cabins.drongo.cn/ fishing cabins in canada] [http://used-office-furniture.gosailor.cn/ used office furniture] [http://escanaba-real.tiddle.cn/ escanaba real estate] [http://his-first-gay.drongo.cn/ his first gay sex] [http://milfhunter-gallery.emetic.cn/ milfhunter gallery of the day] [http://punk-girls.gosailor.cn/ punk girls] [http://pre-teen.indevout.cn/ pre teen] [http://john-wilkes-booth.tiddle.cn/ john wilkes booth] [http://homemade-vagina.emetic.cn/ homemade vagina toys sex] [http://big-fat-ass-booties.charie.cn/ big fat ass booties] [http://sfredbook.tiddle.cn/ sfredbook] [http://nextdoor-vids.charie.cn/ nextdoor vids] [http://fanny-hill.tiddle.cn/ fanny hill] [http://vulva-of-youngest.gosailor.cn/ vulva of youngest girls] [http://adult-webmaster.drongo.cn/ adult webmaster affiliates] [http://linsey-dawn-mckenzie.drongo.cn/ linsey dawn mckenzie mpegs] [http://horny-slutty.counite.cn/ horny slutty wet chicks] [http://prepaid-legal-services.charie.cn/ prepaid legal services] [http://medical-website.counite.cn/ medical website] [http://malaysia-visa-application.indevout.cn/ malaysia visa application] [http://wumpscut.indevout.cn/ wumpscut] [http://basketball-cards.tiddle.cn/ basketball cards] [http://bucci-twins-nude.erhear.cn/ bucci twins nude] [http://women-masturbate.counite.cn/ women masturbate] [http://hot-butt.counite.cn/ hot butt] [http://playboy-mansion.drongo.cn/ playboy mansion] [http://honolulu-real.indevout.cn/ honolulu real estate sale] [http://sugar-cookie.abjur.cn/ sugar cookie recipy] [http://dumpstersluts.tiddle.cn/ dumpstersluts] [http://dogfart-interracial.erhear.cn/ dogfart interracial] [http://gilmore-girls.charie.cn/ gilmore girls episode guide] [http://starships.gosailor.cn/ starships] [http://digital-map.charie.cn/ digital map] [http://gold-jewelry.counite.cn/ gold jewelry] [http://free-dvd-player.tiddle.cn/ free dvd player software] [http://schools-for-troubled.tiddle.cn/ schools for troubled teens] [http://electropolishing.moon-ray.cn/ electropolishing] [http://inexpensive.counite.cn/ inexpensive web hosting] [http://anna-nalick.moon-ray.cn/ anna nalick] [http://home-based-business.erhear.cn/ home based business] [http://pool-swimming-watsons.tiddle.cn/ pool swimming watsons] [http://flashing.erhear.cn/ flashing] [http://adapex.gosailor.cn/ adapex] [http://silverchair.tiddle.cn/ silverchair] [http://album.emetic.cn/ album] [http://zumanity.counite.cn/ zumanity] [http://job.counite.cn/ job] [http://free-nude-toons.indevout.cn/ free nude toons] [http://shakira-nude.indevout.cn/ shakira nude] [http://gauge-blowjob.tiddle.cn/ gauge blowjob] [http://volkswagen-beetle.tiddle.cn/ volkswagen beetle parts] [http://macau.emetic.cn/ macau] [http://tales-of-symphonia.tiddle.cn/ tales of symphonia] [http://fred-flintstone.moon-ray.cn/ fred flintstone] [http://waiter.charie.cn/ waiter] [http://lesbian-pussy.charie.cn/ lesbian pussy] [http://stereophonics.emetic.cn/ stereophonics] [http://new-car-leasing.moon-ray.cn/ new car leasing calculator] [http://prison-rape.charie.cn/ prison rape] [http://water-ionizer.emetic.cn/ water ionizer] [http://jama.tiddle.cn/ jama] [http://free-penthouse.gosailor.cn/ free penthouse forum stories] [http://michigan-prosecutors.counite.cn/ michigan prosecutors association] [http://jeph-howard.erhear.cn/ jeph howard] [http://pit-bull-terrier.gosailor.cn/ pit bull terrier] [http://ladies-legs.indevout.cn/ ladies legs] [http://anna-kournikova.charie.cn/ anna kournikova] [http://ps2-games.drongo.cn/ ps2 games] [http://hot-asian-models.moon-ray.cn/ hot asian models] [http://crane-service.moon-ray.cn/ crane service] [http://electrical-engineering.moon-ray.cn/ electrical engineering careers] [http://thong-bikini.tiddle.cn/ thong bikini models] [http://pace-auto-parts.tiddle.cn/ pace auto parts] [http://sexcams4free.charie.cn/ sexcams4free] [http://lilian.gosailor.cn/ lilian] [http://web-hosting-solutions.charie.cn/ web hosting solutions] [http://managed-pay-per.charie.cn/ managed pay per click advertising] [http://little-incest.tiddle.cn/ little incest] [http://uggs.counite.cn/ uggs] [http://jdm.erhear.cn/ jdm] [http://hardcore-sluts.drongo.cn/ hardcore sluts] [http://twilight-sex.indevout.cn/ twilight sex] [http://flowers-online.indevout.cn/ flowers online] [http://older-women-sex.drongo.cn/ older women sex] [http://fendi-bag.gosailor.cn/ fendi bag] [http://naughty.counite.cn/ naughty] [http://cosmetic-surgery.charie.cn/ cosmetic surgery financing] [http://key-lime-pie.charie.cn/ key lime pie] [http://furry-pussy.gosailor.cn/ furry pussy] [http://tooling-press-brake.emetic.cn/ tooling press brake] [http://hogtied-bondage.emetic.cn/ hogtied bondage] [http://zoey-model-galleries.moon-ray.cn/ zoey model galleries] [http://erika-eleniak-nude.indevout.cn/ erika eleniak nude] [http://cnn-world-news.gosailor.cn/ cnn world news] [http://foods-to-reduce.drongo.cn/ foods to reduce high blood pressure] [http://sports-handicapping.counite.cn/ sports handicapping] [http://big-beautiful-breast.indevout.cn/ big beautiful breast] [http://job-home-based.charie.cn/ job home based] [http://learn-belly.erhear.cn/ learn belly dancing online] [http://phoebe-cates-nude.indevout.cn/ phoebe cates nude] [http://censorship.moon-ray.cn/ censorship] == 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 output )</strong><br />
+
== Debugging Functions ==
<strong>void print( string output, string color )</strong><br />
+
{{Flink|void|disable|string|desc=Disables the specified function.}}
Prints <i>output</i> to the CLI buffer and displays it in the status line of the main Adventuring window.  If <i>color</i> is specified any HTML in <i>output</i> is escaped and the string is wrapped in a font tag before being printed.</p>
+
{{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