Daily Deeds

From Kolmafia
Revision as of 04:27, 29 June 2011 by imported>Bale (add illustration)
Jump to navigation Jump to search

Customizing Daily Deeds

Nothing below is actually a part of KoLmafia yet. It requires a patch posted on the forum here. I just wanted to put this information in a place where I could find it easily.

All deeds are specified by one comma-delimited preference "dailyDeedsOptions". Order matters. Built-in deeds are simply called by referring to their built-in name; these are viewable by pulling up the Daily Deeds tab and looking in the "Built-in Deeds" list. In the source code these can be found in DailyDeedsPanel.BUILTIN_DEEDS.

Custom deeds provide the user with a way of adding buttons or text to their daily deeds panel that is not natively provided for. All deeds start with the keyword $CUSTOM followed by a pipe symbol, |. As you are constructing a custom deed, you separate the different arguments with pipes.

All deed types except for Text require a preference to track. If you want to add a button that is always enabled, you will have to create a dummy preference that is always false.

There are currently 5 different types of custom deeds. Remember that all of these "acceptable forms" are prefaced by $CUSTOM|.


Example

The following image is created by this declaration

> get dailyDeedsOptions

$CUSTOM|Text|Demonstration of customized Daily Deeds,$CUSTOM|Text|//\\//\\//\\ by Roippi //\\//\\//\\,$CUSTOM|Text| ,$CUSTOM|Text|This is a built-in deed:,VIP Pool,$CUSTOM|Text|So is this:,April Shower,$CUSTOM|Text| ,$CUSTOM|Text|This is a custom "BooleanPref" button that tracks a preference (hermitHax0red),$CUSTOM|Text|If/when hermitHax0red is true,| this deed is greyed out.,$CUSTOM|Text|When clicked|,| it gets clovers.,$CUSTOM|BooleanPref|Is the hermit hax0red?|hermitHax0red|hermit * clover,$CUSTOM|Text| ,$CUSTOM|Text|This is a custom line of text that also tracks some preferences:,$CUSTOM|Text|I've ascended |knownAscensions| times. My last adventure was in zone: |lastAdventure,$CUSTOM|Text| ,$CUSTOM|Text|This is a "Skill" type button. It has a few uses,| but usually tracks a multi-use skill with an arbitrary limit:,$CUSTOM|Skill|get me some BRICKOs|libramSummons|summon brickos|7,$CUSTOM|Text| ,$CUSTOM|Text|Lastly,| here is a 'MultiPref' deed.,$CUSTOM|Text|You define the displayText,| an int preference,| the button command,| and the preference disabling threshold.,$CUSTOM|Text|It is up to you to make the preference track whatever your button is doing.,$CUSTOM|MultiPref|Run my custom ASH script up to 5 times|_farmingLoops|call farm.ash|5,$CUSTOM|Text| ,$CUSTOM|Text|You can define your own preferences and call ash scripts with your button commands.,$CUSTOM|Text|I haven't demonstrated all of the different types and overloaded variants here,| but this should be a good starting place.,$CUSTOM|Text|Have fun.


BooleanPref

one-a-day deed

acceptable forms: BooleanPref|displayText|preference BooleanPref|displayText|preference|command

displayText - the text that will be displayed on the button preference - the boolean preference to track. The button will be enabled when the preference is false, and disabled when the preference is true. command (optional) - the command to execute. If not specified, will default to displayText.


MultiPref

n-times-a-day deed

acceptable forms: BooleanPref|displayText|preference|command|maxUses

  • preference - the integer preference to track. The button will be enabled when preference < maxUses.
  • maxUses - an arbitrary integer. Specifies a threshold to disable the button at. A counter in the form of <preference>/<maxUses> will be displayed to the right of the button.


BooleanItem

this button will use fuzzy matching to find the name of the item specified. Will execute "use <itemName>" when clicked. Will only be visible when you possess one or more of the item.

acceptable forms: BooleanItem|displayText|preference BooleanItem|displayText|preference|itemName

  • itemName - the name of the item that will be used. If not specified, will default to displayText.


Skill

cast a skill that is tracked by a boolean or int preference. Will execute "cast <skillName>" when clicked.

acceptable forms: Skill|displayText|preference Skill|displayText|preference|skillName Skill|displayText|preference|skillName|maxCasts

  • preference - a boolean preference if the 3- or 4-argument version is used, or an integer preference if the 5-argument version is used.
  • skillName- the name of the skill that will be cast. If not specified, will default to displayText. Must be specified if maxCasts are specified.
  • maxCasts - an arbitrary integer. Specifies a threshold to disable the button at. A counter in the form of <preference>/<maxCasts> will be displayed to the right of the button.


Text

acceptable forms: Text|pretty much anything.

You can supply as many arguments as you want to a Text deed. Any argument that uniquely matches a preference will be replaced by that preference's value. If you want to use a comma in your text, immediately follow the comma with a pipe character so it will not be parsed as the end of the Text deed.