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;