Maximize

From Kolmafia
Revision as of 16:48, 28 January 2011 by imported>StDoodle
Jump to navigation Jump to search
needs(code_samples);

Function Syntax

boolean maximize(string expression ,string simulate )

boolean maximize(string expression ,int max_price ,int price_level ,string simulate )

  • expression is the list of modifiers to maximize for.
  • max_price limits how much meat will be spent on maximization.
  • price_level controls checking the mall and affects return value.
  • simulate will not equip gear if false.

This command will run the modifier maximizer and return true if successful. If a minimum is applied to a modifier and that minimum could not be accomplished (such as 4 clownosity) then it will return false.

This function will set _spec so that it can be checked with numeric_modifier(). That is the main purpose of using a true value for simulate.

If max_price is <= 0, it will use the preference autoBuyPriceLimit, or available meat, whichever is lower. Otherwise, that's the value it's considering as the max value for new items.

If price_level is greater than 0, Mall price is considered. If price_level is 2, always consider mall price. If price_level is 1, only consider it if there isn't another way. Also, if price_level is 0 or less, validateItem always returns true.

CLI Equivalent

The CLI command command "maximize" will automatically change equipment as if the final parameter was false.

More Information

See the page on the Modifier Maximizer for more information on how to use this, especially to create a meaningful expression.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific question has been raised:

  • What exactly is validateItem? What does it mean to us?