Get Underground! (Digital Underground Potion farming)

palpitations

New member
I've been using this for a while... I posted something similar a while back on the KoL forums, not using exactly this farming strategy, but close enough. At the time, I got a few negative comments for hiding the exact details. Of course, anyone who had a positive message likely got a message from me with enough details to help them figure this out... So I guess it sucks to be negative, huh?

My apologies to anyone who's been making meat off of this. I was too. ~300-500k a day on average, for quite a while. Hell, I sent it to someone else, and they made about 750,000 meat overnight with it (700k-750k, they got lucky and were able to sell Digital Underground Potions for 47.5k each I believe).

I've been watching the prices over the past few days. I told myself, when there were 3 days in a row where I could make more doing something else, I'd post it. And so here it is.

Disclaimer: I suck at this, and I had a lot to drink when I wrote it. I cobbled together something piss poor. Everyone who actually knows what they're doing - I know, I know... I have no doubt this could be drastically improved. Everyone else: it seems to work. And it made me somewhere between 1,200 and 4,800 meat per adventure. You just need to make sure you have llama lama gongs on hand, and it'll pick up digital underground potions. Simple enough. And, on a positive note, I'll need some Digital Underground Potions soon, so feel free to lower the price on them as much as you'd like ;)

Code:
void usegong()
{
	if (my_adventures() < 12)
	{
	print("Not enough adventures to get another potion.  Stopping.");
	exit;
	} else
	{
		if (item_amount($item[llama lama gong]) == 0)
		{
			print("No more gongs!  Aborting.");
			exit;
		} else
		{	
			set_property("choiceAdventure276","2");
			use(1, $item[llama lama gong]);
		}
	}
}	

void molehill()
{
	if (my_adventures() == 0)
	{
		print("Out of adventures.");
		exit;
	} else
	{	
		while((have_effect($effect[Shape of...Mole!]) > 0) && (my_adventures() > 0))
		{
			visit_url("adventure.php?snarfblat=177");
			use_skill($skill[tunnel downwards]);
			run_combat();
		}
	}
}

void checkuse()
{
	if (my_adventures() == 0)
	{
		print("Out of adventures.");
		exit;
	} else
	{
		if ((have_effect($effect[Shape of...Mole!]) == 0) && (my_adventures() > 0))
		usegong();
		else molehill();
	}
}

void main()
{
	if (my_adventures() == 0)
	{
	print("Out of adventures.");
	exit;
	} else
	{
		while (my_adventures() > 0)
		checkuse();
	}
}
 
Last edited:

Bale

Minion
Nice script. Actually, it looks pretty well written to me. It could only be made a tiny bit tighter by setting gong properties once in main() instead of waiting until usegong() where it will be set every time a gong is bung. However that doesn't make much difference and I could not drastically improve that script unless there is a trick to more efficiently farming digital potions that I'm unaware of. Of which I am unaware.

I hope some people decide to run this script, because otherwise price on digital potions is going to be sky high as soon as the slimeling familiar is implemented.
 
Last edited:

palpitations

New member
It could only be made a tiny bit tighter by setting gong properties once in main() instead of waiting until usegong() where it will be set every time a gong is bung.

I actually realized this - but to be blunt, I was about 7 beers into the night when I wrote this. I didn't try to make something perfect, I just wanted to come up with something that came close to what I had in mind. I slapped it together right before going on vacation, so that I'd have a script to run on my netbook.

The fact that it works at all is a miracle, all things considered =P... Still, it apparently works, and that's all I looked for.

I might look at things at some point... But as it is, it should just be wasting a few cycles, right? To be quite honest, when it comes to a Mafia script as simple as this one, I don't give a damn about a few cycles. If I was working on something like your Recovery Script, I may care, but come on now, this is only ~60 lines. I can't do too much harm!

edit: I wish the DNS server was up sooner. I'd be interested in watching the markets after this. I'm not looking at playing the market, but I have a scholarly interest.
 
Last edited:

Bale

Minion
That's why I said, "that doesn't make much difference." :D It really works quite well and couldn't be optimized too much further. Technically the check for my_adventures() in molehill() is not necessary since you've already checked to ensure you have 12 adventures left in usegong(), but I still think it is good to have the check there, just in case there is something weird that throws off the count.
 

