Scheduled daily turn burning and trouble with free runaways

kingdomsora

New member
So I'm going on a cruise for a week and I thought it would be a great time to finally write a script to take care of daily farming and activities.

I've set up Windows Task Scheduler to launch mafia once a day with auto login and a breakfast script that does everything for the day and then logs out so my computer can go back to sleep.

My current hiccup is that at the start of adventuring I want mafia to burn all of my free runaways on charging my cheese items.
Code:
cli_execute ("equip stinky cheese eye");
cli_execute ("equip staff of queso escusado");
cli_execute ("familiar Frumious Bandersnatch");
cli_execute ("use moveable feast");
cli_execute ("equip crumpled felt fedora");  
	adventure(13, $location[black forest]);
cli_execute ("shrug Ode");
cli_execute ("unequip plexiglass pocketwatch");
cli_execute ("equip navel ring");
	adventure(3, $location[black forest]);
with my CCS set to
Code:
[ default ]
skill summon mayfly swarm
attack with weapon
[ black adder ]
try to run away
[ black knight ]
try to run away
[ black panther ]
try to run away
[ black widow ]
try to run away
[ blackberry bush ]
try to run away

[ the black forest ]
try to run away <---- Did not work. Went to [default]

Besides the above issue (The work around was simple enough) mafia wants to runaway for free 13 times, then runaway 13 not for free, then 3 free, 3 not free. I totally understand (now) why it does this and know it's intended behavior for that function, but I still don't want it to do that for me. I could just change both cases to spend 1 adventure and take the 2 adventure loss, but is there a way to make it count the free runaways? Is there a different function?
 

Bale

Minion
The function you want to use is adv1(). That function will attempt to adventure once, without checking to see if the encounter actually used up an adventure. To have 13 encounters, ignoring how many adventures are actually used:

Code:
for i from 1 to 13 
   adv1($location[black forest], -1, "");

If you want to be sure that none of those adventures got used up by a non-combat:

Code:
int i = 0;
while(i < 13) {
   adv1($location[black forest], -1, "");
   if(get_property("lastEncounter").to_monster() != $monster[none])
      i += 1;
}
 
Last edited:

kingdomsora

New member
Thanks for the help. That did the trick! Running just fine now.

Only minor issue is that it's "countdown"ing for 20 seconds at the start of adventuring and then again for 1 second between all 200+ additional ones. Odd that it didn't do that before, but then there were other bugs that caused it to abort prematurely. I'm guessing this is a built in feature for mafia (or maybe zlib?), although I started with someone else's code so that could be the problem. The pause at the beginning isn't a bad idea, but is there a way to skip the between battle ones? They're kind of unnecessary.

Edit: On second thought, I think this might have just been because libramBurn was nagging me to update. Yeah. That was probably it.
 
Last edited:
Top