[quote author=holatuwol link=topic=119.msg1069#msg1069 date=1150076233]
Change it so that the player name is the first line of the script (rather than "login player name") and redirect the input; this ensures that an abort will not affect your run sequence in any way.[/quote]
I had thought about creating the following file:
exit.txt
and redirecting that file as the input for kolmafia, but had never actually thought of redirecting the "wrapper" script.
Changing MultiAccount.bat to:
Code:
java -jar KoLmafia-7.1.jar --CLI < scripts\script3.txt
java -jar KoLmafia-7.1.jar --CLI < scripts\script2.txt
java -jar KoLmafia-7.1.jar --CLI < scripts\script1.txt
java -jar KoLmafia-7.1.jar --CLI < scripts\script.txt
and script#.txt to
Code:
username
call scripts\doit.ash
exit
Should do it.
Script#.txt could also read:
if the "doit.ash" script is in the scripts folder.
Another little addition:
Code:
cli_execute("mirror success.txt");
print(my_name());
cli_execute("mirror");
adding that as the very last thing into "doit.ash" or whatever your filename of choice
and adding:
to the begining of MultiAccount.bat will build a list of character names which made it from the begining of the script "doit.ash" to the end. In this case though "doit.ash" must be an ash script. because I believe the my_name() function is only available in ash scripting.
"Del success.txt > nul" will delete the file with no prompt whatsoever to the user. Placing it at the begining of the batch file will cause a fresh list to be generated daily. also remember to have the batch file in the same directory as kolmafia (or modify the path to all files accordingly).
a small explanation:
the > character routes any output from a dos based program to the filename which follows. The file will be overwritten if it exists.
using >> will do the same, but add the output to the end of the file rather than to overwrite the file.
nul is nothing, nowhere. When redirecting the output of a program or command to nul, the output is simply discarded as if it never even existed.
using < tells dos that when the program is waiting for input to read a line from the filename that follows the character and send it to the program as if the user had typed it in manually.