Difference between pages "Empty closet" and "Mood"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(r10227)
 
imported>Relyk
 
Line 1: Line 1:
{{
+
A mood is a set of triggers that are executed after an adventure.
#vardefine:name|empty_closet}}{{
 
#vardefine:return_type|boolean}}{{
 
  
FunctionPage|
+
== Interface ==
name={{#var:name}}|
 
  
function1={{Function|
+
=== Buttons ===
name={{#var:name}}|
+
; Settings
aggregate={{#var:aggregate}}|
+
* Trigger On: The trigger to check the mood for an action.
return_type={{#var:return_type}}|
+
* Check For: The condition required to take an action.
return_also={{#var:return_also}}|
+
* Command: The [[CLI Reference|CLI]] command to execute.
}}|
 
  
function_description=Remove every item from the closet in a single server hit. Returns true if the move succeeds and false if it does not.|
+
; Controls
 +
* add entry - Add an entry to the mood with the current settings.
 +
* auto-fill
 +
** minimal set - Adds all current active effects on the player. Users will find this function extremely useful.
 +
** maximal set - Adds the castable buffs availabe to the player. This only includes buffs available from skills.
  
code1={{CodeSample|
+
; Management
title=Useful example for use in a kingLiberatedScript|
+
* Active mood - A drop-list of moods with the curent active mood. The scroll box lists all triggers for the active mood.
description=Empty closet and Hangks together at the end of a run|
+
* new list - Create a new mood. Entering the name of an existing mood will set it as active.
code=
+
* delete list - Deletes the current active mood selected.
<syntaxhighlight>
+
* copy list - Copy the current triggers of the active mood into a new mood. This will replace the mood if it exists.
if(get_property("lastEmptiedStorage").to_int() != my_ascensions()) {
+
* execute - Execute the current mood.
  empty_closet();
 
  visit_url("storage.php?action=pullall&pwd");
 
}
 
</syntaxhighlight>}}|
 
  
see_also={{SeeAlso|take_closet|put_closet|take_stash|take_storage}}|
+
=== Triggers ===
cli_equiv=The CLI command "closet" with the parameter "empty" works similarly.
+
There are three types of triggers in the drop-down list. A trigger is checked upon the completion of an adventure or prompt from the user.
}}
+
* When an effect is lost - An effect is no longer active on the character.
 +
* When an effect is gained - An effect is active on the character.
 +
* Unconditional trigger - Trigger command is executed every time.
  
[[Category:Item Management]]
+
=== Condition ===
 +
If the trigger is for an effect, the field is a drop-down list of all the effects in the game. The interface will fuzzy match to what the user types in. In addition, the interface will match common abbreviations such as "sss" matching to "Shortie Shaman Shurprise" and "Stevedave's Shanty of Superiority". The filtering is quite robust. For example, the interface will accept "2020" as matching to 20/20 Vision.
 +
 
 +
Unconditional triggers will always execute the command and does not allow the user to add a condition.
 +
 
 +
=== Command ===
 +
The command is a [[CLI Reference|CLI]] command. The command will be executed if the condition for the trigger is true. Unconditional triggers are primarily for advanced users as it requires familiarity with the CLI and scripting. Typical usage is to use an if statement to check for the condition and then excute a command. See [[CLI Reference#Scripting|CLI scripting]] for control structures avaialble for scripting.
 +
 
 +
== Using the CLI ==
 +
Moods are can be managed through the CLI using "mood" and "trigger" commands.
 +
 
 +
<pre>
 +
mood* list | listall | clear | autofill | execute | repeat [numTimes] | moodName [numTimes] - mood management.
 +
trigger* list | clear | autofill | [type,] effect [, action] - edit current mood
 +
</pre>
 +
 
 +
;mood
 +
* <code>mood</code> - List all triggers for current mood. Equivalent to <code>trigger list</code>.
 +
* <code>mood list</code> - List all saved moods including active mood.
 +
* <code>mood clear</code> - Remove all triggers from the current mood. Ignores composable moods.
 +
* <code>mood autofill</code> - List current moods available.
 +
* <code>mood repeat [numTimes]</code> - Execute current mood number of times. Default to 1.
 +
* <code>mood <mood> [numTimes]</code> - Execute the given mood number of times. Default to 1. If mood doesn't exist, does nothing.
 +
 
 +
;[[trigger]]
 +
See the page for information.
 +
 
 +
== Composable moods ==
 +
Composable moods can be used to combine a set of moods together. Composable moods are handled through the CLI as the interface doesn't have equivalent functionality.
 +
 
 +
<pre>
 +
<mood> extends <mood>[, mood]
 +
</pre>
 +
 
 +
A composable mood is treated just like a normal mood but multiple moods. In addition, triggers can be added and removed from the mood itself. If you want to clear all the moods the composable mood is referencing without removing triggers specific to the mood, you can extend the "apathetic" mood.
 +
 
 +
<pre>
 +
mood default extends apathetic
 +
</pre>
 +
 
 +
Anonymous composable moods can be created by using a list of existing moods. Anonymous moods are temporary and will disappear when the mood is changed or the session ends. This is useful when you don't want to create a new mood every time.
 +
 
 +
<pre>
 +
mood combat, item, sea
 +
</pre>
 +
 
 +
=== Example ===
 +
A common example is a player making a farming mood. Instead of creating a mood for effects that increase item and meat in a single list, the player creates a "item" and "meat" mood. The player then defines a "farm" mood consisting of the item and meat moods.
 +
 
 +
<pre>
 +
mood farm extends item, meat
 +
</pre>
 +
 
 +
[[Category:Automation]]

Revision as of 00:38, 24 September 2015

A mood is a set of triggers that are executed after an adventure.

Interface

Buttons

Settings
  • Trigger On: The trigger to check the mood for an action.
  • Check For: The condition required to take an action.
  • Command: The CLI command to execute.
Controls
  • add entry - Add an entry to the mood with the current settings.
  • auto-fill
    • minimal set - Adds all current active effects on the player. Users will find this function extremely useful.
    • maximal set - Adds the castable buffs availabe to the player. This only includes buffs available from skills.
Management
  • Active mood - A drop-list of moods with the curent active mood. The scroll box lists all triggers for the active mood.
  • new list - Create a new mood. Entering the name of an existing mood will set it as active.
  • delete list - Deletes the current active mood selected.
  • copy list - Copy the current triggers of the active mood into a new mood. This will replace the mood if it exists.
  • execute - Execute the current mood.

Triggers

There are three types of triggers in the drop-down list. A trigger is checked upon the completion of an adventure or prompt from the user.

  • When an effect is lost - An effect is no longer active on the character.
  • When an effect is gained - An effect is active on the character.
  • Unconditional trigger - Trigger command is executed every time.

Condition

If the trigger is for an effect, the field is a drop-down list of all the effects in the game. The interface will fuzzy match to what the user types in. In addition, the interface will match common abbreviations such as "sss" matching to "Shortie Shaman Shurprise" and "Stevedave's Shanty of Superiority". The filtering is quite robust. For example, the interface will accept "2020" as matching to 20/20 Vision.

Unconditional triggers will always execute the command and does not allow the user to add a condition.

Command

The command is a CLI command. The command will be executed if the condition for the trigger is true. Unconditional triggers are primarily for advanced users as it requires familiarity with the CLI and scripting. Typical usage is to use an if statement to check for the condition and then excute a command. See CLI scripting for control structures avaialble for scripting.

Using the CLI

Moods are can be managed through the CLI using "mood" and "trigger" commands.

mood* list | listall | clear | autofill | execute | repeat [numTimes] | moodName [numTimes] - mood management.
trigger* list | clear | autofill | [type,] effect [, action] - edit current mood
mood
  • mood - List all triggers for current mood. Equivalent to trigger list.
  • mood list - List all saved moods including active mood.
  • mood clear - Remove all triggers from the current mood. Ignores composable moods.
  • mood autofill - List current moods available.
  • mood repeat [numTimes] - Execute current mood number of times. Default to 1.
  • mood <mood> [numTimes] - Execute the given mood number of times. Default to 1. If mood doesn't exist, does nothing.
trigger

See the page for information.

Composable moods

Composable moods can be used to combine a set of moods together. Composable moods are handled through the CLI as the interface doesn't have equivalent functionality.

<mood> extends <mood>[, mood] 

A composable mood is treated just like a normal mood but multiple moods. In addition, triggers can be added and removed from the mood itself. If you want to clear all the moods the composable mood is referencing without removing triggers specific to the mood, you can extend the "apathetic" mood.

mood default extends apathetic

Anonymous composable moods can be created by using a list of existing moods. Anonymous moods are temporary and will disappear when the mood is changed or the session ends. This is useful when you don't want to create a new mood every time.

mood combat, item, sea

Example

A common example is a player making a farming mood. Instead of creating a mood for effects that increase item and meat in a single list, the player creates a "item" and "meat" mood. The player then defines a "farm" mood consisting of the item and meat moods.

mood farm extends item, meat