Bear

New member
For one reason or another, I cant seem to get this working.

Its probably stupidity on my part.


this is the error message that is spat out:

Expected ), found 12 (Digital Potion.ash, line 3)

i'm meant to save it as a .ash file, right?
 

Bale

Minion
It should be an ash file. I'd also caution you not to use wordpad since that will make it unusable. You need to you notepad instead. What editor did you use to save it?
 

Bear

New member
Notepad, and I'm pretty sure that I copied it exactly.

Edit: works now.

thanks for your help nevertheless.
 
Last edited:

Warren Jones

New member
Thanks for the script, it works great.

It's easy enough to switch from Digital Underground Potions to Climate Coladas.

However I was trying to modify it so as to get the Bureaucratized effect. Which means not using a skill every-time. I'm assuming the easiest way to do this is to not use a skill the first or last combat. So I changed
Code:
{while((have_effect($effect[Shape of...Mole!]) > 0)
to
Code:
{while((have_effect($effect[Shape of...Mole!]) > 1)
The problem is I have no idea how to make it adventure again. I've tried a couple different things and they either return parsing errors or are just ignored. Causing it to stop with the final adventure left.

It seems to be it should be pretty straight forward to adjust this, and even tweak it to get mole molé on the way.

If someone could point me in the right direction I'd really appreciate it. As I'm currently manually finishing each Shape of...Mole!
 

mredge73

Member
this is the adventure section:
Code:
visit_url("adventure.php?snarfblat=177");
use_skill($skill[tunnel downwards]);
run_combat();

This script manually adventures by first visiting the adventure location, then it selects the skill to use, then finishes the battle.
visit_url() clicks the link on the page that you want to adventure in, not sure how you get "Bureaucratized" but this may have to change
use_skill() uses a specific skill on the first round of combat
run_combat() runs your CCS.
 

Warren Jones

New member
visit_url() clicks the link on the page that you want to adventure in,

Hmm. What I need is to have it not use the skill for 1 turn. Preferably at/towards the beginning.

Maybe this is harder than I thought. Is there a way to set up a counter. Since there's only 12 turns (9 combats, 3 non-combats) I wouldn't be averse to scripting each turn. I'm just not sure how...

edit

Eureka (now to figure out how to make it ask how many adventures or gongs to use).

Code:
void usegong()
{if (my_adventures() < 12)
{print("Not enough adventures to get another potion.  Stopping."); exit;}
else
{if (item_amount($item[llama lama gong]) == 0)
{print("No more gongs!  Aborting."); exit;}
else
{set_property("choiceAdventure276","2"); use(1, $item[llama lama gong]);}}}	

void molehill()
{if (my_adventures() == 0)
{print("Out of adventures."); exit;}
else
{if((have_effect($effect[Shape of...Mole!]) > 10) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); run_combat();}
else
{if((have_effect($effect[Shape of...Mole!]) > 0) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel upwards]); run_combat();}}}}

void checkuse()
{if (my_adventures() == 0)
{print("Out of adventures."); exit;}
else
{if ((have_effect($effect[Shape of...Mole!]) == 0) && (my_adventures() > 0))
usegong();
else
molehill();}}

void main()
{if (my_adventures() == 0)
{print("Out of adventures."); exit;}
else
{while (my_adventures() > 0)
checkuse();}}

This will get you Bureaucratized and mole molé.
 
Last edited:

psly4mne

Member
Is this any better than setting CCS to tunnel down, adding moleform to mood, and auto-adventuring in Mt. Molehill?
 

Rahmuss

Member
Ok, I'm trying to get it to do the unpopular effect. I obviously don't know enough about how it chooses the adventures. It runs and uses a gong and then tries to use two more gongs. What am I doing wrong?

Code:
void usegong()  {
  if (my_adventures() < 3)  {
    print("Not enough adventures.  Stopping."); exit;
  }
  else  {
    if (item_amount($item[llama lama gong]) == 0)  {
      print("No more gongs!  Aborting."); exit;
    }
    else  {
      set_property("choiceAdventure276","2");
      set_property("choiceAdventure278","1");
      set_property("choiceAdventure279","1");
      set_property("choiceAdventure282","1");
      use(1, $item[llama lama gong]);
    }
  }
}	

void molehill()  {
  if (my_adventures() == 0)  {
    print("Out of adventures."); exit;
  }
  else  {
    if((have_effect($effect[Shape of...Mole!]) > 10) && (my_adventures() > 0))  {
      visit_url("adventure.php?snarfblat=177"); run_combat();
    }
    else  {
      if((have_effect($effect[Shape of...Mole!]) > 0) && (my_adventures() > 0))  {
        visit_url("adventure.php?snarfblat=177"); run_combat();
      }
    }
  }
}

void checkuse()  {
  if (my_adventures() == 0)  {
    print("Out of adventures."); exit;
  }
  else  {
    if ((have_effect($effect[Shape of...Mole!]) == 0) && (my_adventures() > 0))  {
      usegong();
    }
    else  {
      molehill();
    }
  }
}

void main()  {
  if (my_adventures() == 0)  {
    print("Out of adventures."); exit;
  }
  else  {
//    while (my_adventures() > 0)
    checkuse();
  }
}
 

heeheehee

Developer
Staff member
Uhh... Unpopular isn't available from Moleform -- you'd have to get into roachform. And anyway, the easiest way to get Unpopular is via the CLI command. So just cli_execute("gong roach ml"); and you'll be set!
 

Rahmuss

Member
hee (*3), you're absolutely right. I copied choice "2" from the previous script, so I need to change that to 1; but what I'd like to do is have a call to a script from a .txt file and in that file it will run the script x number of times (depending on the day or need). So I wanted to get it working with an actual .ash script. Thanks for pointing that mistake out though. Very helpful, with that little change it worked! Thanks heeheehee. :)
 
