auto login to run buffbot

amosmj

New member
I'm sure this is an easy one but I couldn't sort it out.
My clan is running a buffbot that is internal to the clan. Currently our clan leader has to manually log it in each day. I was able to walk her through the steps of making a Scheduled Task in Windows to log it in. How can we automate the step to get it into the Buffbot mode?
 
The easy way:

click start-->control panel, then select scheduled tasks, then add a scheduled task. This will bring up a wizard.

Click next, then click browse, and browse to the folder containing kolmafia. select the exe or jar file desired.

select daily then click next

set your start time. This will be the time on the local computer that kolmafia needs to start. select weekdays (this step will need repeated for Saturday and Sunday to accommodate for long rollover with different settings) click next.

If a password is required to login to Windows, enter the user name, and password otherwise click next.

click next/finish to finalize the the plan.

Now kolmafia will auto start. now kolmafia needs set up to auto login, and run a script at login. Instructions for this are quite common here on the forums.

see also:
http://kolmafia.us/index.php/topic,339.0.html
 

amosmj

New member
I'm clearly missing something obvious. The scheduled job was already taken care of. I had found the CLI command. Really this is what I am trying to sort out:
and run a script at login
I DLed your script. It makes sense, looks basically like C. The question is,how do you make it kick that script off on auto-login?
 

fewyn

Administrator
Staff member
[quote author=amosmj link=topic=1712.msg8053#msg8053 date=1210292445]
I'm clearly missing something obvious. The scheduled job was already taken care of. I had found the CLI command. Really this is what I am trying to sort out:I DLed your script. It makes sense, looks basically like C. The question is,how do you make it kick that script off on auto-login?
[/quote]

Goto the breakfast tab in preferences.
 

amosmj

New member
Time for dumb question number 2:
How do you auto logout?
I've tried considering some other kind of auto job but that doesn't seem the ticket. Are you checking for time until rollover via your scripts then exit when there is 5 minutes left?
 
charpane.php contains 2 vars, var rollover = big number, var rightnow = big number. Subtract rightnow from rollover to get the number of seconds til rollover. divide by 60 for minutes and so-on.

Other ideas?
 

amosmj

New member
It occured to me a that causing my computer to reboot at the beginning of rollover would work, but there has to be a better method.
 
PHP:
int MinutesToRollover()
{
//get the html source
string source = visit_url("charpane.php");

//the start of the rollover var
int ROS = index_of( source, "var rollover = " ) + length( "var rollover = " );
//the end of the rollover var
int ROE = index_of( source, ";", ROS );
//the start of the rightnow var
int RNS = index_of( source, "var rightnow = " ) + length( "var rightnow = " );
//the end of the rightnow var
int RNE = index_of( source, ";", RNS );
//the start of the rightnow var

//extract the string containing the number part of the start of rollover
string rollover = substring(source, ROS, ROE);
//extract the string containing the number part of kol's version of rightnow
string rightnow = substring(source, RNS, RNE);

//couple of debug comments
//print(rollover);
//print(rightnow);

return ( to_int( rollover ) - to_int( rightnow ) ) / 60;
}

usage:

PHP:
if(MinutesToRollover() < 5)
{
cli_execute("exit");
}
 

mredge73

Member
Hey
Do any of you guys know how to get windows task manager to auto run mafia's .jar file?

I have been using task manager to run the KolMafia.exe but I want to learn how to make it autostart KolMafia.jar
 

Heffed

Member
Hey
Do any of you guys know how to get windows task manager to auto run mafia's .jar file?

I have been using task manager to run the KolMafia.exe but I want to learn how to make it autostart KolMafia.jar

I like to use System Scheduler instead of the Windows scheduler. It's small, free, and very useful. You can buy a pro version, but the free version works just fine for me. It even has a rudimentary macro system. Nice if you have software with nag screens because you can have it close them automatically.

Edit: And yes, you can open a .jar with it. :)
 
Top