Difference between revisions of "Daily Deeds"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
imported>Darzil
 
(19 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=== Customizing Daily Deeds ===
+
Basic daily deed customization allows you to show/hide elements on the daily deeds panel, and to reorder those elements as desired.  More advanced customization features include adding "custom deeds" that can perform a variety of tasks: everything from performing a CLI command, to using an item or casting a skill, to executing ASH scripts.
  
Nothing below is actually a part of KoLmafia yet. It requires a patch posted on the forum [http://kolmafia.us/showthread.php?6961-advice-daily-deeds-polish&p=54010&viewfull=1#post54010 here]. I just wanted to put this information in a place where I could find it easily.
+
== Customizing Daily Deeds ==
  
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.
+
Daily Deeds customization essentially involves editing a user preference in order to specify the elements shown on the Daily Deeds panel.  Fortunately, a GUI exists to aid you in performing the most common tasks.  This is reached by going to Preferences > Daily Deeds tab.
  
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.
+
To edit which deeds are shown, look at the bottom of this panel. Each element represents a line on your Daily Deeds panel. Many of these are individual buttons; "Breakfast", for example, is a button that simply executes breakfast.  Some deeds are more complicated, such as the "Demon Summoning" deed that adds a combobox filled with your currently known summons. Still others simply represent informational lines of text displayed by default at the bottom. You can rearrange these at will by dragging and dropping.  Remove unwanted deeds by pressing the delete key; re-add them by dragging and dropping the appropriate element from the "Built-in Deeds" box up above.
 
 
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|.
 
  
 +
To start creating custom deeds, click the "add custom" button.  A GUI will pop up which will help you build custom command, item, skill, and/or text deeds.  Combo deeds for now (and likely forever) will need to be hand-coded if you want to use them.
  
 
==== Example ====
 
==== Example ====
Line 18: Line 15:
 
> get dailyDeedsOptions
 
> 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.
+
$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 "Command" 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|Command|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 multiple Command 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|Command|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.
 
</pre>
 
</pre>
  
Image uploading currently disabled. Darnit. I'll put the image up later.
+
: [[File:Ddprefs3.JPG]]
 +
 
 +
 
 +
== Custom Deeds ==
 +
 
 +
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.
  
==== BooleanPref ====
+
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.
one-a-day deed
+
 
 +
All deed types except for Text and Simple require a preference to track. If you want to add a button that is always enabled, use a dummy preference (you do not have to create one, just specify one that doesn't exist, such as "false").
 +
 
 +
There are currently 6 different types of custom deeds. Remember that all of these "acceptable forms" are prefaced by $CUSTOM|.
 +
 
 +
==== Simple ====
 +
As the name implies, this type of deed is the simplest to use.  Designed for users who do not want to muck around with preferences.
  
 
acceptable forms:
 
acceptable forms:
BooleanPref|displayText|preference
 
BooleanPref|displayText|preference|command
 
  
displayText - the text that will be displayed on the button
+
Simple|displayText
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.
 
  
 +
Simple|displayText|command
  
==== MultiPref ====
+
Simple|displayText|command|maxUses
n-times-a-day deed
+
 
 +
Simple|displayText|command|maxUses|toolTip|compMessage
 +
 
 +
*displayText - the text that will be displayed on the button
 +
*command - the command to execute. If not specified, will default to displayText.
 +
*maxUses - an arbitrary integer. Specifies a threshold to disable the button at. A counter in the form of <clicks>/<maxUses> will be displayed to the right of the button.
 +
*toolTip - text that will display when you mouse over the button.
 +
*compMessage - message that displays when you have used the button (maxUses times if specified), rather than the button vanishing.
 +
 
 +
After clicking a simple deed, the button will be immediately disabled unless maxUses>1 is specified.
 +
 
 +
==== Command ====
 +
execute a command with a button press
  
 
acceptable forms:
 
acceptable forms:
BooleanPref|displayText|preference|command|maxUses
 
  
*preference - the integer preference to track. The button will be enabled when preference < maxUses.
+
Command|displayText|preference
*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.
 
  
 +
Command|displayText|preference|command
  
==== BooleanItem ====
+
Command|displayText|preference|command|maxUses
 +
 
 +
Command|displayText|preference|command|maxUses|toolTip|CompMessage
 +
 
 +
*preference - the preference to track for enabling/disabling the button.  Default threshold for disabling the button is 1 if maxUses is not specified.
 +
 
 +
Further information regarding custom preferences and button enabling/disabling can be found [http://kolmafia.us/showthread.php?7347-Daily-Deeds-support&p=58295&viewfull=1#post58295 here].
 +
 
 +
==== Item ====
 
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.
 
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:
 
acceptable forms:
BooleanItem|displayText|preference
+
 
BooleanItem|displayText|preference|itemName
+
Item|displayText|preference
 +
 
 +
Item|displayText|preference|itemName
 +
 
 +
Item|displayText|preference|itemName|maxUses
 +
 
 +
Item|displayText|preference|itemName|maxUses|toolTip|compMessage
  
 
*itemName - the name of the item that will be used. If not specified, will default to displayText.
 
*itemName - the name of the item that will be used. If not specified, will default to displayText.
 
  
 
==== Skill ====
 
==== Skill ====
cast a skill that is tracked by a boolean or int preference. Will execute "cast <skillName>" when clicked.  
+
cast a skill that is tracked by a boolean or int preference. Will execute "cast <skillName>" when clicked.  Will not be visible if you don't know the skill.
  
 
acceptable forms:
 
acceptable forms:
 +
 
Skill|displayText|preference
 
Skill|displayText|preference
 +
 
Skill|displayText|preference|skillName
 
Skill|displayText|preference|skillName
 +
 
Skill|displayText|preference|skillName|maxCasts
 
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.
+
Skill|displayText|preference|skillName|maxCasts|toolTip|compMessage
 +
 
 
*skillName- the name of the skill that will be cast. If not specified, will default to displayText. Must be specified if maxCasts are specified.
 
*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.
 
  
 +
==== Combo ====
 +
 +
$CUSTOM|Combo|displayText|preference1|<item block>
 +
 +
$CUSTOM|Combo|displayText|preference1|maxUses|<item block>
 +
 +
 +
where the <item block> consists of an arbitrary number of:
 +
 +
$ITEM|displayText|preferenceN|command|
 +
 +
This is a cleaner way of collapsing a number of related command deeds into one combobox element.  Note that there is no GUI to help you construct this, you must manually add it to your dailyDeedsOptions preference.
 +
 +
*Preference1 - The preference to track for enabling/disabling the '''entire combobox'''.  Default threshold is 1 if maxUses is not specified.
 +
*Preference2 - The individual preference to disable each individual item in the combobox.  Note that there is no way to supply maxUses for each individual element; 1 (or true) is always the max.
 +
 +
A common use of this deed is to create a custom Greatest American Pants combobox:
 +
 +
<pre style="white-space:pre-wrap;">
 +
$CUSTOM|Combo|GAPants|_gapBuffs|5|$ITEM|free spells|false|equip pants American; gap skill|$ITEM|elem & tough|false|equip pants American; gap structure|$ITEM|+25%ItemD|false|equip pants American; gap vision|$ITEM|+100%Mox|false|equip pants American; gap speed|$ITEM|5xCrit|false|equip pants American; gap accuracy</pre>
 +
 +
[[File:GAPdeed.png]]
  
 
==== Text ====
 
==== Text ====

Latest revision as of 20:04, 7 August 2016

Basic daily deed customization allows you to show/hide elements on the daily deeds panel, and to reorder those elements as desired. More advanced customization features include adding "custom deeds" that can perform a variety of tasks: everything from performing a CLI command, to using an item or casting a skill, to executing ASH scripts.

Customizing Daily Deeds

Daily Deeds customization essentially involves editing a user preference in order to specify the elements shown on the Daily Deeds panel. Fortunately, a GUI exists to aid you in performing the most common tasks. This is reached by going to Preferences > Daily Deeds tab.

To edit which deeds are shown, look at the bottom of this panel. Each element represents a line on your Daily Deeds panel. Many of these are individual buttons; "Breakfast", for example, is a button that simply executes breakfast. Some deeds are more complicated, such as the "Demon Summoning" deed that adds a combobox filled with your currently known summons. Still others simply represent informational lines of text displayed by default at the bottom. You can rearrange these at will by dragging and dropping. Remove unwanted deeds by pressing the delete key; re-add them by dragging and dropping the appropriate element from the "Built-in Deeds" box up above.

To start creating custom deeds, click the "add custom" button. A GUI will pop up which will help you build custom command, item, skill, and/or text deeds. Combo deeds for now (and likely forever) will need to be hand-coded if you want to use them.

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 "Command" 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|Command|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 multiple Command 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|Command|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.
Ddprefs3.JPG


Custom Deeds

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.

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 and Simple require a preference to track. If you want to add a button that is always enabled, use a dummy preference (you do not have to create one, just specify one that doesn't exist, such as "false").

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

Simple

As the name implies, this type of deed is the simplest to use. Designed for users who do not want to muck around with preferences.

acceptable forms:

Simple|displayText

Simple|displayText|command

Simple|displayText|command|maxUses

Simple|displayText|command|maxUses|toolTip|compMessage

  • displayText - the text that will be displayed on the button
  • command - the command to execute. If not specified, will default to displayText.
  • maxUses - an arbitrary integer. Specifies a threshold to disable the button at. A counter in the form of <clicks>/<maxUses> will be displayed to the right of the button.
  • toolTip - text that will display when you mouse over the button.
  • compMessage - message that displays when you have used the button (maxUses times if specified), rather than the button vanishing.

After clicking a simple deed, the button will be immediately disabled unless maxUses>1 is specified.

Command

execute a command with a button press

acceptable forms:

Command|displayText|preference

Command|displayText|preference|command

Command|displayText|preference|command|maxUses

Command|displayText|preference|command|maxUses|toolTip|CompMessage

  • preference - the preference to track for enabling/disabling the button. Default threshold for disabling the button is 1 if maxUses is not specified.

Further information regarding custom preferences and button enabling/disabling can be found here.

Item

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:

Item|displayText|preference

Item|displayText|preference|itemName

Item|displayText|preference|itemName|maxUses

Item|displayText|preference|itemName|maxUses|toolTip|compMessage

  • 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. Will not be visible if you don't know the skill.

acceptable forms:

Skill|displayText|preference

Skill|displayText|preference|skillName

Skill|displayText|preference|skillName|maxCasts

Skill|displayText|preference|skillName|maxCasts|toolTip|compMessage

  • skillName- the name of the skill that will be cast. If not specified, will default to displayText. Must be specified if maxCasts are specified.

Combo

$CUSTOM|Combo|displayText|preference1|<item block>

$CUSTOM|Combo|displayText|preference1|maxUses|<item block>


where the <item block> consists of an arbitrary number of:

$ITEM|displayText|preferenceN|command|

This is a cleaner way of collapsing a number of related command deeds into one combobox element. Note that there is no GUI to help you construct this, you must manually add it to your dailyDeedsOptions preference.

  • Preference1 - The preference to track for enabling/disabling the entire combobox. Default threshold is 1 if maxUses is not specified.
  • Preference2 - The individual preference to disable each individual item in the combobox. Note that there is no way to supply maxUses for each individual element; 1 (or true) is always the max.

A common use of this deed is to create a custom Greatest American Pants combobox:

$CUSTOM|Combo|GAPants|_gapBuffs|5|$ITEM|free spells|false|equip pants American; gap skill|$ITEM|elem & tough|false|equip pants American; gap structure|$ITEM|+25%ItemD|false|equip pants American; gap vision|$ITEM|+100%Mox|false|equip pants American; gap speed|$ITEM|5xCrit|false|equip pants American; gap accuracy

GAPdeed.png

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.