Get moods: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
m changed wording because the cli command does not return the exact same list as the function
 
Line 2: Line 2:
#vardefine:name|get_moods}}{{
#vardefine:name|get_moods}}{{
#vardefine:return_type|string [int]}}{{
#vardefine:return_type|string [int]}}{{
#vardefine:aggregate|yes}}{{
#vardefine:aggregate|yes}}{{FunctionPage|
 
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|


Line 36: Line 34:
The wiki example of mood generation can be found on the cli_execute page.  
The wiki example of mood generation can be found on the cli_execute page.  
}}|
}}|
cli_equiv=The CLI command <code> mood listall </code> will print the same list in the CLI.|
cli_equiv=The CLI command <code> mood listall </code> will print the same list (except for composite moods) in the CLI.|


see_also={{SeeAlso|my_effects|have_effect}}|
see_also={{SeeAlso|my_effects|have_effect}}|
}}
}}


[[Category:Adventuring]]
[[index.php?title=Category:Adventuring]]

Latest revision as of 20:50, 24 August 2026

Function Syntax

string [int] get_moods()

This function returns an integer indexed list of all currently defined mood names.

Code Samples

Gives a list of your current saved moods. Also switches to the wiki's example mood and lists its triggers, if available.

string[int] moods;
moods = get_moods();
print("A list of all your current moods:", "blue");
foreach it, mood in moods {
   print(mood);
   if (mood == "moxieleveling") {
      print("Wiki example mood 'MoxieLeveling' detected, switching to it now.", "blue");
      cli_execute("mood "+mood);
      print("It currently has the following triggers:", "blue");
      cli_execute("trigger list");
   }
}

The wiki example of mood generation can be found on the cli_execute page.

CLI Equivalent

The CLI command mood listall will print the same list (except for composite moods) in the CLI.

See Also

my_effects() | have_effect()


index.php?title=Category:Adventuring