FortyCakes
New member
This worked well for me, so thanks!
> call scripts\Azazel.ash
Starting the Quest
Gathering rockstar items
Calling Universal Recovery for type=HP, amount=0
Calling Universal Recovery for type=MP, amount=0
Visit to Pandamonium: Hey Deze Arena in progress...
[195] Hey Deze Arena
Encounter: Your Bassist Impulses
You acquire an item: sponge cake
Conditions not satisfied after 1 adventure.
That is most often caused by a lingering goal from another area. Try typing "condition clear" in the gCLI and retrying.
//Data type for the items that a musician wants, and for if he has gotten an item
record musician {
item item1;
item item2;
boolean isdone;
};
//Map for what Golly wants, using above data type
musician [string] gollyMap;
gollyMap["Bognort"].item1 = $item[giant marshmallow];
gollyMap["Bognort"].item2 = $item[gin-soaked blotter paper];
gollyMap["Bognort"].isdone = false;
gollyMap["Stinkface"].item1 = $item[beer-scented teddy bear];
gollyMap["Stinkface"].item2 = $item[gin-soaked blotter paper];
gollyMap["Stinkface"].isdone = false;
gollyMap["Flargwurm"].item1 = $item[booze-soaked cherry];
gollyMap["Flargwurm"].item2 = $item[sponge cake];
gollyMap["Flargwurm"].isdone = false;
gollyMap["Jim"].item1 = $item[comfy pillow];
gollyMap["Jim"].item2 = $item[sponge cake];
gollyMap["Jim"].isdone = false;
//This checks if I have enough stuff for Golly. Excess code is for clarity.
boolean gollyDone() {
int ma = item_amount($item[giant marshmallow]);
int gi = item_amount($item[gin-soaked blotter paper]);
int be = item_amount($item[beer-scented teddy bear]);
int bo = item_amount($item[booze-soaked cherry]);
int sp = item_amount($item[sponge cake]);
int co = item_amount($item[comfy pillow]);
if ((ma + gi + be) >= 2 && (bo + sp + co) >= 2) {
return true;
}
else return false;
}
//This gives an item to a musician in the Arena.
void giveToGolly(item i, string who){
int item_number = i.to_int();
print("Giving " + i + " to " + who, "blue");
visit_url("pandamonium.php?action=sven&bandmember=" + who + "&togive=" + item_number + "&preaction=try&bandcamp=Give+It");
}
//This maxes items, casts -combat/clears +combat buffs if you have them and finishes the Arena parts
void arena() {
maximize("item",false);
print("Trying to get stuff for musicians", "blue");
//Gather the non-com drops until you can finish it
while (!gollyDone()) {
combatModBuff("minus");
runAdv($location[Hey Deze Arena]);
}
//Give the items to the musicians
foreach key in gollyMap {
if (!gollyMap[key].isdone && haveItem(gollyMap[key].item1)) {
giveToGolly(gollyMap[key].item1, key);
gollyMap[key].isdone = true;
}
if (!gollyMap[key].isdone && haveItem(gollyMap[key].item2)) {
giveToGolly(gollyMap[key].item2, key);
gollyMap[key].isdone = true;
}
}
print("Arena done", "blue");
}
Fixed a few minor bugs in this (due to KoLMafia changes)
record musician {
item item1;
item item2;
boolean isdone;
};
musician [string] gollyMap;
gollyMap["Bognort"].item1 = $item[giant marshmallow];
gollyMap["Bognort"].item2 = $item[gin-soaked blotter paper];
gollyMap["Bognort"].isdone = false;
gollyMap["Stinkface"].item1 = $item[gin-soaked blotter paper];
gollyMap["Stinkface"].item2 = $item[beer-scented teddy bear];
gollyMap["Stinkface"].isdone = false;
gollyMap["Flargwurm"].item1 = $item[booze-soaked cherry];
gollyMap["Flargwurm"].item2 = $item[sponge cake];
gollyMap["Flargwurm"].isdone = false;
gollyMap["Jim"].item1 = $item[sponge cake];
gollyMap["Jim"].item2 = $item[comfy pillow];
gollyMap["Jim"].isdone = false;
int numItem(item it) {
return item_amount(it) + closet_amount(it);
}
boolean haveItem(item it) {
return numItem(it) > 0;
}
boolean gollyDone() {
int [item] trade;
foreach it in $items[giant marshmallow,gin-soaked blotter paper,beer-scented teddy bear,booze-soaked cherry,sponge cake,comfy pillow]
trade[it] = numItem(it);
boolean good = true;
foreach name,mate in gollyMap
if(!mate.isdone) {
if(trade[mate.item1] > 0) trade[mate.item1] -= 1;
else if(trade[mate.item2] > 0) trade[mate.item2] -= 1;
else good = false;
}
return good;
}
void giveToGolly(item i, string who){
print("Giving " + i + " to " + who, "blue");
if(item_amount(i) > 0 || take_closet(1, i)) {
visit_url("pandamonium.php?action=sven&bandmember=" + who + "&togive=" + to_int(i) + "&preaction=try");
gollyMap[who].isdone = true;
}
}
void arena() {
// Find out what bandmembers were previously completed
string sven = visit_url("pandamonium.php?action=sven");
// If this was the first visit to sven, he needs to be checked again
if(sven.contains_text("value=\"help\""))
sven = visit_url("pandamonium.php?action=sven");
foreach name in gollyMap
if(!contains_text(sven, "<option>"+name))
gollyMap[name].isdone = true;
print("Trying to get stuff for musicians", "blue");
cli_execute("maximize item -tie");
cli_execute("maximize -combat -tie");
while (!gollyDone()) {
adv($location[Hey Deze Arena]);
}
foreach name, mate in gollyMap {
if(!mate.isdone) {
if(haveItem(mate.item1))
giveToGolly(mate.item1, name);
else if(haveItem(mate.item2))
giveToGolly(mate.item2, name);
}
}
print("Arena done", "blue");
}
So I Added all the updates to the file in the first post.
Tested it myself and it worked, finished in 16 Adventures.
It's available in the first post... notice that it was updated yesterday?
English being ambiguous, I understood that to mean that Icon took the file in the first post, added Bale's change's from #30 and kept a local copy. It was not clear that anyone with admin/minon access took Bale's changes and pushed them back in. Indeed, I read Bale's comments to suggest that Bale's changes might not be appropriate for everyone.So I Added all the updates to the file in the first post.
Indeed, I read Bale's comments to suggest that Bale's changes might not be appropriate for everyone.
That first objection will not occur, since the non-coms giving an object will not occur if you have that item in inventory. Of course if you abort the script, then closet stuff, then run it , etc etc it could but I'd say that is a fringe case.You didn't get all the bugs. For instance, if the player gets 2 beer-scented teddy bears, but no giant marshmallows or gin-soaked blotter papers, the script thinks that it can satisfy Bognort. Obviously that is not true. There were a few other things I wasn't happy with either such as inability to recognize if the quest was already partly completed. That shouldn't happen unless the player started it manually, but it could happen. I also prefer to have comfy pillows left over for restoration if there are enough cherries and sponge cake to satisfy Flargwurm and Jim, so I switched the order of preferences. There's also stuff I rewrote just to make it cooler. Feel free to use this:
...
cli_execute("maximize item -tie");
cli_execute("maximize -combat -tie");
cli_execute("maximize item, -100 combat");
Talking to Sven Golly at the Hey Deze Arena
Trying to get stuff for musicians
Maximizing...
7022 combinations checked, best score 1,832.33
Arena done
Quest done!