User confirm

From Kolmafia
Revision as of 22:33, 2 March 2010 by imported>StDoodle (moved User confirm() to User confirm)
Jump to navigation Jump to search

boolean user_confirm( string message )
Opens a confirm dialog with the passed message; returns true if user selects Yes, false if No is pressed.

Example:

# fairly simple function to check if your bounty is one that gives good meat
# if so, it makes sure that you want to farm meat and not stats.
void equip_best_outfit(location bounty_area, string stat_outfit, string farming_outfit)
{

  if (bounty_area == $location[Giant's Castle] || bounty_area == $location[Fantasy Airship])
  {
  
    if (user_confirm("Your selected bounty area is a good source of meat. Would you like to use your farming outfit instead of your bounty outfit?")) return outfit(farming_outfit);
  
  }

  return outfit(stat_outfit);

}