Going on vacation/First attempt to automate something myself

me259259

Member
Hello, I'm going on vacation for a couple of days, and I would like mafia to continue to do things in my absence. I know some of the basics involved in doing this. I know how to schedule a task so that mafia will launch automatically, and I'm setting everything to run as a breakfast login script. But I don't really know what I'm doing from there. Here is what I have set up so far (initial code before other people's suggestions):

Code:
breakfast
outfit MediumLevelMoxie
adventure 4 barrel full of barrels
bounty.ash accept best
bounty.ash *
use 3 agua de vida
// eatdrink to 13 fullness, 19 drunkeness, and 0 spleen, without overdrinking
// alias eatdrink => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(13, 19, 0, false);
eatdrink
acquire 5 worthless item
//note: breakfast will turn worthless items into clovers.  The above line is there to make sure you have worthless items for tomorrow.
levelup.ash
levelup.ash
cast odetobooze
// Eat remaining food and overdrink
// alias eatdrinksleep => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(15, 19, 0, true)
eatdrinksleep
outfit Sleep
exit

How does this look? I think this will mostly work, but just in case I'm messing up something basic, this is what I'm hoping mafia will do at login:

  1. Do it's usual breakfast routine
  2. Wear my moxie-favored gear (called MediumLevelMoxie)
  3. Get all of the top 2 row's booze at the barrel full of barrels (I have my choice-adventure preference set up to search the top 2 rows of the barrels)
  4. Do today's bounty hunt
  5. Automatically eat/drink/spleen. I'm in hardcore and only want to spleen with agua de vida's right now. Also, I want to leave 2 fullness available to eat fortune cookies (I have a counter checker script that will automatically eat cookies when I get my next semi-rare)
  6. Get clovers from the hermit
  7. Spend all remaining turns leveling up
  8. Overdrink
  9. Put on my rollover gear (called Sleep)
  10. Close out of mafia

Now, I did partially test this already, and I have a few questions:

Is there a better way to adventure at the barrel full of barrels? I tried adventuring with "adventure 5 barrel full of barrels", but it found booze on it's first attempt, and mafia stopped (and didn't do anything else) after 4 adventures saying: "All booze in the specified rows has been collected". If I change the number of adventures to 4, and it doesn't find booze immediately, will it stop looking for booze even if there are more to be found there? Is it possible to set a condition to stop after finding all the booze in a set of rows?

I forget, does Eatdrink cast "Ode to Booze" if it is only overdrinking? Or does it only cast Ode before it overdrinks?

I'm at a relatively low level (I'll be level 8 when I'll need this to run), if bounty.ash accepts the "best" bounty, does this consider my level? Will bounty.ash pick a bounty that I'll have no hopes of completing?

I have it set to run levelup.ash twice. This is in case I level up once, and still have 100 adventures remaining after that. If levelup.ash ends because I run out of turns, will that cause mafia to stop (and not do anything else)? Will mafia stop if levelup.ash runs out of turns, and I call levelup.ash to run a second time?

Man, this is a long post and a lot to absorb, thank you anyone willing to take the time to read it/figure out what I'm asking.

Final Code:

Code:
breakfast
outfit MediumLevelMoxie
// Search top 2 rows for booze, then middle two rows
set barrelGoal = 3
try; adv 30 barrels
use 3 agua de vida
// eatdrink to 13 fullness, 19 drunkeness, and 12 spleen, without overdrinking
// alias eatdrink => ashq import <EatDrink.ash>; eatdrink((fullness_limit()-2), inebriety_limit(), 0,false)
eatdrink
//eatdrink changes your mood!  And doesn't change it back unless it overdrinks!
mood mediumlevelmoxie
// Accept low level bounty
bounty.ash accept 1
bounty.ash *
acquire 5 worthless item
hermit * ten-leaf clover
levelup.ash
levelup.ash
//Eatdrink doesn't cast ode if you only overdrink
cast odetobooze
// Eat remaining food and overdrink
// alias eatdrinksleep => ashq import <EatDrink.ash>; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(),true)
eatdrinksleep
outfit Sleep
exit
 
