Multiple "Between Battle" Scripts?

quechanmok

New member
I am not a programmer. I am but a mere user. I was wondering if Mafia supported more than one between battle script. I have two I set using "set betweenBattleScript=" but I did them one after another. Do I need to set them at the same time? I am ignorant of what to do. Help would be appreciated.
 

Theraze

Active member
Yes and no. Set them in moods with "always" triggering. That functions like a betweenBattleScript, and also triggers during manual adventuring if you turn on the moods during manual adventures...
 

slyz

Developer
The short answer is no, you can't. You must modify one of the scripts so that it calls the other in the process.

If you have script1.ash and script2.ash, the easiest/simplest way is to add this line at the top of script1.ash (after any "import" commands):
PHP:
cli_execute( "call script2.ash" );
 

holatuwol

Developer
Actually, while the UI for setting a between battle script doesn't support it, it's fully supported because (whether people realize it or not), the between battle script variable is parsed as a CLI command. Therefore if you do something like set your betweenBattleScript preference to "call script1.ash; call script2.ash" then KoLmafia will invoke both scripts.
 

slyz

Developer
It looks like the recoveryScript, buyScript, chatbotScript and counterScript preferences need to be the name of an ASH script with a main() that takes the correct parameters.

The plantingScript preference has to be the name of an ASH file without the ".ash".

The loginScript, logoutScript, postAscensionScript, preAscensionScript and betweenBattleScript preferences are simply executed as CLI commands.

I'll update the wiki info on all this.
 

quechanmok

New member
I ended up using:
set betweenbattlescript = call script1.ash; call script2.ash
I got no errors so far... thanks everybody!
 
Top