Booze Buyer

Pazleysox

Member
This is a pretty simple script that will buy all the Siphon Spirits that the Happy Medium can make. It will only buy the booze that you do not already have in your inventory. It does not check prices, it will just automatically buy them. It also does not check to see if you have previously consumed one.

I wrote this just so I didn't have to remember which one's I've bought, and haven't, or used, and haven't.

-Paz
 

Attachments

  • drinks.ash
    5.5 KB · Views: 153

Bale

Minion
Here's a little tip you might find interesting:

PHP:
void farming()
{
   int ibooze = 1;


   if ( ibooze > 0 )
   {
      for i from 5573 to 5638
      {
         Item_Buy( 1, to_item(i) );
      }
   }
}

Yeah, I just condensed that entire function to a few lines by using item numbers converted to items instead of spelling out each item separately.

Could you tell me the purpose of the variable ibooze?
 

Pazleysox

Member
Could you tell me the purpose of the variable ibooze?

Not sure. It's something I stole from another script, it was the only way I could get the script to buy the items.

Heh, I'm not much of a script writer. I just steal what I need, and finagle it to what I want.

Philthy Thief

-Paz
 

slyz

Developer
In the following
PHP:
int ibooze;
ibooze = 1;


if ( ibooze > 0 )
{
	Item_Buy( 1, $item[Zoodriver] );
}
if ( ibooze > 0 )
{
	Item_Buy( 1, $item[Sloe Comfortable Zoo] );
}

...
you tell the script:
"ibooze is equal to 1. If ibooze if higher than 0, do this and that and ..."

Since you don't change ibooze anywhere, you might as well remove the unnecessary check and write directly:
PHP:
Item_Buy( 1, $item[Zoodriver] );
Item_Buy( 1, $item[Sloe Comfortable Zoo] );
...
You can also do something like this:
PHP:
foreach itm in $items[
	Zoodriver,
	Sloe Comfortable Zoo,
	Sloe Comfortable Zoo on Fire,
	Grasshopper,
	...
	Drunken Astrophysicist ]
{
	Item_Buy( 1, itm );
}
It's not more efficient, but some find it cleaner/simpler.

The last step, to avoid writing all the item names, is taking advantage of the fact that the item numbers of the drinks are consecutive, and go from 5573 to 5638.

You then get Bale's code snippet (without the unnecessary ibooze check):
PHP:
for num from 5573 to 5638
{
	Item_Buy( 1, num.to_item() );
}
 
Last edited:

Pazleysox

Member
It's not more efficient, but some find it cleaner/simpler.

I'm not always efficient. :) I copy/pasted all the drink items, and then copy and pasted all the code around the booze names. So all in all, it didn't really take long to write the script. I knew there would be a better way to write it.

Is there a way to check if you've already drank one, and not buy those?

-Paz
 

ckb

Minion
Staff member
Also, if you don't want a script, you can do this in one line on the CLI with:

Code:
ash for num from 5573 to 5638 { buy(1,num.to_item()); }

edit: FYI - I just did than and it cost me about 1.4M


ckb
 

slyz

Developer
You mean that you invested 1.4M !

I think I should have a special shelf on my DC for that kind of "investment".
 

Veracity

Developer
Staff member
Heh.

I bought all the drinks and I have been drinking 2 of them per day in my SC AoB dash to L30. That was not an "investment".
I think I will do the bulk of my consumption for the trophy after I finally break the prism and can drink 8 of them per day...
 

jijineiro

Member
I'm farming these things myself and drinking 7 of them per day as a countermeasure to a bit of AoB burnout. Now I'm looking for a way to check the auras during autoadventuring.
 
Top