Difference between revisions of "Available choice options"

From Kolmafia
Jump to navigation Jump to search
(Add SeeAlso)
 
Line 1: Line 1:
 
<onlyinclude>{{{{{format|Function2}}}
 
<onlyinclude>{{{{{format|Function2}}}
 
|name=available_choice_options
 
|name=available_choice_options
|function1.return_type={{type|string}} <nowiki>[</nowiki>{{type|int}}<nowiki>]</nowiki>
+
|function1.return_type={{type|string}} {{opt|{{type|int}}}}
 
|function1.description=Returns all available choice options in the current (or last) choice adventure the player encountered.
 
|function1.description=Returns all available choice options in the current (or last) choice adventure the player encountered.
 
|function1.param1=spoilers
 
|function1.param1=spoilers

Latest revision as of 07:31, 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()