Difference between revisions of "Miscellaneous ASH Features"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>StDoodle
Line 20: Line 20:
 
==Additional Script Uses==
 
==Additional Script Uses==
  
In addition to regular menu-or-CLI-selectable scripts and relay override scripts, you can also use a script for:
+
In addition to regular menu-or-CLI-selectable scripts and relay override scripts, you can also use a script for a few other situations. These situations are listed below, along with the preference that you can set a script name to (in parentheses).
  
* Between Battle (betweenBattleScript)
+
* Between Battle (betweenBattleScript)<br />
* Buy (buyScript)
+
:Executed (before?) every combat.
* Chatbot (chatbotScript)
+
* Buy (buyScript)<br />
* Counters (counterScript)
+
:Executed when / how?
* Login (loginScript)
+
* Chatbot (chatbotScript)<br />
* Logout (logoutScript)
+
:This works how?
* Planting (plantingScript)
+
* Counters (counterScript)<br />
* Post Ascension (postAscensionScript)
+
:Again, don't understand.
* Pre Ascension (preAscensionScript)
+
* Login (loginScript)<br />
* Profit (profitScript?)
+
:This script is immediately executed once your character is logged in.
* Recovery (recoveryScript)
+
* Logout (logoutScript)<br />
* ??
+
:This script is executed right before logging out. Not that an [[abort|abort()]] in the script won't stop a logout unless the logout was called in (specific ways, please list).
 +
* Planting (plantingScript)<br />
 +
:Halp!
 +
* Post-Ascension (postAscensionScript)<br />
 +
:Executed at once when your character starts a new ascension.
 +
* Pre-Ascension (preAscensionScript)<br />
 +
:Executed right before entering Valhalla.
 +
* Recovery (recoveryScript)<br />
 +
:Executed whenever mafia would recover your HP / MP. (Does this effect the whole negative status effects handling?) This is what you set Bale's "Universal_recovery.ash" to.
  
 
==A little CLI help==
 
==A little CLI help==

Revision as of 15:10, 16 April 2010

Special Syntax Functions

notify

Used to send a simple kmail to the script's author, letting them know you use their script.

import

Used to load an external script into your current one.

Comments

Adding Comments to your code can make it much easier to maintain, and helps other users understand what's going on.

Errors

For help when things go wrong, please see the page on ASH Errors.

Additional Script Uses

In addition to regular menu-or-CLI-selectable scripts and relay override scripts, you can also use a script for a few other situations. These situations are listed below, along with the preference that you can set a script name to (in parentheses).

  • Between Battle (betweenBattleScript)
Executed (before?) every combat.
  • Buy (buyScript)
Executed when / how?
  • Chatbot (chatbotScript)
This works how?
  • Counters (counterScript)
Again, don't understand.
  • Login (loginScript)
This script is immediately executed once your character is logged in.
  • Logout (logoutScript)
This script is executed right before logging out. Not that an abort() in the script won't stop a logout unless the logout was called in (specific ways, please list).
  • Planting (plantingScript)
Halp!
  • Post-Ascension (postAscensionScript)
Executed at once when your character starts a new ascension.
  • Pre-Ascension (preAscensionScript)
Executed right before entering Valhalla.
  • Recovery (recoveryScript)
Executed whenever mafia would recover your HP / MP. (Does this effect the whole negative status effects handling?) This is what you set Bale's "Universal_recovery.ash" to.

A little CLI help

Two CLI commands are of great use to ASH scripters:

  • ashref allows one to get a list of ASH functions
  • ash or ashq allows one to run ASH directly on the CLI.

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:

  • Where are all the other places a script can be used? Help plox.