Last edited:

slyz

Developer
Here's something to get Unpopular. Instructions inside.

EDIT: fixed a bug.
 

Attachments

  • GetUnpopular.ash
    2.5 KB · Views: 30
Last edited:

Khay

New member
Ok, I ATTEMPTED to modify this script to get the Morlock's Mark Bourbon, and using a green smoke bomb to do a free runaway later in the path after tunneling downwards, still manage to snag the digital underground potion. As I have never seen this particular programming language before - in fact, my personal experience is limited to BASIC and programming logic - I am certain I have messed up horribly :p But please take a look, and let me know what needs to be different to get this to work? What I HOPE to happen, is:

tunnel down the first 3 combats
first non-combat
tunnel down 2 more combats
stay at level -5 for the next combat
second non-combat (Bourbon)
tunnel down the next combat
tunnel down and runaway (smoke bomb) the 8th combat/10th adventure
tunnel down the next 2 combats
3rd non-combat (Digital Underground)

I cannot figure out how to check if the runaway succeeded, unfortunately, otherwise there should be an if/then to use another bomb; any help with that part?

I'd just make sure beforehand to have plenty of bombs, rather than check for them in the script; seems easier to me.

Please grade my paper? Lol... This is all copied and cannibalized from the other scripts in this thread - hopefully I have enough working parts here. I changed as little as possible.

void usegong()
{if (my_adventures() < 12)
{print("Not enough adventures to get another potion. Stopping."); exit; }
else
{if (item_amount($item[llama lama gong]) == 0)
{print("No more gongs! Aborting."); exit; }
else
{set_property("choiceAdventure276","2"); use(1, $item[llama lama gong]); }}}

void molehill()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{if((have_effect($effect[Shape of...Mole!]) == 6 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); run_combat();}
else
{if((have_effect($effect[Shape of...Mole!]) == 3 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); throw_item(green smoke bomb); visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}
else
{if((have_effect($effect[Shape of...Mole!]) > 0) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}}}}

void checkuse()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{if ((have_effect($effect[Shape of...Mole!]) == 0) && (my_adventures() > 0)) usegong();
else
molehill(); }}

void main()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{while (my_adventures() > 0) checkuse(); }}
 

heeheehee

Developer
Staff member
It looks like the first place it'll return an error is at "throw_item(green smoke bomb);". You'll need to use the datatype constant $item[green smoke bomb]; otherwise, Mafia will interpret it as a variable (and return an error).