Last edited:

Theraze

Active member
I believe that bounty works based on safe moxie, not based on unlocked zones... if you're just running level-up and not doing any quest scripts, it will eventually lock up on a bounty that you can't finish, though you could toss a "bounty abort" in near the end to have that only screw up one day's bounty-ing... the issue there, of course, is that if you don't finish up a bounty you're actually making progress on, you've just missed that bounty... If lucre is a major goal for you, may want to force bounty 1 instead of bounty best.

Ah yes, and while I remember, if you check choice adventures for barrels, you can set what you want it to get... I tend to spend 10-12 adventures there (officially) to get the top and bottom rows, but if you want all the alcohol, you can set it to spend 15 adventures (max possible if you get everything wrong, I think) and do all 3 rows for alcohol... But it's set through choice adventure, not through conditions.
 

Bale

Minion
Is there a better way to adventure at the barrel full of barrels? I tried adventuring with "adventure 5 barrel full of barrels", but it found booze on it's first attempt, and mafia stopped (and didn't do anything else) after 4 adventures saying: "All booze in the specified rows has been collected". If I change the number of adventures to 4, and it doesn't find booze immediately, will it stop looking for booze even if there are more to be found there? Is it possible to set a condition to stop after finding all the booze in a set of rows?

Like this:

Code:
set barrelGoal = 1
adventure 12 barrel full of barrels
set barrelGoal = 2
adventure 12 barrel full of barrels

I tested this on a multi for you:

Code:
[COLOR="#808000"]> set barrelGoal = 1[/COLOR]

barrelGoal => 1

[COLOR="#808000"]> adventure 12 barrel full of barrels[/COLOR]

Request 1 of 12 (Mountain: Barrel full of Barrels) in progress...

[36903] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: ten-leaf clover
Using 1 ten-leaf clover...
You acquire an item: disassembled clover
Finished using 1 ten-leaf clover.

Request 2 of 12 (Mountain: Barrel full of Barrels) in progress...

[36904] Barrel Full of Barrels
Encounter: Barrel Smash
You lose 273 hit points

Request 3 of 12 (Mountain: Barrel full of Barrels) in progress...

[36905] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: monkey wrench

Request 4 of 12 (Mountain: Barrel full of Barrels) in progress...

[36906] Barrel Full of Barrels
Encounter: Barrel Smash
You lose 385 hit points

Request 5 of 12 (Mountain: Barrel full of Barrels) in progress...
[COLOR="#ff0000"]All booze in the specified rows has been collected.[/COLOR]

[COLOR="#808000"]> set barrelGoal = 2[/COLOR]

barrelGoal => 2

[COLOR="#808000"]> adventure 12 barrel full of barrels[/COLOR]

Request 1 of 12 (Mountain: Barrel full of Barrels) in progress...

[36897] Barrel full of Barrels

[36897] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: concentrated magicalness pill

Request 2 of 12 (Mountain: Barrel full of Barrels) in progress...

[36898] Barrel Full of Barrels
Encounter: Mimic (Middle 2 Rows)
Strategy: C:\Documents and Settings\Quicksilver\My Documents\My Dropbox\KolMafia\ccs\d_fever-farming.ccs [default]
Round 0: xxxx wins initiative!
Round 1: Grog takes a pull on the hookah, and immediately goes into a coughing fit, blowing a cloud of smoke in your face. Since this is magic smoke, instead of giving you cancer (or, perhaps in addition to giving you cancer), it gives you an effect:
You acquire an effect: Eye of the Seal (duration: 6 Adventures)
Round 1: xxxx executes a macro!
Round 1: xxxx attacks!
Round 2: mimic (middle 2 rows) takes 2770 damage.
After Battle: Grog does a couple of karate moves, then swivels his hips and gyrates his pelvis.
You acquire an item: Cherry Cloaca Cola
You gain 2 Strongness
You gain 4 Chutzpah

Request 3 of 12 (Mountain: Barrel full of Barrels) in progress...

[36899] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: bottle of vodka

