Get moods

From Kolmafia
Revision as of 03:35, 14 January 2015 by imported>Eliteofdelete
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 in the CLI.

See Also

my_effects() | have_effect()