Bash scripting help?

masterZ

New member
I probably won't be near a computer near christmas and also don't want to miss Crimbo content.

So, I have already written a script for what I want my character to do while I'm gone (adv at factory/don's, crimbo 11,etc.) , but I wont be able to login.

Can someone help me start a bash script that automatically runs kolmafia at a specific time of day? I only need a few commands on timing. After that, I should be able to figure everything out myself.
 

ankorite

New member
this is my crontab entry
PHP:
45 8 * * * /home/your_name/kol/launchkol.sh >/dev/null 2>&1
And here is the script
PHP:
 #!/bin/bash
kol_dir=/home/your_name/kol
mafia_src=$kol_dir/kolmafia
cd $mafia_src
ant daily
rm $kol_dir/daily.jar
mv $mafia_src/dist/KoLmafia* $kol_dir/daily.jar
xterm -display :0 -e "/usr/bin/java -jar $kol_dir/daily.jar"
It uses ant to download the daily snapshot and compile it.
If this helps send some rocky raccoons to me ;)
 

Bale

Minion
So, I have already written a script for what I want my character to do while I'm gone (adv at factory/don's, crimbo 11,etc.) , but I wont be able to login.
Do you realize that there is a choice adventure that you'll need to answer before fighting the final monster in the factory/don's? Don't forget to account for that in your script, or else you'll get stuck and adventure no more. I suspect you'll have to use alihifar's run_adventure() to automatically answer choice adventures whose adventure numbers are still unknown.

If you've already created a solution for that problem of automation, I'm curious to see it.
 

Alhifar

Member
The choice adventures are in order, I've had no problem after setting all the necessary choice adventure settings to 1. I personally used the following snippet:
Code:
	for num from 423 upto 433
	{
		set_property( "choiceAdventure"+num , "1" );
	}
 
Top