Request 4 of 12 (Mountain: Barrel full of Barrels) in progress...

[36900] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: bottle of vodka

Request 5 of 12 (Mountain: Barrel full of Barrels) in progress...

[36901] Barrel Full of Barrels
Encounter: Barrel Smash
You acquire an item: bottle of tequila

Request 6 of 12 (Mountain: Barrel full of Barrels) in progress...

[36902] Barrel Full of Barrels
Encounter: Barrel Smash
You lose 233 hit points

Request 7 of 12 (Mountain: Barrel full of Barrels) in progress...
[COLOR="#ff0000"]All booze in the specified rows has been collected.[/COLOR]

My barrels ended up like this:

 
Last edited:

me259259

Member
I believe that bounty works based on safe moxie, not based on unlocked zones... if you're just running level-up and not doing any quest scripts, it will eventually lock up on a bounty that you can't finish, though you could toss a "bounty abort" in near the end to have that only screw up one day's bounty-ing... the issue there, of course, is that if you don't finish up a bounty you're actually making progress on, you've just missed that bounty... If lucre is a major goal for you, may want to force bounty 1 instead of bounty best.

Ah, good to know, I'll change that.

Edit: just read Bale's post. Sweet! Thank you!
 
Last edited:

Theraze

Active member
So yeah, you can either set it manually to do a specific set of rows, or you can set which rows (1-2, 3-4, 5-6, 1-4, 3-6, 1-2+5-6, or 1-6) you'd like it to drink-loot and just give it as many adventures you'd like it to do...
 

tgetgel

Member
Code:
// eatdrink to 13 fullness, 19 drunkeness, and 0 spleen, without overdrinking
// alias eatdrink => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(13, 19, 0, false);
eatdrink
...
// Eat remaining food and overdrink
// alias eatdrinksleep => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(15, 19, 0, true)
eatdrinksleep
Also consider the days when you can eat more and topping off everything at the end. I do not know if this (xx_limit()) will work using an alias, but you could have eatdrink set up as
first time
eatdrink((fullness_limit()-2), inebriety_limit(), 0,false)
and the last time (eatdrinksleep) as
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(),true).
 

me259259

Member
Also consider the days when you can eat more and topping off everything at the end. I do not know if this (xx_limit()) will work using an alias, but you could have eatdrink set up as
first time
eatdrink((fullness_limit()-2), inebriety_limit(), 0,false)
and the last time (eatdrinksleep) as
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(),true).

I am pretty new to doing anything other than playing the game manually or running a script. Do I work this into the alias itself? Or would I just copy and paste that in place of "eatdrink" and "eatdrinksleep". If it's the latter, I think I tried that and it didn't work. Then again, I am amazingly inexperienced, and might not realize I need to change it slightly to get it to work for me personally.
 

Theraze

Active member
Two things to note... one, on the fullness limit - 2, note that the whole thing is in its own parenthesis set... second, note that each has () after, needed to actually run the function properly. :)

And yes, you'd still make these into aliases exactly like your current eatdrink and eatdrinksleep (mine are called eatdrink and eatdrinkod), with importing of eatdrink.ash and all of that... it's just that instead of doing 19 for the drunk box, you're doing inebriety_limit(), and if you ascend and lose liver of steel temporarily, you don't accidentally overdrink every day.
 

me259259

Member
After testing:

Code:
set barrelGoal = 1
adventure 12 barrel full of barrels

I still have a problem. It searches for booze, but after it finds all of the booze, it won't do anything else in my login script. It gives me the "All booze in the specified rows has been collected." message, goes red, and stops.

As for eatdrink and eatdrinksleep... aha! That makes sense. Changed the alias and it works very nicely! Thank you!
 

Bale

Minion
Theraze, that's an unholy union of CLI and ASH which can only confuse, not solve.

He'd need something more like:

Code:
ash if( adventure(12, $location[barrel full of barrels] ) ) {}

I'm not going to assign it to a boolean because I don't want to explain why it is only defined once, or he needs to change the name. One lesson at a time.
 

Theraze

