Advertisement
ereinion

BountyHunt.ash

Nov 3rd, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import <Expanders.ash>
  2. import <manaburn.ash>;
  3. import <CanAdv.ash>;
  4.  
  5. void reinstitute_goals(string[int] former_goals) {
  6.     foreach i, g in former_goals {
  7.         if (!g.contains_text("filthy lucre")) {
  8.             cli_execute("conditions add " + g);
  9.         }
  10.     }
  11. }
  12.  
  13. boolean non_effect_check(string cmd) {
  14.     if (cmd.contains_text("Meatsmith")) {
  15.         return (get_campground() contains $item[jar of psychoses (The Meatsmith)]);
  16.     } else if (cmd.contains_text("Suspicious")) {
  17.         return (get_campground() contains $item[jar of psychoses (The Suspicious-Looking Guy)]);
  18.     } else if (cmd.contains_text("Agua de Vida")) {
  19.         return true;
  20.     }
  21.     return false;
  22. }
  23.  
  24. boolean get_effect(string how_to_get_effect, effect effect_to_get) {
  25.     if (effect_to_get != $effect[none]) {
  26.         if (have_effect(effect_to_get) > 0 || effect_to_get == $effect[Transpondent]) {
  27.             return true;
  28.         }
  29.         cli_execute(how_to_get_effect);
  30.         // Special cases :P
  31.         if (effect_to_get == $effect[Consumed by Anger] && have_effect($effect[Consumed by Anger]) <= 0) {
  32.             if (adv1($location[Anger Man's Level], 0, ""));
  33.         }
  34.         return to_boolean(have_effect(effect_to_get) > 0);
  35.     } else {
  36.         if (non_effect_check(how_to_get_effect)) {
  37.             return true;
  38.         }
  39.         cli_execute(how_to_get_effect);
  40.         return to_boolean(non_effect_check(how_to_get_effect));
  41.     }
  42.     return false;
  43. }
  44.  
  45. boolean doSpecialBounty() {
  46.     int[string] bountyCost;
  47.     string bountyName;
  48.    
  49.     bountyCost["glittery skate key"] = get_price($item[tiny bottle of absinthe],0.5);
  50.     bountyCost["greasy string"] = get_price($item[jar of psychoses (The Meatsmith)],0.5);
  51.     bountyCost["grizzled stubble"] = get_price($item[transporter transponder],0.5);
  52.     bountyCost["hardened lava glob"] = get_price($item[one-day ticket to That 70s Volcano],0.5);
  53.     bountyCost["hickory daiquiri"] = get_price($item[devilish folio],0.5);
  54.     bountyCost["pile of country guano"] = get_price($item[astral mushroom],0.5);
  55.     bountyCost["pixellated ashes"] = get_price($item[jar of psychoses (The Crackpot Mystic)],0.5);
  56.     bountyCost["pop art banana peel"] = get_price($item[llama lama gong],0.5);
  57.     bountyCost["purple butt"] = get_price($item[empty Agua de Vida bottle],0.5);
  58.     bountyCost["unlucky claw"] = get_price($item[jar of psychoses (The Suspicious-Looking Guy)],0.5);
  59.     bountyCost["vivisected hair"] = get_price($item[one-day ticket to Conspiracy Island],0.5);
  60.     bountyCost["wig powder"] = get_price($item[&quot;DRINK ME&quot; potion],0.5);
  61.     // bountyCost[""] = get_price($item[],0.5);
  62.     bountyName = to_string(get_property("_untakenSpecialBountyItem"));
  63.     if (length(bountyName) != 0) {
  64.         visit_url("bounty.php");
  65.         bountyName = to_string(get_property("_untakenSpecialBountyItem"));
  66.     }
  67.    
  68.     if (bountyCost contains bountyName) {
  69.         if (bountyCost[bountyName] > to_int(get_property("autoBuyPriceLimit"))*2.5) {
  70.             print("It is too expensive to buy " + bountyName + ", in order to access the area where the special bounty is located. Skipping special bounty.", "red");
  71.             return false;
  72.         } else {
  73.             return true;
  74.         }
  75.     }
  76.     print("The current list of special bounties does not contain " + bountyName + ". Aborting...", "red");
  77.     return false;
  78. }
  79.  
  80. int adventure_for_bounty(location whereToAdv) {
  81.     string[int] former_goals;
  82.    
  83.     if (can_adv(whereToAdv, false)) {
  84.         former_goals = get_goals();
  85.         cli_execute("conditions clear");
  86.         if (have_effect($effect[On the Trail]) > 0) {
  87.             cli_execute("shrug on the trail");
  88.         }
  89.         add_item_condition(1, $item[filthy lucre]);
  90.         adventure(my_adventures(), whereToAdv);
  91.         reinstitute_goals(former_goals);
  92.         return 1;
  93.     } else {
  94.         if (user_confirm("Can't adventure in " + whereToAdv + ". Fix this and run the script again. Do you want to abort now, and attempt to get the other bounties later?",30000,false)) {
  95.             return -1;
  96.         } else {
  97.             return 0;
  98.         }
  99.     }
  100. }
  101.  
  102. int get_bounty() {
  103.     record specialBounty {
  104.         effect needed_effect;
  105.         string how_to_get_effect;
  106.         location where_to_go;
  107.         boolean burn_all_turns;
  108.     };
  109.     location[string] easyItem;
  110.     location[string] hardItem;
  111.     specialBounty[string] specialItem;
  112.     string current_property; boolean b;
  113.     string[int] former_goals;
  114.    
  115.     easyItem["bean-shaped rock"] = $location[The Beanbat Chamber];
  116.     easyItem["bloodstained briquette"] = $location[The Outskirts of Cobb's Knob];
  117.     easyItem["brightly-colored bottlecap"] = $location[The Overgrown Lot];
  118.     easyItem["broken petri dish"] = $location[Cobb's Knob Laboratory];
  119.     easyItem["broken plunger handle"] = $location[The Degrassi Knoll Restroom];
  120.     easyItem["bundle of receipts"] = $location[Cobb's Knob Treasury];
  121.     easyItem["callused fingerbone"] = $location[South of the Border];
  122.     easyItem["cherry stem"] = $location[The Skeleton Store];
  123.     easyItem["crumpled pink slip"] = $location[A Barroom Brawl];
  124.     easyItem["drop of filthy ichor"] = $location[The Sleazy Back Alley];
  125.     easyItem["empty greasepaint tube"] = $location[The "Fun" House];
  126.     easyItem["half-empty bottle of eyedrops"] = $location[The Degrassi Knoll Gym];
  127.     easyItem["handful of meatberries"] = $location[The Haunted Conservatory];
  128.     easyItem["important bat file"] = $location[Guano Junction];
  129.     easyItem["paper towel"] = $location[The Haunted Kitchen];
  130.     easyItem["pink bat eye"] = $location[The Bat Hole Entrance];
  131.     easyItem["triffid bark"] = $location[The Spooky Forest];
  132.     easyItem["shredded can label"] = $location[The Haunted Pantry];
  133.     easyItem["sugar button"] = $location[Madness Bakery];
  134.     easyItem["suspicious mole"] = $location[Cobb's Knob Menagerie, Level 3];
  135.     //easyItem[""] = $location[];
  136.    
  137.     hardItem["absence of moss"] = $location[The Oasis];
  138.     hardItem["beard crumbs"] = $location[The Castle in the Clouds in the Sky (Basement)];
  139.     hardItem["bit of wilted lettuce"] = $location[Inside the Palindome];
  140.     hardItem["black eye"] = $location[The Black Forest];
  141.     hardItem["burned-out arcanodiode"] = $location[The Penultimate Fantasy Airship];
  142.     hardItem["dirty coal button"] = $location[Lair of the Ninja Snowmen];
  143.     hardItem["discarded pacifier"] = $location[The Castle in the Clouds in the Sky (Top Floor)];
  144.     hardItem["distintegrating cork"] = $location[The Haunted Wine Cellar];
  145.     hardItem["dusty wing"] = $location[The Arid, Extra-Dry Desert];
  146.     hardItem["filthy rag"] = $location[The Copperhead Club];
  147.     hardItem["length of bent pipe"] = $location[The Smut Orc Logging Camp];
  148.     hardItem["non-Euclidean hoof"] = $location[The Haunted Gallery];
  149.     hardItem["rubber rib"] = $location[The Haunted Laboratory];
  150.     hardItem["rusty tap handle"] = $location[The Haunted Bathroom];
  151.     hardItem["spare abacus bead"] = $location[The Hidden Office Building];
  152.     hardItem["sticky stardust"] = $location[The Hole in the Sky];
  153.     hardItem["spent handwarmer"] = $location[The eXtreme Slope];
  154.     hardItem["warrrrrt"] = $location[The Poop Deck];
  155.     hardItem["worthless piece of yellow glass"] = $location[The Dungeons of Doom];
  156.     //hardItem[""] = $location[];
  157.    
  158.     specialItem["empty rum bottle"].needed_effect = $effect[none];
  159.     specialItem["empty rum bottle"].how_to_get_effect = "use one-day ticket to Dinseylandfill";
  160.     specialItem["empty rum bottle"].where_to_go = $location[Pirates of the Garbage Barges];
  161.     specialItem["empty rum bottle"].burn_all_turns = false;
  162.     specialItem["glittery skate key"].needed_effect = $effect[Absinthe-Minded];
  163.     specialItem["glittery skate key"].how_to_get_effect = "use tiny bottle of absinthe";
  164.     specialItem["glittery skate key"].where_to_go = $location[The Stately Pleasure Dome];
  165.     specialItem["glittery skate key"].burn_all_turns = false;
  166.     specialItem["greasy string"].needed_effect = $effect[none];
  167.     specialItem["greasy string"].how_to_get_effect = "buy jar of psychoses (The Meatsmith);use jar of psychoses (The Meatsmith);";
  168.     specialItem["greasy string"].where_to_go = $location[The Nightmare Meatrealm];
  169.     specialItem["greasy string"].burn_all_turns = true;
  170.     specialItem["grizzled stubble"].needed_effect = $effect[Transpondent];
  171.     specialItem["grizzled stubble"].how_to_get_effect = "use transporter transponder";
  172.     specialItem["grizzled stubble"].where_to_go = $location[Domed City of Grimacia];
  173.     specialItem["grizzled stubble"].burn_all_turns = true;
  174.     specialItem["hardened lava glob"].needed_effect = $effect[none];
  175.     specialItem["hardened lava glob"].how_to_get_effect = "use one-day ticket to That 70s Volcano";
  176.     specialItem["hardened lava glob"].where_to_go = $location[LavaCo&trade; Lamp Factory];
  177.     specialItem["hardened lava glob"].burn_all_turns = false;
  178.     specialItem["hickory daiquiri"].needed_effect = $effect[Dis Abled];
  179.     specialItem["hickory daiquiri"].how_to_get_effect = "use devilish folio";
  180.     specialItem["hickory daiquiri"].where_to_go = $location[The Clumsiness Grove];
  181.     specialItem["hickory daiquiri"].burn_all_turns = false;
  182.     specialItem["pile of country guano"].needed_effect = $effect[Half-Astral];
  183.     specialItem["pile of country guano"].how_to_get_effect = "use astral mushroom";
  184.     specialItem["pile of country guano"].where_to_go = $location[An Incredibly Strange Place (Bad Trip)];
  185.     specialItem["pile of country guano"].burn_all_turns = true;
  186.     specialItem["pixellated ashes"].needed_effect = $effect[Consumed by Anger];
  187.     specialItem["pixellated ashes"].how_to_get_effect = "buy jar of psychoses (The Crackpot Mystic);use jar of psychoses (The Crackpot Mystic)";
  188.     specialItem["pixellated ashes"].where_to_go = $location[Anger Man's Level];
  189.     specialItem["pixellated ashes"].burn_all_turns = false;
  190.     specialItem["pop art banana peel"].needed_effect = $effect[Shape of...Mole!];
  191.     specialItem["pop art banana peel"].how_to_get_effect = "gong mole";
  192.     specialItem["pop art banana peel"].where_to_go = $location[Mt. Molehill];
  193.     specialItem["pop art banana peel"].burn_all_turns = true;
  194.     specialItem["purple butt"].needed_effect = $effect[none];
  195.     specialItem["purple butt"].how_to_get_effect = "use empty Agua de Vida bottle";
  196.     specialItem["purple butt"].where_to_go = $location[The Jungles of Ancient Loathing];
  197.     specialItem["purple butt"].burn_all_turns = false;
  198.     specialItem["unlucky claw"].needed_effect = $effect[none];
  199.     specialItem["unlucky claw"].how_to_get_effect = "buy jar of psychoses (The Suspicious-Looking Guy);use jar of psychoses (The Suspicious-Looking Guy)";
  200.     specialItem["unlucky claw"].where_to_go = $location[Chinatown Shops];
  201.     specialItem["unlucky claw"].burn_all_turns = false;
  202.     specialItem["vivisected hair"].needed_effect = $effect[none];
  203.     specialItem["vivisected hair"].how_to_get_effect = "use one-day ticket to Conspiracy Island";
  204.     specialItem["vivisected hair"].where_to_go = $location[The Secret Government Laboratory];
  205.     specialItem["vivisected hair"].burn_all_turns = false;
  206.     specialItem["wig powder"].needed_effect = $effect[Down the Rabbit Hole];
  207.     specialItem["wig powder"].how_to_get_effect = "use " + to_string($item[&quot;DRINK ME&quot; potion]);
  208.     specialItem["wig powder"].where_to_go = $location[The Red Queen's Garden];
  209.     specialItem["wig powder"].burn_all_turns = false;
  210.     /*specialItem[""].needed_effect = $effect[];
  211.     specialItem[""].how_to_get_effect = "";
  212.     specialItem[""].where_to_go = $location[];
  213.     specialItem[""].burn_all_turns = false;*/
  214.    
  215.     cli_execute("bounty easy");
  216.     if (get_property("currentEasyBountyItem") != "") {
  217.         maximize("item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  218.         current_property = substring(get_property("currentEasyBountyItem"),0,last_index_of(get_property("currentEasyBountyItem"),":"));
  219.         if (easyItem contains current_property) {
  220.             return adventure_for_bounty(easyItem[current_property]);
  221.         } else {
  222.             print("Mismatch of easy properties", "red");
  223.             return -1;
  224.         }
  225.     }
  226.     cli_execute("bounty hard");
  227.     if (get_property("currentHardBountyItem") != "") {
  228.         current_property = substring(get_property("currentHardBountyItem"),0,last_index_of(get_property("currentHardBountyItem"),":"));
  229.         print(current_property);
  230.         if (current_property == "warrrrrt") {
  231.             maximize("item, -current, -tie, equip ittah bittah hookah, equip pirate fledges, switch Jumpsuited Hound Dog", false);
  232.         } else if (current_property == "dirty coal button") {
  233.             maximize("-combat, 0.8 item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  234.         } else {
  235.             maximize("item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  236.         }
  237.         if (hardItem contains current_property) {
  238.             return adventure_for_bounty(hardItem[current_property]);
  239.         } else {
  240.             print("Mismatch of hard properties", "red");
  241.             return -1;
  242.         }
  243.     }
  244.     if (doSpecialBounty()) {
  245.         cli_execute("bounty special");
  246.         if (get_property("currentSpecialBountyItem") != "") {
  247.             current_property = substring(get_property("currentSpecialBountyItem"),0,last_index_of(get_property("currentSpecialBountyItem"),":"));
  248.             if (specialItem contains current_property) {
  249.                 former_goals = get_goals();
  250.                 cli_execute("conditions clear");
  251.                 cli_execute("shrug on the trail");
  252.                 add_item_condition(1, $item[filthy lucre]);
  253.                 while (is_goal($item[filthy lucre]) && get_effect(specialItem[current_property].how_to_get_effect, specialItem[current_property].needed_effect)) {
  254.                     if (specialItem[current_property].where_to_go == $location[The Clumsiness Grove]) {
  255.                         if (adventure(1, specialItem[current_property].where_to_go)) {}
  256.                         visit_url("bounty.php");
  257.                     } else if (specialItem[current_property].where_to_go == $location[Domed City of Grimacia]) {
  258.                         expanders();
  259.                     } else if (specialItem[current_property].where_to_go == $location[The Nightmare Meatrealm]) {
  260.                         maximize("meat, -current, -tie, equip ittah bittah hookah, switch leprechaun", false);
  261.                         cli_execute("mood meat-realm");
  262.                         adventure(my_adventures(), specialItem[current_property].where_to_go);
  263.                         maximize("item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  264.                         cli_execute("mood bounty");
  265.                     } else if (specialItem[current_property].where_to_go == $location[Anger Man's Level]) {
  266.                         maximize("prismatic damage, moxie, 0.1 mp, 0.01 item, -melee, -tie, -current, equip hookah, switch Jumpsuited Hound Dog", false);
  267.                         adventure(have_effect(specialItem[current_property].needed_effect), specialItem[current_property].where_to_go);
  268.                         cli_execute("shrug " + to_string(specialItem[current_property].needed_effect));
  269.                         maximize("item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  270.                     } else if (specialItem[current_property].needed_effect == $effect[none]) {
  271.                         adventure(my_adventures(), specialItem[current_property].where_to_go);
  272.                     } else {
  273.                         print(to_string(specialItem[current_property].where_to_go));
  274.                         if (adventure(have_effect(specialItem[current_property].needed_effect), specialItem[current_property].where_to_go)) {}
  275.                     }
  276.                 }
  277.                 reinstitute_goals(former_goals);
  278.             } else {
  279.                 print("Mismatch of special properties", "red");
  280.                 reinstitute_goals(former_goals);
  281.                 return -1;
  282.             }
  283.             if (specialItem[current_property].burn_all_turns) {
  284.                 if (specialItem[current_property].needed_effect == $effect[none]) {
  285.                     if (specialItem[current_property].where_to_go == $location[The Nightmare Meatrealm]) {
  286.                         maximize("meat, -current, -tie, equip ittah bittah hookah, switch leprechaun", false);
  287.                         cli_execute("mood meat-realm");
  288.                         while (adventure(1, specialItem[current_property].where_to_go)) {}
  289.                         maximize("item, -current, -tie, equip ittah bittah hookah, switch Jumpsuited Hound Dog", false);
  290.                         cli_execute("mood bounty");
  291.                     } else {
  292.                         return -1;
  293.                     }
  294.                 } else if (have_effect(specialItem[current_property].needed_effect) > 0) {
  295.                     if (adventure(have_effect(specialItem[current_property].needed_effect), specialItem[current_property].where_to_go)) {}
  296.                 }
  297.             }
  298.             if (is_goal($item[filthy lucre])) {
  299.                 print("Failed to get special bounty", "red");
  300.                 cli_execute("conditions_clear");
  301.                 return -1;
  302.             } else {
  303.                 return 1;
  304.             }
  305.         }
  306.     } else {
  307.         print("Skipping special bounty because of cost.", "red");
  308.     }
  309.     return 0;
  310. }
  311.  
  312. boolean bounty_hunting() {
  313.     if(my_inebriety() <= inebriety_limit()) {
  314.         string s; int i;
  315.         s = visit_url("bounty.php");
  316.         while (my_adventures() > 0) {
  317.             i = get_bounty();
  318.             if (i == 0) {
  319.                 return true;
  320.             } else if (i == -1) {
  321.                 return false;
  322.             }
  323.         }
  324.     }
  325.     return false;
  326. }
  327.  
  328. void main() {
  329.     if (bounty_hunting()) {}
  330. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement