Automation scripts

theo1001

Member
How do the scripts in Preferences->Automation work?
Specifically when do they trigger, what info do they take as input and what should they return.

What i know so far based on a mix of guesswork and checking scripts i am using. I've marked with "?" the statements where i am purely guessing.

On Login: triggers when you log in.
Definition: void main()

On Logout: triggers when you logout.
Definition: void main()

Recovery: triggers when you are getting healed, either through the use of restore_hp(), restore_mp(), "restore hp", "restore mp" or when mafia automatically tried to heal you.
Definition: boolean main(string type, int amount)
type: "MP" or "HP", depending on what you tried to heal.
amount: how much MP/HP you wanted to heal.
return true if you want to tell KoLmafia that you handled the healing and it should do nothing, false if you want KoLmafia to still try and heal you when the script ends.

Pre-Adventure: Triggers before each adventure.
Definition: void main()

Post-Adventure: Triggers after each adventure.
Definition: void main()?

Counter Script: Triggers every time one of your counters decreases. Does that also include timers or only mafia counters?
Definition: boolean main(string name, int remain)
name: name of the counter
remain: how many turns remain on the counter
Return false if you want to trigger an abort(), true if you would like automation to continue normally?

Familiar Script: something to do with familiars?

King Freed: triggers when you free the king.
Definition: void main()?

Pre-Ascension: triggers when you press the Ascend button?
Definition: void main()?

Post-Ascension: triggers when you ascend from valhalla
Definition: void main()

Before PvP: triggers before each individual pvp attack?
Definition: ?

Buy Script: triggers when buying stuff? Does it trigger only on automated purchases or does it also trigger when you manually buy through the mall store through either the relay browser or the KoLmafia interface?
Definition: ?

Planting: something to do with planting in the mushroom field in degrassi knoll?
Definition: ?

Chatbot Script: something to do about chat?
Definition: ?
 

VladYvhuce

Member
Planting: Your automation for daily planting and harvesting the mushroom plot. If set up, it will plant, pick, and show a forecast for the next day.
Don't know what to put for Definition, though...
 

Veracity

Developer
Staff member
Note that "script" does not necessarily mean "ASH script". For many of them, you can put in a CLI script - or even just semicolon separated CLI commands.
 

AlbinoRhino

Active member
Revision 15922 by lostcalpolydude
2015-06-09 13:44:45

Add Familiar Script. This script will run after changing familiars, before automatically changing familiar equipment. The script should have a boolean main() function. Returning true will cause normal familiar equipiment switching to be skipped, while false will lead to it running after thescript returns.
 

VladYvhuce

Member
Don't forget a note about Familiar Script having to be set via CLI command. Setting it via the blank won't work properly.
 

Veracity

Developer
Staff member
It means trying to set it by filling in the blank with the script you want to use. What did you think it meant?
I couldn't parse the phrase using English as I speak it. Which is to say, I didn't think it meant anything.

(Seriously: I asked for clarification of something I couldn't understand and you first clarify - good! stop there! - and then you mouth off at somebody who was trying to help you - bad! What was the point of doing that?

No worries; there are others who will, no doubt, pay attention to you henceforth.)
 

Bale

Minion
VladYvhuce, pardon me for asking, but are you a native speaker of English? You've had a few exchanges like this so I have grown curious.
 

VladYvhuce

Member
VladYvhuce, pardon me for asking, but are you a native speaker of English? You've had a few exchanges like this so I have grown curious.
Yes. I only speak English. I'm working on learning Muskogee (Yvhuce = Coyote in Muskogee) and Cherokee. To be honest, I'm wondering about those who keep confusing what I say... I haven't had this much trouble on other forums...
 

VladYvhuce

Member
I couldn't parse the phrase using English as I speak it. Which is to say, I didn't think it meant anything.

(Seriously: I asked for clarification of something I couldn't understand and you first clarify - good! stop there! - and then you mouth off at somebody who was trying to help you - bad! What was the point of doing that?

No worries; there are others who will, no doubt, pay attention to you henceforth.)
Actually, that was a serious question. If I know more about what's going through your head when you read something I write, then I can try to see things as you may be seeing them and, thus, try to avoid confusion.
 
Top