Difference between pages "Template:Attention" and "Daily Deeds"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>StDoodle
m
 
imported>Roippi
 
Line 1: Line 1:
<includeonly>=={{#if: {{{message|}}} | {{{message}}} | Attention KoLmafia Users!}}==
+
=== Customizing Daily Deeds ===
{{#if: {{{1|}} | <p>{{{1}}}</p> | }}</includeonly>
 
<noinclude>
 
This function should always be called outside of ''all'' function calls, at the very end of the page (or before category links).
 
  
It should always be called with a parameter, and will display:
+
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.
  
== Attention KoLmafia Users! ==
+
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.
<p>Parameter supplied goes here.</p>
 
  
The "Attention..." message can be overridden with the named parameter "message."
+
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.
  
[[Category:Notification Templates]]
+
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.
</noinclude>
+
 
 +
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
 +
 
 +
<pre style="white-space:pre-wrap;">
 +
> 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.
 +
</pre>
 +
 
 +
: [[File:Ddprefs3.JPG]]
 +
 
 +
 
 +
==== Command ====
 +
execute a command with a button press
 +
 
 +
acceptable forms:
 +
 
 +
Command|displayText|preference
 +
 
 +
Command|displayText|preference|command
 +
 
 +
Command|displayText|preference|command|maxUses
 +
 
 +
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 - 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 <preference>/<maxUses> will be displayed to the right of the button.
 +
 
 +
==== 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:
 +
 
 +
BooleanItem|displayText|preference
 +
 
 +
BooleanItem|displayText|preference|itemName
 +
 
 +
Item|displayText|preference|itemName|maxUses
 +
 
 +
*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
 +
 
 +
*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.
 +
 
 +
[[Category:Tech Support]]

Revision as of 09:08, 23 August 2011

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.
Ddprefs3.JPG


Command

execute a command with a button press

acceptable forms:

Command|displayText|preference

Command|displayText|preference|command

Command|displayText|preference|command|maxUses

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 - 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 <preference>/<maxUses> will be displayed to the right of the button.

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:

BooleanItem|displayText|preference

BooleanItem|displayText|preference|itemName

Item|displayText|preference|itemName|maxUses

  • 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

  • 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.