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: ?
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: ?