Goal exists

From Kolmafia
Revision as of 15:42, 25 October 2015 by imported>Zarqon ("factoid" also works)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

boolean goal_exists(string type )

  • Valid values for type are:
    • choiceadv
    • autostop
    • meat
    • health
    • factoid
    • mana
    • item

This function returns true if there are any goals that match type.

CodeSample

You could set your current mood in a preAdventureScript based on goal types.

void set_mood() {
   if( goal_exists( "item" ) )
      cli_execute( "mood default, item" );
   else if( goal_exists( "meat" ) )
      cli_execute( "mood default, meat" );
}

See Also

adventure() | add_item_condition() | get_goals() | is_goal()