The one minor nitpick I have is that it doesn't check if you have any green smoke bombs before proceeding. A simple call to retrieve_item() would work nicely. (See the wiki for syntax; I don't remember it off the top of my head. =D )
 

Khay

New member
So I want it like this?

else
{if((have_effect($effect[Shape of...Mole!]) == 3 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); $item[green smoke bomb]; visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}

Is that the right command?

Also, at the very beginning, if I changed it like this, would that work?

void usegong()
{if (my_adventures() < 12)
{print("Not enough adventures to get another potion. Stopping."); exit; }
else
{if (item_amount($item[llama lama gong]) == 0)
{print("No more gongs! Aborting."); exit; }
else
{if (item_amount($item[green smoke bomb]) > 3)
{print("Not enough Smoke Bombs! Aborting."); exit; }
else
{set_property("choiceAdventure276","2"); use(1, $item[llama lama gong]); }}}}


should check that at least 3 are left; if I fail escaping more than that, I would want to go into manual anyways, to monitor the fight :p
 

Camber

Member
So I want it like this?

else
{if((have_effect($effect[Shape of...Mole!]) == 3 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); $item[green smoke bomb]; visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}

Is that the right command?

Not quite, you still need the throw_item() command, like this:
PHP:
if((have_effect($effect[Shape of...Mole!]) == 3 ) && (my_adventures() > 0))
{
	visit_url("adventure.php?snarfblat=177") ;
	use_skill($skill[tunnel downwards]) ;
	throw_item($item[green smoke bomb]) ;
	visit_url("adventure.php?snarfblat=177") ;
	use_skill($skill[tunnel downwards]) ;
	run_combat() ;
}


Also, at the very beginning, if I changed it like this, would that work?

void usegong()
{if (my_adventures() < 12)
{print("Not enough adventures to get another potion. Stopping."); exit; }
else
{if (item_amount($item[llama lama gong]) == 0)
{print("No more gongs! Aborting."); exit; }
else
{if (item_amount($item[green smoke bomb]) > 3)
{print("Not enough Smoke Bombs! Aborting."); exit; }
else
{set_property("choiceAdventure276","2"); use(1, $item[llama lama gong]); }}}}


should check that at least 3 are left; if I fail escaping more than that, I would want to go into manual anyways, to monitor the fight :p

I think you want to change the > 3 to < 3, i.e. if you have less than 3, abort.

PHP:
	if (item_amount($item[green smoke bomb]) < 3)

Or, instead of aborting, use heeheehee's advise and use retrieve_item to aquire one.
PHP:
	if (item_amount($item[green smoke bomb]) < 3)
         retrieve_item(1, $item[green smoke bomb])
 

Khay

New member
Blah! Yeah, less-than. See, THAT'S why you always have someone proofread! Lol...

I still would like to make it check if I escaped, and if not, try again. But I honestly cannot find a thing on that, so I am at a complete loss there.

Ok, then lets see if I got this:

void usegong()
{if (my_adventures() < 12)
{print("Not enough adventures to get another potion. Stopping."); exit; }
else
{if (item_amount($item[llama lama gong]) == 0)
{print("No more gongs! Aborting."); exit; }
else
{if (item_amount($item[green smoke bomb]) < 3)
retrieve_item(1, $item[green smoke bomb]); }
else
{set_property("choiceAdventure276","2"); use(1, $item[llama lama gong]); }}}

void molehill()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{if((have_effect($effect[Shape of...Mole!]) == 6 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); run_combat();}
else
{if((have_effect($effect[Shape of...Mole!]) == 3 ) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); throw_item($item[green smoke bomb]) ; visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}
else
{if((have_effect($effect[Shape of...Mole!]) > 0) && (my_adventures() > 0))
{visit_url("adventure.php?snarfblat=177"); use_skill($skill[tunnel downwards]); run_combat();}}}}

void checkuse()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{if ((have_effect($effect[Shape of...Mole!]) == 0) && (my_adventures() > 0)) usegong();
else
molehill(); }}

void main()
{if (my_adventures() == 0)
{print("Out of adventures."); exit; }
else
{while (my_adventures() > 0) checkuse(); }}

Alright, I'll go field-test it, I guess is the next step. Thanks for all the help!
 
Last edited:
Top