Advertisement
ereinion

Meatfarming

Oct 16th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###############################################################################################################################################################
  2. #                                                                                                                                                                                                                                                                                                                           #
  3. # [01.] Global variables:                                                                                                                                                                                                                                                                           #
  4. #                   - buffer VIP_LOUNGE                                                                                                                                                                                                                                                                 #
  5. # [02.] item choose_familiar_equipment(string currently_farming)                                                                                                                                                                                            #
  6. # [03.] boolean get_meat_buffs(boolean get_all) (bruker VIP_LOUNGE)                                                                                                                                                                                     #
  7. # [04.] boolean get_item_buffs(boolean get_all) (bruker VIP_LOUNGE)                                                                                                                                                                                     #
  8. # [05.] boolean get_buffs(string what_to_farm) kaller 03 og 04 basert på kva me er på jakt etter.                                                                                                                         #
  9. # [06.] void get_ode()                                                                                                                                                                                                                                                                              #
  10. # [07.] void consumption() - kaller eatdrink med riktige parametre                                                                                                                                                                                      #
  11. # [08.] boolean wear_pantsgiving() - Return false if we've gained all we can from pantsgiving                                                                                                                                   #
  12. # [09.] string create_maximizer_string(string what_to_farm)                                                                                                                                                                                                     #
  13. # [10.] location choose_location(string what_to_farm)                                                                                                                                                                                                                   #
  14. # [11.] familiar choose_familiar(string what_to_farm)                                                                                                                                                                                                                   #
  15. # [12.] void farm(string modifier_string, int adventures_to_save)  - må brytes opp!                                                                                                                                                        #
  16. # [13.] void choose_bjornify_familiar()
  17. # [14.] free_fights_outfit()
  18. # [15.] free_fights()
  19. # [16.] void simple_farming(string what_to_farm, int adventures_to_save, boolean overdrink_after_farming) - skal kalle alle underliggande funksjonar
  20. # [17.] void main(string what_to_farm) - kaller simple_farming                                                                                                                                                                                              #
  21. #                                                                                                                                                                                                                                                                                                                           #
  22. ###############################################################################################################################################################
  23. import <AT_song_support.ash>;
  24. import <canadv.ash>;
  25. import <EatDrink.ash>;
  26. import <Expanders.ash>;
  27. import <fishbot.ash>;
  28. import <OCD Inventory Control.ash>;
  29. import <UberPvPOptimizer.ash>;
  30. import <VampOut.ash>;
  31. import <clanhop.ash>;
  32. import <manaburn.ash>;
  33. import <manual_buffs.ash>;
  34. import <pvploot.ash>;
  35. import <zlib.ash>;
  36.  
  37. # [01.] CONSTANTS
  38. buffer VIP_LOUNGE = visit_url("clan_viplounge.php?whichfloor=1").append(visit_url("clan_viplounge.php?whichfloor=2"));
  39. string stance = "Who's the Boss?";
  40. # [02.]
  41. item choose_familiar_equipment(string currently_farming) {
  42.     item[12] priority_of_fam_eq;
  43.     string satisfy_with_mall;
  44.     item chosen_item;
  45.    
  46.     if (my_familiar()  == $familiar[Li'l Xenomorph]) {
  47.         return $item[tiny top hat and cane];
  48.     }
  49.     if (item_amount($item[snow suit]) > 0 &&  to_int(get_property("_snowSuitCount")) < 3) {
  50.         return $item[snow suit];
  51.     }
  52.    
  53.     priority_of_fam_eq[0] = $item[Mayflower bouquet];
  54.     if (to_lower_case(currently_farming).contains_text("meat")) {
  55.         priority_of_fam_eq[1] = $item[lucky Tam O'Shanter];
  56.         priority_of_fam_eq[2] = $item[lucky Tam O'Shatner];
  57.     } else if (to_lower_case(currently_farming).contains_text("item")) {
  58.         priority_of_fam_eq[1] = $item[miniature gravy-covered maypole];
  59.         priority_of_fam_eq[2] = $item[none];
  60.     }
  61.     priority_of_fam_eq[3] = $item[ittah bittah hookah];
  62.     priority_of_fam_eq[4] = $item[flaming familiar doppelg&auml;nger];
  63.     priority_of_fam_eq[5] = $item[astral pet sweater];
  64.     priority_of_fam_eq[6] = $item[Li'l Businessman Kit];
  65.     priority_of_fam_eq[7] = $item[little box of fireworks];
  66.     priority_of_fam_eq[8] = $item[moveable feast];
  67.     priority_of_fam_eq[9] = $item[plastic pumpkin bucket];
  68.     priority_of_fam_eq[10] = familiar_equipment(my_familiar());
  69.     priority_of_fam_eq[11] = $item[lead necklace];
  70.    
  71.     satisfy_with_mall = get_property("autoSatisfyWithMall");
  72.     set_property("autoSatisfyWithMall", "false");
  73.     for i from 0 to 11 {
  74.         if (have_equipped(priority_of_fam_eq[i])) {
  75.             chosen_item = priority_of_fam_eq[i];
  76.             break;
  77.         } else if (retrieve_item(1, priority_of_fam_eq[i])) {
  78.             chosen_item = priority_of_fam_eq[i];
  79.             break;
  80.         } else if (get_price(priority_of_fam_eq[i], 0.5) < to_int(get_property("autoBuyPriceLimit"))) {
  81.             if (buy (1, priority_of_fam_eq[i], get_price(priority_of_fam_eq[i], 0.5)*1.2) > 0) {
  82.                 chosen_item = priority_of_fam_eq[i];
  83.                 break;
  84.             }
  85.         }
  86.     }
  87.     set_property("autoSatisfyWithMall", satisfy_with_mall);
  88.    
  89.     return chosen_item;
  90. }
  91. # [03.]
  92. boolean get_meat_buffs(boolean get_all) {
  93.     string current_clan;
  94.     effect[5] meat_buffs;
  95.     meat_buffs[0] = $effect[Billiards Belligerence];
  96.     meat_buffs[1] = $effect[Dances with Tweedles];
  97.     meat_buffs[2] = $effect[Brother Flying Burrito's Blessing];
  98.     meat_buffs[3] = $effect[Winklered];
  99.     meat_buffs[4] = $effect[Optimist Primal];
  100.    
  101.     foreach i in meat_buffs {
  102.         if (my_effects() contains meat_buffs[i] && !get_all) {
  103.             return true;
  104.         }
  105.     }
  106.     // Pool table
  107.     if (item_amount($item[Clan VIP Lounge key]) > 0 && to_int(get_property("_poolGames")) < 3) {
  108.         if (!VIP_LOUNGE.contains_text("pooltable.gif")) {
  109.             current_clan = get_clan_name();
  110.             clanhop("Bonus Adventures from Hell");
  111.         }
  112.         for i from 1 to (3 - to_int(get_property("_poolGames"))) {
  113.             cli_execute("pool 1");
  114.         }
  115.         if (current_clan.length() > 0) {
  116.             clanhop(current_clan);
  117.         }
  118.         return true;
  119.     }
  120.     // Hatter
  121.     if (!to_boolean(get_property("_madTeaParty"))) {
  122.         if (item_amount($item[&quot;DRINK ME&quot; potion]) < 1) {
  123.             buy(1, $item[&quot;DRINK ME&quot; potion], 500);
  124.         }
  125.         cli_execute("hatter 22");
  126.         return true;
  127.     }
  128.     // Friars
  129.     if (!to_boolean(get_property("friarsBlessingReceived")) && friars_available()) {
  130.         cli_execute("friars food");
  131.         return true;
  132.     }
  133.     // Island Arena
  134.     if (get_property("sidequestArenaCompleted") == "fratboy" && !to_boolean(get_property("concertVisited"))) {
  135.         cli_execute("concert winklered");
  136.         return true;
  137.     }
  138.     if (get_property("sidequestArenaCompleted") == "fratboy" && !to_boolean(get_property("concertVisited"))) {
  139.         cli_execute("concert optimist primal");
  140.         return true;
  141.     }
  142.     return false;
  143. }
  144. # [04.]
  145. boolean get_item_buffs(boolean get_all) {
  146.     string current_clan;
  147.     effect[5] item_buffs;
  148.     item_buffs[0] = $effect[Hustlin'];
  149.     item_buffs[1] = $effect[Clyde's Blessing];
  150.     item_buffs[2] = $effect[Quadrilled];
  151.     item_buffs[3] = $effect[Brother Smothers's Blessing];
  152.     item_buffs[4] = $effect[Dilated Pupils];
  153.    
  154.     foreach i in item_buffs {
  155.         if (my_effects() contains item_buffs[i] && !get_all) {
  156.             return true;
  157.         }
  158.     }
  159.     // Pool table
  160.     if (item_amount($item[Clan VIP Lounge key]) > 0 && to_int(get_property("_poolGames")) < 3) {
  161.         if (!VIP_LOUNGE.contains_text("pooltable.gif")) {
  162.             current_clan = get_clan_name();
  163.             clanhop("Bonus Adventures from Hell");
  164.         }
  165.         for i from 1 to (3 - to_int(get_property("_poolGames"))) {
  166.             cli_execute("pool 3");
  167.         }
  168.         print(current_clan.length(), "red");
  169.         print(to_boolean(current_clan.length() > 0), "red");
  170.         if (current_clan.length() > 0) {
  171.             clanhop(current_clan);
  172.         }
  173.         return true;
  174.     }
  175.     // Legendary Beat
  176.     if (item_amount($item[The Legendary Beat]) > 0 && !to_boolean(get_property("_legendaryBeat"))) {
  177.         use(1, $item[The Legendary Beat]);
  178.     }
  179.     // Hatter
  180.     if (!to_boolean(get_property("_madTeaParty"))) {
  181.         if (item_amount($item[&quot;DRINK ME&quot; potion]) < 1) {
  182.             buy(1, $item[&quot;DRINK ME&quot; potion], 500);
  183.         }
  184.         cli_execute("hatter 28");
  185.         return true;
  186.     }
  187.     // Friars
  188.     if (!to_boolean(get_property("friarsBlessingReceived")) && friars_available()) {
  189.         cli_execute("friars booze");
  190.         return true;
  191.     }
  192.     // Island Arena
  193.     if (get_property("sidequestArenaCompleted") == "hippy" && !to_boolean(get_property("concertVisited"))) {
  194.         cli_execute("concert dilated pupils");
  195.         return true;
  196.     }
  197.     return false;
  198. }
  199. # [05.]
  200. boolean get_buffs(string what_to_farm) {
  201.     boolean return_value;
  202.     if (to_lower_case(what_to_farm).contains_text("meat")) {
  203.         return_value = get_meat_buffs(false);
  204.         if (!return_value) {
  205.             return_value = get_item_buffs(false);
  206.         }
  207.     } else if (to_lower_case(what_to_farm).contains_text("item")) {
  208.         return_value = get_item_buffs(false);
  209.         if (!return_value) {
  210.             return_value = get_meat_buffs(false);
  211.         }
  212.     }
  213.     return return_value;
  214. }
  215. # [06.]
  216. void get_ode() {
  217.     // Get ode from some other source
  218.     int[string] otherBuffbotsPrices;
  219.     otherBuffbotsPrices["kolabuff"] = 2;
  220.     otherBuffbotsPrices["testudinata"] = 11;
  221.     otherBuffbotsPrices["noblesse oblige"] = 16;
  222.     otherBuffbotsPrices["iocainebot"] = 23;
  223.     otherBuffbotsPrices["notbot"] = 40;
  224.     otherBuffbotsPrices["tinkerballa"] = 67;
  225.    
  226.     if (!have_equipped($item[Brimstone Beret]) && available_amount($item[Brimstone Beret]) > 0 && can_equip($item[Brimstone Beret])) {
  227.         equip($slot[hat], $item[Brimstone Beret]);
  228.     } else if (!have_equipped($item[plexiglass pendant]) && available_amount($item[plexiglass pendant]) > 0 && can_equip($item[plexiglass pendant])) {
  229.         equip($slot[acc3], $item[plexiglass pendant]);
  230.     } else {
  231.         maximize("+four songs", false);
  232.     }
  233.    
  234.     cli_execute("refresh effects");
  235.     if (!(have_effect($effect[Ode to Booze]) > 15)) {
  236.         while (available_song_slots() <= 0) {
  237.             open_song_spot();
  238.         }
  239.         if (is_online("buffy")) {
  240.             chat_private("buffy", "ode");
  241.             wait(30);
  242.         }
  243.         foreach buffbot in otherBuffbotsPrices {
  244.             cli_execute("refresh effects");
  245.             if (have_effect($effect[Ode to Booze]) > 0) {
  246.                 return;
  247.             } else if (available_song_slots() <= 0) {
  248.                 open_song_spot();
  249.             }
  250.             if (is_online(buffbot) && !(have_effect($effect[Ode to Booze]) > 0)) {
  251.                 kmail(buffbot, "", otherBuffbotsPrices[buffbot]);
  252.                 wait(20);
  253.             }
  254.         }
  255.     }
  256. }
  257. # [07.]
  258. void consumption() {
  259.     SIM_CONSUME = false;
  260.    
  261.     if (my_inebriety() < inebriety_limit() || my_fullness() < fullness_limit() || my_spleen_use() < spleen_limit()) {
  262.         if (!(have_effect($effect[Ode to Booze]) > 0) && my_inebriety() < inebriety_limit()) {
  263.             get_ode();
  264.         }
  265.         eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
  266.     }
  267.     // Increase fullness/drunkenness limits.
  268.     if (!to_boolean(get_property("_syntheticDogHairPillUsed")) && item_amount($item[synthetic dog hair pill]) >= 1) {
  269.         use(1, $item[synthetic dog hair pill]);
  270.     }
  271.     if (!to_boolean(get_property("_distentionPillUsed")) && item_amount($item[distention pill]) >= 1) {
  272.         // If pantsgiving is available, delay using distention pill.
  273.         if ((item_amount($item[pantsgiving]) == 0 && !have_equipped($item[pantsgiving])) || to_int(get_property("_pantsgivingFullness")) >= 2) {
  274.             use(1, $item[distention pill]);
  275.         }
  276.     }
  277.     if (my_inebriety() < inebriety_limit() || my_fullness() < fullness_limit()) {
  278.         if (!(have_effect($effect[Ode to Booze]) > 0) && my_inebriety() < inebriety_limit()) {
  279.             get_ode();
  280.         }
  281.         eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
  282.     }
  283. }
  284. # [08.] Return false if we've gained all we can from pantsgiving
  285. boolean wear_pantsgiving () {
  286.     int pant_turns = to_int(get_property("_pantsgivingCount"));
  287.     int pant_fullness = to_int(get_property("_pantsgivingFullness"));
  288.     float expected_advs_per_fullness = 6; float expected_advs_per_drunkenness = 6; float expected_advs_per_spleen = 1.5;
  289.     int remaining_adventures;
  290.    
  291.     if (can_equip ($item[pantsgiving])) {
  292.         remaining_adventures =  my_adventures() + (fullness_limit() - my_fullness())*expected_advs_per_fullness + (inebriety_limit() - my_inebriety())*expected_advs_per_drunkenness + (spleen_limit() - my_spleen_use())*expected_advs_per_spleen;
  293.        
  294.         switch {
  295.             case (pant_turns >= 498 && remaining_adventures + pant_turns < 4997):
  296.             case (pant_turns >= 49 && remaining_adventures + pant_turns < 498):
  297.             case (pant_turns >= 5 && remaining_adventures + pant_turns < 49):
  298.                 consumption();
  299.             default:
  300.         }
  301.         if (pant_turns >= 48) {
  302.         #   user_confirm (pant_fullness + " - " + to_string(remaining_adventures + pant_turns) + " - " + to_boolean(pant_fullness >= 1 && remaining_adventures + pant_turns < 49));
  303.         }
  304.         switch {
  305.             case (pant_fullness >= 4):
  306.             case (pant_fullness >= 3 && remaining_adventures + pant_turns < 4997):
  307.             case (pant_fullness >= 2 && remaining_adventures + pant_turns < 498):
  308.             case (pant_fullness >= 1 && remaining_adventures + pant_turns < 49):
  309.             case (remaining_adventures + pant_turns < 5):
  310.                 return false;
  311.             default:
  312.                 return true;
  313.         }
  314.     }
  315.     return false;
  316. }
  317. # [09.]
  318. string create_maximizer_string(string what_to_farm) {
  319.     buffer maximizer_string;
  320.    
  321.     if (what_to_farm == "Meat Drop") {
  322.         maximizer_string.append(what_to_farm + ", 0.1 Item Drop, 0.01 mp regen, -tie, -current, -familiar");
  323.     } else if (what_to_farm == "Item Drop") {
  324.         maximizer_string.append(what_to_farm + ", 0.1 Meat Drop, 0.01 mp regen, -tie, -current, -familiar");
  325.     }
  326.     if (!have_equipped($item[Mr. Cheeng's spectacles]) && can_equip($item[Mr. Cheeng's spectacles]) && available_amount($item[Mr. Cheeng's spectacles]) > 0) {
  327.         if (equip ($slot[acc1], $item[Mr. Cheeng's spectacles])) {
  328.             maximizer_string.append(", -acc1");
  329.         }
  330.     }
  331.     // Equip pantsgiving, in case it's not already worn
  332.     if (wear_pantsgiving()) {
  333.         if (have_equipped ($item[Pantsgiving]) || equip ($slot[pants], $item[Pantsgiving])) {
  334.             maximizer_string.append(", -pants");
  335.         }
  336.     }
  337.     // Equip hamster, in case the maximizer tries to use the garbage detector (!)
  338.     if (item_amount($item[Hodgman\'s imaginary hamster]) > 0 && my_path() != "Avatar of Boris" && my_path() != "Way of the Surprising Fist" && can_equip($item[Hodgman\'s imaginary hamster])) {
  339.         if (weapon_hands(equipped_item($slot[weapon])) > 1) {
  340.             equip($slot[weapon], $item[none]);
  341.         }
  342.         equip($slot[off-hand], $item[Hodgman\'s imaginary hamster]);
  343.     }
  344.     return to_string(maximizer_string);
  345. }
  346. # [10.]
  347. location choose_location(string what_to_farm) {
  348.     int[string] currentPVPMinis = current_pvp_stances();
  349.    
  350.     #return $location[An Eldritch Fissure];
  351.     // If PVP
  352.     if (hippy_stone_broken()) {
  353.         if (currentPVPMinis contains "Visiting the Cousins" && knoll_available()) {
  354.         #   return $location[The Bugbear Pen];
  355.         }
  356.         if (currentPVPMinis contains "Basket Reaver") {
  357.             return $location[The Black Forest];
  358.         }
  359.     }
  360.     // Else
  361.     if (to_lower_case(what_to_farm).contains_text("meat")) {
  362.         if (to_boolean(get_property("stenchAirportAlways")) || to_boolean(get_property("_stenchAirportToday"))) {
  363.             return $location[Barf Mountain];
  364.         } else if (to_boolean(get_property("sleazeAirportAlways")) || to_boolean(get_property("_sleazeAirportToday"))) {
  365.             return $location[Sloppy Seconds Diner];
  366.         } else {
  367.             if (!get_property("banishedMonsters").contains_text("drunk pygmy")) {
  368.                 buy (11 - item_amount($item[bowl of scorpions]), $item[bowl of scorpions], to_int(get_property("valueOfAdventure")));
  369.             }
  370.             return $location[The Hidden Bowling Alley];
  371.         }
  372.     } else if (to_lower_case(what_to_farm).contains_text("item")) {
  373.         if (can_adv($location[Spectral Pickle Factory])) {
  374.             return $location[Spectral Pickle Factory];
  375.         } else if (my_name() == "ereinion" && canadia_available()) {
  376.             #return $location[The Ruins of the Fully Automated Crimbo Factory];
  377.             return $location[Camp Logging Camp];
  378.         } else if (to_boolean(get_property("spookyAirportAlways")) || to_boolean(get_property("_spookyAirportToday"))) {
  379.             if (my_name() == "ereinion") {
  380.                 return $location[The Haunted Billiards Room];
  381.             }
  382.             return $location[The Deep Dark Jungle];
  383.         } else if (to_boolean(get_property("stenchAirportAlways")) || to_boolean(get_property("_stenchAirportToday"))) {
  384.             return $location[The Toxic Teacups];
  385.         } else {
  386.             #return $location[The Ruins of the Fully Automated Crimbo Factory];
  387.             return $location[The Haunted Library];
  388.             #whereToAdv = $location[The Haunted Wine Cellar];
  389.         }
  390.     }
  391.     return $location[none];
  392. }
  393. # [11.]
  394. familiar choose_familiar(string what_to_farm) {
  395.     int goal;
  396.     familiar fam;
  397.     familiar chosen_familiar;
  398.     familiar[13] familiars_which_drop_items;
  399.    
  400.     familiars_which_drop_items[0] = $familiar[Adventurous Spelunker];                           // Item, meat
  401.     familiars_which_drop_items[1] = $familiar[Angry Jung Man];                                      // Item, meat
  402.     familiars_which_drop_items[2] = $familiar[Blavious Kloop];                                      // Item, meat
  403.     familiars_which_drop_items[3] = $familiar[Bloovian Groose];                                     // Meat
  404.     familiars_which_drop_items[4] = $familiar[Fist Turkey];                                             // Item
  405.     familiars_which_drop_items[5] = $familiar[Golden Monkey];                                           // Meat
  406.     familiars_which_drop_items[6] = $familiar[Green Pixie];                                             // Item
  407.     familiars_which_drop_items[7] = $familiar[Grim Brother];                                            // Meat
  408.     familiars_which_drop_items[8] = $familiar[Grimstone Golem];                                     // Item, meat
  409.     familiars_which_drop_items[9] = $familiar[Li'l Xenomorph];                                      // Item, meat
  410.     familiars_which_drop_items[10] = $familiar[Pair of Stomping Boots];                     // Item
  411.     familiars_which_drop_items[11] = $familiar[Unconscious Collective];                     // Meat
  412.     familiars_which_drop_items[12] = $familiar[Machine Elf];                                            //
  413.        
  414.     // Choose default
  415.     if (to_lower_case(what_to_farm).contains_text("meat")) {
  416.         if (have_familiar($familiar[xo skeleton])) {
  417.             chosen_familiar = $familiar[xo skeleton];
  418.         } else if (have_familiar($familiar[hobo monkey])) {
  419.             chosen_familiar = $familiar[hobo monkey];
  420.         } else {
  421.             chosen_familiar = $familiar[leprechaun];
  422.         }
  423.     } else if (to_lower_case(what_to_farm).contains_text("item")) {
  424.         if (have_familiar($familiar[xo skeleton])) {
  425.             chosen_familiar = $familiar[xo skeleton];
  426.         } else if (have_familiar($familiar[jumpsuited hound dog])) {
  427.             chosen_familiar = $familiar[jumpsuited hound dog];
  428.         } else {
  429.             chosen_familiar = $familiar[baby gravy fairy];
  430.         }
  431.     }
  432.    
  433.     // Check for what item-dropping familiars are options
  434.     foreach i in familiars_which_drop_items {
  435.         // Have it, correct drop modifier, adventuresleft
  436.         fam = familiars_which_drop_items[i];
  437.         if(have_familiar(fam) && numeric_modifier(fam, what_to_farm, 20, familiar_equipment(fam)) > 0) {
  438.             if (to_int(fam.drops_today) < to_int(fam.drops_limit)) {
  439.                 chosen_familiar = fam;
  440.                 break;
  441.             }
  442.         }
  443.     }
  444.     if (my_name() == "ereinion") {
  445. #       chosen_familiar = $familiar[Robortender];
  446.     }
  447.     print ("Best familiar found for " + what_to_farm + " is the " + to_string (chosen_familiar) + ".", "green");
  448.     return chosen_familiar;
  449. }
  450. # [12.]
  451. void farm(string modifier_string, int adventures_to_save) {
  452.     // No need to run this if out of adventures
  453.     if (my_adventures() == 0) {
  454.         return;
  455.     }
  456.     location whereToAdv = choose_location(modifier_string);
  457.     familiar fam_to_use;
  458.     item fam_eq;
  459.     boolean already_optimized = false;
  460.     boolean changes_done = false;
  461.     boolean pantsgiving_best = false;
  462.     int i;
  463.    
  464.     // Special cases
  465.     switch (my_path()) {
  466.         case "Avatar of Boris":
  467.             if (item_amount($item[Clancy's lute]) > 0) {
  468.                 use(1, $item[Clancy's lute]);
  469.             }
  470.             if (item_amount($item[Trusty]) > 0) {
  471.                 equip($slot[weapon], $item[Trusty]);
  472.             }
  473.         case "Avatar of Sneaky Pete":
  474.         case "Avatar of Jarlsberg":
  475.             if (my_companion() != "Eggman" && have_skill($skill[Egg Man]) && item_amount($item[Cosmic Egg]) > 0) {
  476.                 use_skill(1, $skill[Egg Man]);
  477.             }
  478.         case "Acctually Ed the Undying":
  479.             if (to_lower_case(modifier_string).contains_text("meat")) {
  480.                 if (have_servant($servant[maid]) && my_servant() != $servant[maid]) {
  481.                     use_servant($servant[maid]);
  482.                 }
  483.             } else if (to_lower_case(modifier_string).contains_text("item")) {
  484.                 if (have_servant($servant[cat]) && my_servant() != $servant[maid]) {
  485.                     use_servant($servant[cat]);
  486.                 }
  487.             }
  488.             already_optimized = true;
  489.         // Bleed over into "default"  paths, but no need to "optimize" if that already has been done.
  490.         default:
  491.             changes_done = true;
  492.             i = 30;
  493.             while (my_adventures() > adventures_to_save) {
  494.                 if (i == 30) {
  495.                     //  Pool buffs, hatter, etc.
  496.                     get_buffs(modifier_string);
  497.                     i = 0;
  498.                 }
  499.                 if (!already_optimized) {
  500.                     // Choose familiar
  501.                     fam_to_use = choose_familiar(modifier_string);
  502.                     if (fam_to_use != my_familiar()) {
  503.                         use_familiar(fam_to_use);
  504.                         // Choose familiar eq
  505.                         fam_eq = choose_familiar_equipment(modifier_string);
  506.                         if (fam_eq != $item[none] && !have_equipped(fam_eq)) {
  507.                             equip ($slot[familiar], fam_eq);
  508.                         }
  509.                         changes_done = true;
  510.                     }
  511.                 }
  512.                 if (have_equipped($item[Pantsgiving]) && !wear_pantsgiving() && !pantsgiving_best) {
  513.                     changes_done  = true;
  514.                 }
  515.                 // Maximize if any changes
  516.                 if (changes_done) {
  517.                     maximize (create_maximizer_string(modifier_string), false);
  518.                     if (have_equipped($item[Pantsgiving])) {
  519.                         pantsgiving_best = true;
  520.                     }
  521.                     changes_done = false;
  522.                 }
  523.                 if (my_name() != "algen") {
  524.                     adventure (1, whereToAdv);
  525.                 } else {
  526.                     fish_function(min(max(1, my_adventures() - adventures_to_save), 10));
  527.                 }
  528.                
  529.                 i = i + 1;
  530.             }
  531.     }
  532. }
  533. # [13.]
  534. void after_overdrinking(int fites_to_save) {
  535.     buffer maximizer_string;
  536.    
  537.     // Vamp out
  538.     if (available_amount($item[plastic vampire fangs]) > 0) {
  539.         vamp_out(13);
  540.     }
  541.    
  542.     // PVP
  543.     if (hippy_stone_broken()) {
  544.         cli_execute("refresh inv");
  545.         main@pvploot();
  546.         main@UberPvPOptimizer();
  547.         cli_execute("pvp " + to_string(pvp_attacks_left()-fites_to_save) + " flowers " + stance);
  548.     }
  549.    
  550.     // Libram-summoning
  551.     manaburn();
  552.    
  553.     // Pajamas
  554.     if (have_familiar($familiar[Trick-or-Treating Tot])) {
  555.         use_familiar($familiar[Trick-or-Treating Tot]);
  556.     }
  557.     if (hippy_stone_broken()) {
  558.         maximizer_string.append("0.1 adv, pvp fights, -current, -tie");
  559.     } else {
  560.         maximizer_string.append("adv, -current, -tie");
  561.     }
  562.     if (have_familiar($familiar[Disembodied Hand])) {
  563.         maximizer_string.append(", switch disembodied hand");
  564.     }
  565.     maximize(maximizer_string, false);
  566.    
  567.     // Sell stuff
  568.     ocd_inventory_control();
  569.    
  570.     // Get Jick Jar
  571.     if (item_amount($item[psychoanalytic jar]) > 0) {
  572.         if(visit_url("showplayer.php?who=1&action=jung&whichperson=jick").contains_text("Use psychoanalytic jar on him")) {
  573.             visit_url("showplayer.php?who=1&action=jung&whichperson=jick");
  574.         }
  575.         print("Checked for Jick Jar", "green");
  576.     }
  577.    
  578. }
  579. # [13.]
  580. void choose_bjornify_familiar() {
  581.     familiar fa;
  582.     fa = $familiar[grim brother];
  583.     if (have_familiar(fa) && to_int(get_property("_grimFairyTaleDropsCrown")) < 2) {
  584.         if (my_bjorned_familiar() != fa) {
  585.             bjornify_familiar(fa);
  586.         }
  587.         return;
  588.     }
  589.     fa = $familiar[grimstone golem];
  590.     if (have_familiar(fa) && to_int(get_property("_grimstoneMaskDropsCrown")) < 1) {
  591.         if (my_bjorned_familiar() != fa) {
  592.             bjornify_familiar(fa);
  593.         }
  594.         return;
  595.     }
  596.     fa = $familiar[el vibrato megadrone];
  597.     if (have_familiar(fa)) {
  598.         if (my_bjorned_familiar() != fa) {
  599.             bjornify_familiar(fa);
  600.         }
  601.         return;
  602.     }
  603. }
  604. # [14.]
  605. void free_fights_outfit() {
  606.     item it;
  607.     familiar fa;
  608.     buffer maximizer_string;
  609.    
  610.     maximizer_string.append("item Drop, 0.1 meat Drop, 0.01 mp regen, -tie, -current");
  611.    
  612.     it = $item[Pantsgiving];
  613.     if (available_amount(it) > 0) {
  614.         equip($slot[pants], it);
  615.         maximizer_string.append(", -pants");
  616.     }
  617.     it = $item[KoL Con 13 snowglobe];
  618.     if (available_amount(it) > 0) {
  619.         equip($slot[off-hand], it);
  620.         maximizer_string.append(", -offhand");
  621.         it = $item[time-twitching toolbelt];
  622.         if (available_amount(it) > 0) {
  623.             equip($slot[acc2], it);
  624.             maximizer_string.append(", -acc2");
  625.         }
  626.     }
  627.     it = $item[Mr. Cheeng's spectacles];
  628.     if (available_amount(it) > 0) {
  629.         equip($slot[acc1], it);
  630.         maximizer_string.append(", -acc1");
  631.     }
  632.     fa = $familiar[Rogue Program];
  633.     if (have_familiar(fa)) {
  634.         use_familiar(fa);
  635.     }
  636.     it = $item[snow suit];
  637.     if (available_amount(it) > 0) {
  638.         equip($slot[familiar], it);
  639.         maximizer_string.append(", -familiar");
  640.     }
  641.     it = $item[buddy bjorn];
  642.     if (available_amount(it) > 0) {
  643.         equip($slot[back], it);
  644.         choose_bjornify_familiar();
  645.         maximizer_string.append(", -back");
  646.     }
  647.     maximize(maximizer_string, false);
  648. }
  649. # [15.]
  650. void free_fights() {
  651.     int i = 0;
  652.     familiar f;
  653.     string choice_adv;
  654.    
  655.    
  656.     if (!to_boolean(get_property("_loveTunnelUsed")) || to_boolean(get_property("snojoAvailable")) || to_int(get_property("_machineTunnelsAdv")) < 5 || to_int(get_property("_witchessFights")) < 5) {
  657.        
  658.         free_fights_outfit();
  659.        
  660.         // L.O.V.E. tunnel
  661.         if (!to_boolean(get_property("_loveTunnelUsed")) && to_boolean(get_property("loveTunnelAvailable"))) {
  662.             visit_url("place.php?whichplace=town_wrong&action=townwrong_tunnel");
  663.             run_choice(1);
  664.             run_choice(1);
  665.             visit_url("choice.php");
  666.             // 1 = Eardigan, 2 = Epaulettes, 3 = Earring
  667.             run_choice(3);
  668.             run_choice(1);
  669.             visit_url("choice.php");
  670.             // 1 = Lovebotamy, 2 = Open Heart Surgery, 3 = Wandering Eye Surgery
  671.             run_choice(2);
  672.             run_choice(1);
  673.             // 1 = Enamorang, 2 = Emotionizer, 3 = Extraterrestrial Chocolate, 4 = Echinacea Bouquet, 5 = Elephant, 6 = 2 pieces of toast
  674.             run_choice(2);
  675.         }
  676.  
  677.         choose_bjornify_familiar();
  678.         // Snojo
  679.         if (to_boolean(get_property("snojoAvailable"))) {
  680.             while (to_int(get_property("_snojoFreeFights")) < 10 && i <= 15) {
  681.                 adv1($location[The X-32-F Combat Training Snowman], -1, "");
  682.                 i = i + 1;
  683.             }
  684.         }
  685.        
  686.         choose_bjornify_familiar();
  687.         // Machine elf tunnels
  688.         if (have_familiar($familiar[Machine Elf]) && to_int(get_property("_machineTunnelsAdv")) < 5){
  689.             f = my_familiar();
  690.             i = 0;
  691.             use_familiar($familiar[Machine Elf]);
  692.             while (to_int(get_property("_machineTunnelsAdv")) < 5 && i <= 15) {
  693.                 adv1($location[The Deep Machine Tunnels], -1, "");
  694.                 i = i + 1;
  695.             }
  696.             use_familiar(f);
  697.         }
  698.        
  699.         choose_bjornify_familiar();
  700.         // Witchess
  701.         if(get_campground() contains $item[Witchess Set] && to_int(get_property("_witchessFights")) < 5) {
  702.             i = 0;
  703.             while(to_int(get_property("_witchessFights")) < 5 && i < 10) {
  704.                 // Witchess knight
  705.                 choice_adv = "1936";
  706.                 if (to_int(get_property("_witchessFights")) == 4 && have_skill($skill[Frigidalmatian])) {
  707.                     // Witchess ox
  708.                     if (use_skill(1, $skill[Frigidalmatian])) {
  709.                         choice_adv = "1937";
  710.                     }
  711.                 }
  712.                 visit_url("campground.php?action=witchess");
  713.                 run_choice(1);
  714.                 visit_url("choice.php?option=1&pwd="+my_hash()+"&whichchoice=1182&piece=" + choice_adv, false);
  715.                 run_combat();
  716.                 i = i + 1;
  717.             }
  718.         }
  719.     }
  720. }
  721.  
  722.  
  723. # [16.]
  724. void simple_farming(string what_to_farm, int adventures_to_save, int fites_to_save, boolean overdrink_after_farming) {
  725.     int swagger; int meat;
  726.     buffer maximizer_string;
  727.    
  728.     if (item_amount($item[Time-Spinner]) > 0 && !to_boolean (get_property ("_timeSpinnerReplicatorUsed"))) {
  729.         cli_execute("timespinner shot");
  730.     }
  731.     // If overdrunk or not in aftercore, exit script
  732.     if (my_inebriety() <= inebriety_limit() && can_interact()) {
  733.         // Exit on invalid input
  734.         string modifier_string;
  735.         if (to_lower_case(what_to_farm).contains_text("meat")) {
  736.             modifier_string = "Meat Drop";
  737.         } else if (to_lower_case(what_to_farm).contains_text("item")) {
  738.             modifier_string = "Item Drop";
  739.         } else {
  740.             print("Error in input; \'" + what_to_farm + "\'. The string given to the script should be either \'meat\' or \'item'. Try again.", "red");
  741.             exit;
  742.         }
  743.        
  744.         // Free_fights
  745.         free_fights();
  746.        
  747.         // Initial meat and swagger values
  748.         meat = my_meat(); swagger = to_int(get_property("availableSwagger"));
  749.        
  750.         // Consume
  751.         if (my_inebriety() < inebriety_limit()) {
  752.             get_ode();
  753.             manual_buffs(false);
  754.             wait(30);
  755.         }
  756.         consumption();
  757.        
  758.         if (my_adventures() >= 30) {
  759.             // If no dog hair/distention pills left, get new ones
  760.             if (item_amount($item[distention pill]) < 1 || item_amount($item[synthetic dog hair pill]) < 1) {
  761.                 expanders();
  762.             }
  763.         }
  764.        
  765.         // Farm
  766.         farm(modifier_string, adventures_to_save);
  767.        
  768.         // Overdrink
  769.         if (overdrink_after_farming) {
  770.             get_ode();
  771.             eatdrink(0, inebriety_limit(), 0, true);
  772.         }
  773.        
  774.         after_overdrinking(fites_to_save);
  775.        
  776.         meat = my_meat() - meat; swagger = to_int(get_property("availableSwagger")) - swagger;
  777.         print("Gained " + meat + " meat.", "blue");
  778.         print("Gained " + swagger + " swagger. Current swagger is: " + get_property("availableSwagger"), "blue");
  779.        
  780.     } else if (!can_interact()) {
  781.         print("Wait till you are out of ronin before running this script.", "red");
  782.     } else {
  783.         after_overdrinking(fites_to_save);
  784.         print("You are overdrunk.", "red");
  785.     }
  786. }
  787. # [17.]
  788. void main(string what_to_farm) {
  789.     simple_farming(what_to_farm, 0, 0, true);
  790. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement