User confirm

From Kolmafia
Revision as of 22:26, 9 May 2009 by imported>MapleMario (New page: '''boolean user_confirm( string message )''' <br />Opens a confirm dialog with the passed message; returns true if user selects Yes, false if No is pressed. <p>Example: <pre># fai...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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);

}