The DB Stills

T

They

Guest
I was wondering if it's possible to make a script that does the following:

-buy 5 boxed wines (easy)
-buy 5 strawberries (easy)
-buy 5 magical ice cubes (easy)
-Use 5 boxed wines in Nash' Crosby Stills (is it possible?)
-Use 5 strawberries wines in Nash' Crosby Stills (is it possible?)
-create 5 Prussian Cathouses (possibly easy)

Could someone help me out here? Thanks...
 

Veracity

Developer
Staff member
[quote author=They link=topic=245.msg1221#msg1221 date=1151519564]
I was wondering if it's possible to make a script that does the following:

-buy 5 boxed wines (easy)
-buy 5 strawberries (easy)
-buy 5 magical ice cubes (easy)
-Use 5 boxed wines in Nash' Crosby Stills (is it possible?)
-Use 5 strawberries wines in Nash' Crosby Stills (is it possible?)
-create 5 Prussian Cathouses (possibly easy)[/quote]
Sigh.

# -buy 5 boxed wines (easy)
buy 5 boxed wine
# -buy 5 strawberries (easy)
buy 5 strawberry
# -buy 5 magical ice cubes (easy)
buy 5 magical ice cube
# -Use 5 boxed wines in Nash' Crosby Stills (is it possible?)
# -Use 5 strawberries wines in Nash' Crosby Stills (is it possible?)
# -create 5 Prussian Cathouses (possibly easy)
create 5 prussian cathouse

KoLmafia automatically creates intermediate ingredients for you.

If you insist on making them yourself, you can always do:

# -Use 5 boxed wines in Nash' Crosby Stills (is it possible?)
create 5 boxed champagne
# -Use 5 strawberries wines in Nash' Crosby Stills (is it possible?)
create 5 raspberry
# -create 5 Prussian Cathouses (possibly easy)
create 5 prussian cathouse

but you gain nothing by doing so.

Yet Another Script Request where the request itself was, essentially, the requested script...
 

QSquared

New member
I'm trying to modify another person's script I found here, it relates to the DB CSNY skill

I want to bubble-sort through the list of ingredients based off the number of each item, but my scipt isn';t running here is what I have (The majority of the script I pulled form a different post a few days ago)

# this tries to use the still, improving whatever you have that can be improved
# however, it will only improve a single item, basically.
# I coded this the way I did on the assumption that one would have multiples of ten
# of several base drinks/mixers, eg. 10 lemons, 30 olives, 10 wines, etc.


if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) {
print("youre not a moxie class, and hence cannot use the still");
return false;
}
if(stills_available() == 0) {
print("you have no uses left at the still");
return false;
}
item [item] spirits_n_mixers;
spirits_n_mixers[ $item[grapefruit] ] = $item[tangerine];
spirits_n_mixers[ $item[lemon] ] = $item[kiwi];
spirits_n_mixers[ $item[olive] ] = $item[cocktail onion];
spirits_n_mixers[ $item[orange] ] = $item[kumquat];
spirits_n_mixers[ $item[soda water] ] = $item[tonic water];
spirits_n_mixers[ $item[strawberry] ] = $item[raspberry];
spirits_n_mixers[ $item[bottle of gin] ] = $item[bottle of Calcutta Emerald];
spirits_n_mixers[ $item[bottle of rum] ] = $item[bottle of Lieutenant Freeman];
spirits_n_mixers[ $item[bottle of tequila] ] = $item[bottle of Jorge Sinsonte];
spirits_n_mixers[ $item[bottle of vodka] ] = $item[bottle of Definit];
spirits_n_mixers[ $item[bottle of whiskey] ] = $item[bottle of Domesticated Turkey];
spirits_n_mixers[ $item[boxed wine] ] = $item[boxed champagne];


for i from 0 upto 11 [ by 1 ]{
ihold=i+1;
for j from 11 downto ihold [ by 1 ]{
jhold=j+1;
iggypop=j-i;
if item_amount( j ) < item_amount( iggypop ){
tempy=spirits_n_mixers(j);
spirits_n_mixers(j)=spirits_n_mixers(iggypop);
spirits_n_mixers(iggypop)=tempy;
}

}
}



print("checking spirits, mixers, and crosby nash's still...");
foreach key in spirits_n_mixers {
if( item_amount( key ) > 0 && stills_available() > 0 && item_amount(key) >= stills_available() ) {
print( "hey, you have " + item_amount(key) + " " + key );
print( "you have " + stills_available() + " uses left at the still");
print( "making " + stills_available() + " " + spirits_n_mixers[key]);

return true;
}
}
print("you must have had no usable spirits or mixers, or not enough of what you did have");
return false;
 

macman104

Member
but my scipt isn';t running
This is kind of a cryptic description of your problem. Maybe you could help us out by being a little more clear about what the issue you're having is. Also, is the new functionality that you added the bubble sort part, is that what we should be looking at, that you're having issues with?

Actually, as I was writing this, your bubblesort uses the references to j and i, and those are both integers. They aren't valid for the item_amount() function.

I'll post *my* version of the bubble sort in a few minutes.

EDIT: Actually, part of the reason I think you're having an issue is because, the map is indexed by items, not integers, and so there is no way that I can think of to reference the map indices since they aren't integers without redoing the map or something else. I'll see if I can post something, otherwise, maybe Veraicty or someone will have a clever way to handle this without redoing it.
 

QSquared

New member
I put the actual problem more succinctly in my reply to the original script creator topic, (but yes, you are correct the problem is ithe script fails silently and I am only adding the bubble-sort code) we should probably talk there instead of here, my bad, that topic URL is thus: http://kolmafia.us/index.php/topic,779.0.html

~Q
 
Top