auto BHH and friends

dj_d

Member
Z, come on. You know full well you're going to rewrite any contribution I make to be 1/10th as big, pull its constants from a server, and remove all comments. ;)
 

dj_d

Member
Not so! Check out the zlib thread.

I think I have the right url checks already done in ascend.ash, so when I get a minute I'll see about porting it over. Honestly, I've gone to work on canadv a few times, and here's what happens:

1) I'll add something to canadv.
2) Well, before I start, I should port some code to use it.
3) I should start with levelup, since canadv would make it much more efficient.
<pause for a moment to load levelup.ash in the editor>
4) AUGH MY EYES MY EYES! What the hell did I write? How does this even possibly work?
5) Quickly shut down editor, mafia, loathing, and computer.
6) Repeat every few weeks.

Levelup.ash is really the bane of my existence. Some of the worst code I've written. Every time someone tells me that they will do ____ if I give them the ascend.ash password for free, I tell them to go fix levelup.ash!

</rant>
 

dj_d

Member
I'm good for it - and if multiple people do it, I'm happy to award multiple passwords. Note that this is a completely subjective determination on my part for "significantly enhancing or replacing whatever's there with something better".
 

dj_d

Member
I modified hunt_bounty so that it would use spooky putty sheets if they're available.

This is probably most useful with the companion change I made over on firstthingsfirst.ash, or a CCS that putties bountymonsters.

Note that with this change, sheets get used even if they're the wrong monster. Also, it will incorrectly report the bounty as failed.

This is because I'm lazy, and Zarqon's going to get so upset at my indentation style, he's going to rewrite it all anyway to automatically putty anything that's a set condition, and also make julienne fries. And the potatoes will be pulled from a server.

Code:
boolean hunt_bounty(int advs) {
   if (count(bopts) == 1) {
      if (!can_has_bounty(bopts[0],my_defstat())) {
         print("Can't finish current bounty.","olive");
         if (item_amount(bopts[0]) > 0)
            abort("Somehow, you already have "+item_amount(bopts[0])+" "+bopts[0].to_plural()+".  I (the script) am aborting in confusion.");
         cancel_bounty();
      }
   } else if (!accept_best_bounty(dosmallest)) return false;
   if (count(bopts) != 1) abort("Error selecting bounty.");
   print("Adventuring in "+bounty[bopts[0]].where.to_string()+" for "+bounty[bopts[0]].amount+" " + bopts[0].to_plural()+".");
   set_property("battleAction", "custom combat script");
   int advcount = 0;
   while((item_amount(bopts[0]) < bounty[bopts[0]].amount) && advcount < advs)
   {
     adventure(1, bounty[bopts[0]].where);
     advcount = advcount + 1;
     while ((item_amount($item[spooky putty monster]) > 0) && 
        (item_amount(bopts[0]) < bounty[bopts[0]].amount) && 
        (advcount < advs)) 
     {
       use(1,$item[spooky putty monster]);
       run_combat();
       restore_hp(0);
       advcount = advcount + 1;
     }
   }
  // Refresh page and collect lucre if any
   rebountify("bhh.php");
   print("You have "+available_amount($item[filthy lucre])+" filthy lucre.");
   return (count(bopts) == 0);
}
 

zarqon

Well-known member
I'm lazy too. Just add this in right after the while loop, guys!

Code:
int[item] potatos;
file_to_map("http://zachbardon.com/mafiatools/potatomap.txt",potatos);
print("Getting ingredients for julienne fries...");
foreach legume in potatos
   retrieve_item(potatos[legume],legume);
create(1,$item[julienne fries]);
 

EdFox

Member
I feel like a noob but you're likely to get others with this issue since FirstThingsFirst now directs users to grab this script. Running the version posted by Zarqon on 7/10.


Code:
> call scripts\bounty.ash

Unknown variable 'threshold' (bounty.ash, line 56)

edit: not very helpful... I'll try to add more.
Just grabbed the script and tried to run it. Have canadv as bounty called for it. I have a prefs file the new Zarqon scripts generated and threshold is in there, but this one isn't playing nicely.
 
Last edited:

StormCrow42

Member
Another possibly nice feature to add is to shrug "on the trail" after completing the bounty, as well as possibly doing so before starting if you're not sniffing the bounty monster already.
 

dj_d

Member
Another bug: it will accept the Dungeons of Doom bounty when the DoD hasn't been opened yet, then burn all your adventures in the greater-than sign.
 

dj_d

Member
Feature request: If it tries to do a bounty, and fails, then try to return the bounty and pick a new one.
 

heeheehee

Developer
Staff member
Presumably you're running Zarqon's version (posted on the previous page). The parameters decide which bounty to take -- if you specify an invalid parameter, it should print a little bit about usage. I think.
 

heeheehee

Developer
Staff member
small / smallest, best, easy / 1, medium / 2, hard / 3.
(Note that the "/" merely separates two functionally identical parameters)
 

tgetgel

Member
From the CLI I use
Code:
bounty.ash accept best
bounty.ash *
The first line accepts the best bounty. The 2nd line adventures until the bounty is completed. (caveat - there are some bounties that I avoid and some I want - so these days I usually go thru the relay browser, look at the bounties, select the one I want, then use bounty.ash * in the cli.)
 
Top