User confirm: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
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...
 
imported>StDoodle
(No difference)

Revision as of 22:33, 2 March 2010

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);

}