Difference between revisions of "Available choice options"

From Kolmafia
Jump to navigation Jump to search
(Created page with "<onlyinclude>{{{{{format|Function2}}} |name=available_choice_options |function1.return_type={{type|string}} <nowiki>[</nowiki>{{type|int}}<nowiki>]</nowiki> |function1.descrip...")
(No difference)

Revision as of 06:56, 22 December 2020

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!