Azazel.ash - Organ of Steel, Automated

Status
Not open for further replies.

Ferdawoon

Member
Something I have had trouble with lately with this script, even after I remembered to get the latest version fro this thread today, is that it only do one adventure at a time.

Code:
> 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.

Restarting the script it keep doing just one adventure per time I run the script.
 

Winterbay

Active member
That is most often caused by a lingering goal from another area. Try typing "condition clear" in the gCLI and retrying.
 

Ferdawoon

Member
That is most often caused by a lingering goal from another area. Try typing "condition clear" in the gCLI and retrying.

Hmm, problem is that I have had this thing happen each time I use it, with weeks or months between. Of course, it could still be a coincidence that I each of those times have stopped Mafia at a bad time and had a lingering goal, but the times I use this is when BCAscend dont want to go there just yet, and I want to get the Steel item before I run out of adventures that day. Will check it again next run, and see if I can reproduce it or solve it by clearing the conditions.
 

Ferdawoon

Member
Tried it again, when this time trying to do the Friarsteel. Got the 1-adventure at a time again, tried "condition clear" and voila, working =)
 

Wole

New member
One suggestion:
As it is now, the script only checks for one set-up of the possible ways to satisfy the musicians. I did a modded version of this (which is very derivative of this so I won't bother posting it separately) but a few snippets of code to make it a tad more efficient. combatModBuff(string) and runAdv(location) are fairly generic buffing and adventuring functions so I won't bother posting those.

Code:
//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");
}
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Fixed a few minor bugs in this (due to KoLMafia changes)
 

Attachments

  • Azazel.ash
    4.9 KB · Views: 82

Bale

Minion
Fixed a few minor bugs in this (due to KoLMafia changes)

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:

Code:
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");
}
 
Last edited:

icon315

Member
So I Added all the updates to the file in the first post.
Tested it myself and it worked, finished in 16 Adventures.
 

fronobulax

Developer
Staff member
It's available in the first post... notice that it was updated yesterday?

So I Added all the updates to the file in the first post.
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.

Whoops - I had forgotten that Icon was the original author. Never mind.
 

Bale

Minion
Indeed, I read Bale's comments to suggest that Bale's changes might not be appropriate for everyone.

My changes are appropriate for everyone who realizes that comfy pillows are more valuable than sponge cake. Since that is always true, for everyone, my changes are an undeniable improvement even though some playstyles will not notice any difference.
 

Wole

New member
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:
...
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.
Thanks for the rewrite!
 

Crowther

Active member
A very helpful script!

I believe this:
Code:
   cli_execute("maximize item -tie");
   cli_execute("maximize -combat -tie");
would be better like this:
Code:
   cli_execute("maximize item, -100 combat");
I'll admit, in my case they produce the same results, but I'm pretty sure there has to be a time where the second would be better.
Even if I'm wrong, it's fewer server hits. :D

When I aborted it partway through, restarting the script didn't complete the quest properly. I couldn't figure out why. Sorry I didn't save much debugging info.
Code:
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!
The arena wasn't done.
 
Status
Not open for further replies.
Top