Typical Tavern Basement Farming Script (unfinished)

Wolfie

New member
ok i threw this together the only thing untested is the actual atk line i also know the loop doesnt work correcly so if anyone has input on it ill be very grateful
also the attack.php line you need to adjust it to your actual weapon or type of atk
as always feel free to improve and this is untested to its full extent if u just wanna farm the booze drops then just hash out the attack line.
also remember that as of right now this script goes into an endless loop at least until i learn what i did wrong with it
Code:
void main()
{
 while ( my_adventures() > 0 )
 {
  cli_execute("rats.php?where=22");
  cli_execute("fight.php?action=attack&attack=Attack+with+your+chrome+staff");
  cli_execute("wait 1");
 }
}
 
[quote author=Wolfie link=topic=124.msg540#msg540 date=1146212582]
also remember that as of right now this script goes into an endless loop at least until i learn what i did wrong with it[/quote]

Based on my reading of this earlier thread on the same subject:
http://kolmafia.us/index.php/topic,95.0.html

It seems some have had success by doing essentially the same thing but removing the attack line and replacing it by setting auto-attack in the account preferences.

I'm guessing that for one reason or another KoLmafia doesn't recognize that what you are doing takes up a turn, so it doesn't decrement it's internal turn counter. Thus, it always thinks you still have turns left, so it keeps on trying to farm. You could probably work around it with something like this:

Code:
void main()
{
  int turnsleft;
  turnsleft = my_adventures();
  while ( turnsleft > 0 )
  {
    cli_execute("rats.php?where=22");
    cli_execute("fight.php?action=attack&attack=Attack+with+your+chrome+staff");
    cli_execute("wait 1");
    turnsleft = turnsleft - 1;
  }
}

You could also throw in a status refresh command after the while loop completes to tell KoLmafia to update it's info, and that should pretty much do it. (Don't put this inside the while loop, because that will cause WAY too many server hits.) But then again if you just want to farm until you are out of turns, you probably don't care that KoLmafia thinks you still have a few turns for the time between the script completing and logging out. :)

So essentially, I don't think you coded anything incorrectly, I think you are just pushing the boundaries of what KoLmafia understands.
 
Top