Active member
Spiffy and true. Yeah... Sometimes I do end up creating unholy unions. :D Happens more when I'm tired.
 

Bale

Minion
So... in summary, me259259, you can solve the problem, but it will require putting a little ASH into your CLI script. You can do it like this:

Code:
set barrelGoal = 1
ash if( adventure(12, $location[barrel full of barrels] ) ) {}
set barrelGoal = 2
ash if( adventure(12, $location[barrel full of barrels] ) ) {}

By using the ASH equivalent of the adventure command, the stop state can be captured in an if() statement, preventing mafia from aborting. The "ash" at the beginning simply allows you to run ASH commands in a CLI script. The {} at the end, allows you to have an if condition that does nothing.
 
Last edited:

Theraze

Active member
So yes... if I'm reading this file (ChoiceOptionsPanel) properly, goal 1 is top row (mixed drinks), 2 is middle row (basic booze), 3 is top and middle row, 4 is the bottom row (schnapps and fine wine), 5 is top and bottom, 6 is middle and bottom, and 7 is all 3 rows. So if you want the top 2 rows, don't run 2 sets of adventures, just use barrelgoal 3. If you want as much booze as possible, use goal 7 and run 20 adventures (they won't all get used). I use 5 myself currently... top and bottom gets me enough to ascend for the next bit, but if you're running fully automated, max choices may be good.

Also, ashq may be a good choice instead of ash, just so it doesn't display the visible "true" or "false" following execution... Unless there's a reason not to?
 

Bale

Minion
He said that he only wants the booze from the top two rows. I thought that option 3 would get everything regardless of being booze. Do I misunderstand?
 
Last edited:

jasonharper

Developer
If the goal is simply to allow the script to continue execution even if the adventure request has been terminated early, there's no need for any sort of union of ASH and CLI, unholy or otherwise: the CLI has the try command for this exact purpose.
Code:
set barrelGoal = 3
try; adv 24 barrels
 

Theraze

Active member
And barrelgoal 3 would (try to) get just the booze from the top 2 rows. It'll try a square, if that quadrant isn't booze, it'll move on to the next quadrant. If it isn't booze again, it'll move to the next knowing that it'll be booze. Then it uses the information its gathered to best-guess which quadrant in other goal-rows is still booze. If it guesses wrong, it'll move on to the right one (since it's a 50/50 for the second row).

1 row, 2 possible fails, max adventures 6. 2 rows, 3 possible fails, max adventures 11. 3 rows, still 3 possible fails, max adventures 15.
 

slyz

Developer
1 row, 2 possible fails, max adventures 6. 2 rows, 3 possible fails, max adventures 11. 3 rows, still 3 possible fails, max adventures 15.
You're forgetting explosions, it can take many more advs to find the booze squares. And that's with the assumption that you can kill mimics.
 

me259259

Member
If the goal is simply to allow the script to continue execution even if the adventure request has been terminated early, there's no need for any sort of union of ASH and CLI, unholy or otherwise: the CLI has the try command for this exact purpose.
Code:
set barrelGoal = 3
try; adv 24 barrels

Try, works wonderfully. And with that, I can go on vacation worry-free. Er... almost. I've run into an issue with the "hermit * ten-leaf clover" command. When the hermit has clovers, it works without breaking the script. When you attempt to get clovers after you have already bought all you can from the hermit, it doesn't cause anything to break. However, if the hermit isn't selling clovers on that day... I got a message saying: "You can't get a ten-leaf clover from the hermit today.", mafia goes red, and stops. If I try:

Code:
try; hermit * ten-leaf clover

Mafia stays green, but won't go on to do anything else after this.

Unfortunately, I have to head out before anyone will be able to reply to this, so as a quick fix, I changed:

Code:
hermit * ten-leaf clover

to:

Code:
acquire * ten-leaf clover

Since I am in HC, it won't spend meat buying any from the mall, so it'll work for me for now. If the wildcard is there, will mafia still attempt to buy as many as possible from the mall? Or will it only get as many as you can get from the hermit if you have worthless items available?
 
Last edited:
Top