available_choice_options

From Kolmafia
Revision as of 06:56, 22 December 2020 by Philmasterplus (talk | contribs) (Created page with "<onlyinclude>{{{{{format|Function2}}} |name=available_choice_options |function1.return_type={{type|string}} <nowiki>[</nowiki>{{type|int}}<nowiki>]</nowiki> |function1.descrip...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

string [int] available_choice_optionsboolean? spoilers = false )

Returns all available choice options in the current (or last) choice adventure the player encountered.
  • spoilers: If true, also add KoLmafia-generated spoiler text to each choice string

This function was added in r17937 and r17938.

Code Samples

Suppose the player visits Dr. Gordon Stuart, a Scientist, then executes the following code:

string [int] choices = available_choice_options();
foreach num, choice_text in choices {
   print(`{num}: {choice_text}`);
}

Then KoLmafia will print:

1: Can I fight that tentacle you saved for science?
2: What can you tell me about "refuse material"?
3: Great!