I'd like some comments on my drinking script. It works ok most of the time, although when my bartender breaks it freaks out. So I'd like to fix that.
I recently added the counter to check for lack of ingredients... and it quits fine, but I'm not sure why the "create" doesn't always work. Sometimes it will buy the ingredients and sometimes not. I wonder if that's a mall cost limit issue?
Anyways, here's my script, please comment!
I recently added the counter to check for lack of ingredients... and it quits fine, but I'm not sure why the "create" doesn't always work. Sometimes it will buy the ingredients and sometimes not. I wonder if that's a mall cost limit issue?
Anyways, here's my script, please comment!
Code:
int x = 0;
repeat {
foreach drink in $items[sangria del diablo, cherry bomb, dirty martini, vesper, bodyslam, grogtini] {
if (available_amount(drink) + creatable_amount(drink) > 0) {
if (inebriety_limit() - my_inebriety() <= 1){
print("drink limit reached, breaking", "red");
break;
}
else{
print("I have ingredients to drink 1 "+ drink, "green");
boolean success = create(1, drink);
if (success){
drink(1, drink);
}
else{
print("I failed to make "+ drink);
break;
}
}
}
else{
print("I don't have ingredients to drink "+ drink, "red");
x = x + 1;
}
}
} until ((inebriety_limit() - my_inebriety() <= 1) || (x == 6));
if (x == 6) {
print("you are out of everything", "red");
Last edited: