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...")
 
(Add SeeAlso)
Line 28: Line 28:
 
</pre>
 
</pre>
 
}}
 
}}
 +
|see_also={{SeeAlso|choice_follows_fight|handling_choice|last_choice|run_choice}}
 
|cli_equiv=
 
|cli_equiv=
 
|more_info=
 
|more_info=

Revision as of 06:58, 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!

See Also

choice_follows_fight() | handling_choice() | last_choice() | run_choice()