Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import <EatDrink.ash>;
  2. import <manual_buffs.ash>;
  3. import <pvpbestgear.ash>;
  4. import <pvploot.ash>;
  5. import <zlib.ash>;
  6. import <AT_song_support.ash>;
  7. import <manaburn.ash>;
  8. import <clanhop.ash>;
  9. import <VampOut.ash>;
  10. import <OCD Inventory Control.ash>;
  11. import <Expanders.ash>;
  12.  
  13. string VIP_LOUNGE = visit_url("clan_viplounge.php");
  14.  
  15. boolean get_meat_buffs(boolean get_all) {
  16.     string current_clan;
  17.     effect[5] meat_buffs;
  18.     meat_buffs[0] = $effect[Billiards Belligerence];
  19.     meat_buffs[1] = $effect[Dances with Tweedles];
  20.     meat_buffs[2] = $effect[Brother Flying Burrito's Blessing];
  21.     meat_buffs[3] = $effect[Winklered];
  22.     meat_buffs[4] = $effect[Optimist Primal];
  23.    
  24.     foreach i in meat_buffs {
  25.         if (my_effects() contains meat_buffs[i] && !get_all) {
  26.             return true;
  27.         }
  28.     }
  29.     // Pool table
  30.     if (item_amount($item[Clan VIP Lounge key]) > 0 && to_int(get_property("_poolGames")) < 3) {
  31.         if (!VIP_LOUNGE.contains_text("pooltable.gif")) {
  32.             current_clan = get_clan_name();
  33.             clanhop("Bonus Adventures from Hell");
  34.         }
  35.         for i from 1 to (3 - to_int(get_property("_poolGames"))) {
  36.             cli_execute("pool 1");
  37.         }
  38.         if (current_clan.length() > 0) {
  39.             clanhop(current_clan);
  40.         }
  41.         return true;
  42.     }
  43.     // Hatter
  44.     if (!to_boolean(get_property("_madTeaParty"))) {
  45.         if (item_amount($item[&quot;DRINK ME&quot; potion]) < 1) {
  46.             buy(1, $item[&quot;DRINK ME&quot; potion], 500);
  47.         }
  48.         cli_execute("hatter 22");
  49.         return true;
  50.     }
  51.     // Friars
  52.     if (!to_boolean(get_property("friarsBlessingReceived")) && friars_available()) {
  53.         cli_execute("friars food");
  54.         return true;
  55.     }
  56.     // Island Arena
  57.     if (get_property("sidequestArenaCompleted") == "fratboy" && !to_boolean(get_property("concertVisited"))) {
  58.         cli_execute("concert winklered");
  59.         return true;
  60.     }
  61.     if (get_property("sidequestArenaCompleted") == "fratboy" && !to_boolean(get_property("concertVisited"))) {
  62.         cli_execute("concert optimist primal");
  63.         return true;
  64.     }
  65.     return false;
  66. }
  67.  
  68. boolean get_item_buffs(boolean get_all) {
  69.     string current_clan;
  70.     effect[5] item_buffs;
  71.     item_buffs[0] = $effect[Hustlin'];
  72.     item_buffs[1] = $effect[Clyde's Blessing];
  73.     item_buffs[2] = $effect[Quadrilled];
  74.     item_buffs[3] = $effect[Brother Smothers's Blessing];
  75.     item_buffs[4] = $effect[Dilated Pupils];
  76.    
  77.     foreach i in item_buffs {
  78.         if (my_effects() contains item_buffs[i] && !get_all) {
  79.             return true;
  80.         }
  81.     }
  82.     // Pool table
  83.     if (item_amount($item[Clan VIP Lounge key]) > 0 && to_int(get_property("_poolGames")) < 3) {
  84.         if (!VIP_LOUNGE.contains_text("pooltable.gif")) {
  85.             current_clan = get_clan_name();
  86.             clanhop("Bonus Adventures from Hell");
  87.         }
  88.         for i from 1 to (3 - to_int(get_property("_poolGames"))) {
  89.             cli_execute("pool 3");
  90.         }
  91.         print(current_clan.length(), "red");
  92.         print(to_boolean(current_clan.length() > 0), "red");
  93.         if (current_clan.length() > 0) {
  94.             clanhop(current_clan);
  95.         }
  96.         return true;
  97.     }
  98.     // Legendary Beat
  99.     if (item_amount($item[The Legendary Beat]) > 0 && !to_boolean(get_property("_legendaryBeat"))) {
  100.         use(1, $item[The Legendary Beat]);
  101.     }
  102.     // Hatter
  103.     if (!to_boolean(get_property("_madTeaParty"))) {
  104.         if (item_amount($item[&quot;DRINK ME&quot; potion]) < 1) {
  105.             buy(1, $item[&quot;DRINK ME&quot; potion], 500);
  106.         }
  107.         cli_execute("hatter 28");
  108.         return true;
  109.     }
  110.     // Friars
  111.     if (!to_boolean(get_property("friarsBlessingReceived")) && friars_available()) {
  112.         cli_execute("friars booze");
  113.         return true;
  114.     }
  115.     // Island Arena
  116.     if (get_property("sidequestArenaCompleted") == "hippy" && !to_boolean(get_property("concertVisited"))) {
  117.         cli_execute("concert dilated pupils");
  118.         return true;
  119.     }
  120.     return false;
  121. }
  122.  
  123. void get_all_buffs(string s) {
  124.     if (s == "Meat Drop") {
  125.         while (get_meat_buffs(true)) {}
  126.         while (get_item_buffs(true)) {}
  127.     } else {
  128.         while (get_item_buffs(true)) {}
  129.         while (get_meat_buffs(true)) {}
  130.     }
  131. }
  132.  
  133. void get_ode() {
  134.     // Get ode from some other source
  135.     int[string] otherBuffbotsPrices;
  136.     otherBuffbotsPrices["kolabuff"] = 2;
  137.     otherBuffbotsPrices["testudinata"] = 11;
  138.     otherBuffbotsPrices["noblesse oblige"] = 16;
  139.     otherBuffbotsPrices["iocainebot"] = 23;
  140.     otherBuffbotsPrices["notbot"] = 40;
  141.     otherBuffbotsPrices["tinkerballa"] = 67;
  142.  
  143.     if (!have_equipped($item[plexiglass pendant]) && available_amount($item[plexiglass pendant]) > 0) {
  144.         equip($slot[acc3], $item[plexiglass pendant]);
  145.     }
  146.    
  147.     cli_execute("refresh effects");
  148.     if (!(have_effect($effect[Ode to Booze]) > 15)) {
  149.         while (available_song_slots() <= 0) {
  150.             open_song_spot();
  151.         }
  152.         if (is_online("buffy")) {
  153.             chat_private("buffy", "ode");
  154.             wait(30);
  155.         }
  156.         foreach buffbot in otherBuffbotsPrices {
  157.             cli_execute("refresh effects");
  158.             if (have_effect($effect[Ode to Booze]) > 0) {
  159.                 return;
  160.             } else if (available_song_slots() <= 0) {
  161.                 open_song_spot();
  162.             }
  163.             if (is_online(buffbot) && !(have_effect($effect[Ode to Booze]) > 0)) {
  164.                 kmail(buffbot, "", otherBuffbotsPrices[buffbot]);
  165.                 wait(20);
  166.             }
  167.         }
  168.     }
  169. }
  170.  
  171. // Consumption
  172. void consumption() {
  173.     SIM_CONSUME = false;
  174.    
  175.     if (my_inebriety() < inebriety_limit() || my_fullness() < fullness_limit() || my_spleen_use() < spleen_limit()) {
  176.         if (!(have_effect($effect[Ode to Booze]) > 0) && my_inebriety() < inebriety_limit()) {
  177.             get_ode();
  178.         }
  179.         eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
  180.     }
  181.     // Increase fullness/drunkenness limits.
  182.     if (!to_boolean(get_property("_syntheticDogHairPillUsed")) && item_amount($item[synthetic dog hair pill]) >= 1) {
  183.         use(1, $item[synthetic dog hair pill]);
  184.     }
  185.     if (!to_boolean(get_property("_distentionPillUsed")) && item_amount($item[distention pill]) >= 1) {
  186.         // If pantsgiving is available, delay using distention pill.
  187.         if ((item_amount($item[pantsgiving]) == 0 && !have_equipped($item[pantsgiving])) || to_int(get_property("_pantsgivingFullness")) >= 2) {
  188.             use(1, $item[distention pill]);
  189.         }
  190.     }
  191.     if (my_inebriety() < inebriety_limit() || my_fullness() < fullness_limit()) {
  192.         if (!(have_effect($effect[Ode to Booze]) > 0) && my_inebriety() < inebriety_limit()) {
  193.             get_ode();
  194.         }
  195.         eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
  196.     }
  197. }
  198.  
  199. // Adventuring
  200. boolean changePantsAfterAdventuringFor1(location whereToAdv) {
  201.     if (have_equipped($item[pantsgiving])) {
  202.         adventure(1, whereToAdv);
  203.         if (to_int(get_property("_pantsgivingCount")) >= 49) {
  204.             consumption();
  205.         }
  206.         if (to_int(get_property("_pantsgivingFullness")) >= 2) {
  207.             return true;
  208.         }
  209.     }
  210.     return false;
  211. }
  212.  
  213. void farm(string modifier_string) {
  214.     // No need to run this if out of adventures
  215.     if (my_adventures() == 0) {
  216.         return;
  217.     }
  218.     // What familiar you use once you've got all the drops, and where to farm
  219.     familiar defaultFamiliar;
  220.     location whereToAdv;
  221.     int adventures_to_save;
  222.    
  223.     adventures_to_save = 0;
  224.     if (modifier_string == "Meat Drop") {
  225.         defaultFamiliar = $familiar[hobo monkey];
  226.         whereToAdv = $location[Sloppy Seconds Diner];
  227.     } else if (modifier_string == "Item Drop") {
  228.         defaultFamiliar = $familiar[jumpsuited hound dog];
  229.         if (my_name() == "ereinion") {
  230.             whereToAdv = $location[Camp Logging Camp];
  231.         } else {
  232.             whereToAdv = $location[The Haunted Library];
  233.         }
  234.     }
  235.    
  236.     // Initial maximizer string
  237.     buffer maximizer_string;
  238.     maximizer_string.append(modifier_string + ", -tie, -current");
  239.     if (item_amount($item[pantsgiving]) >= 1 || have_equipped($item[pantsgiving])) {
  240.         if (get_property("_pantsgivingFullness") < 2) {
  241.             equip($slot[pants], $item[pantsgiving]);
  242.             maximizer_string.append(", -pants");
  243.         }
  244.     }
  245.    
  246.     // Concerning familiars
  247.     string[familiar] dropperProperty;
  248.     dropperProperty[$familiar[Angry Jung Man]] = "_jungDrops";                          // Item, meat
  249.     dropperProperty[$familiar[Blavious Kloop]] = "_kloopDrops";                         // Item, meat
  250.     dropperProperty[$familiar[Bloovian Groose]] = "_grooseDrops";                       // Meat
  251.     dropperProperty[$familiar[Fist Turkey]] = "_turkeyBooze";                           // Item
  252.     dropperProperty[$familiar[Green Pixie]] = "_absintheDrops";                         // Item
  253.     dropperProperty[$familiar[Grim Brother]] = "_grimFairyTaleDrops";               // Meat
  254.     dropperProperty[$familiar[Grimstone Golem]] = "_grimstoneMaskDrops";        // Item, meat
  255.     dropperProperty[$familiar[Li'l Xenomorph]] = "_transponderDrops";               // Item, meat
  256.     dropperProperty[$familiar[Pair of Stomping Boots]] = "_bootStomps";         // Item
  257.     dropperProperty[$familiar[Unconscious Collective]] = "_dreamJarDrops";  // Meat
  258.    
  259.     int[familiar] otherThan5;
  260.     otherThan5[$familiar[Angry Jung Man]] = 1;
  261.     otherThan5[$familiar[Grimstone Golem]] = 1;
  262.     otherThan5[$familiar[Pair of Stomping Boots]] = 7;
  263.     int goal;
  264.    
  265.     // Equip hamster, in case the maximizer tries to use the garbage detector (!)
  266.     if (item_amount($item[Hodgman\'s imaginary hamster]) > 0 && my_path() != "Avatar of Boris" && my_path() != "Way of the Surprising Fist") {
  267.         if (weapon_hands(equipped_item($slot[weapon])) > 1) {
  268.             equip($slot[weapon], $item[none]);
  269.         }
  270.         equip($slot[off-hand], $item[Hodgman\'s imaginary hamster]);
  271.     }
  272.    
  273.     // Special cases
  274.     switch (my_path()) {
  275.         case "Avatar of Boris":
  276.             if (item_amount($item[Clancy's lute]) > 0) {
  277.                 use(1, $item[Clancy's lute]);
  278.             }
  279.             equip($slot[weapon], $item[Trusty]);
  280.             maximize(maximizer_string, false);
  281.             get_all_buffs(modifier_string);
  282.             while (my_adventures() > adventures_to_save) {
  283.                 if (have_equipped($item[pantsgiving])) {
  284.                     if (changePantsAfterAdventuringFor1(whereToAdv)) {
  285.                         maximizer_string.replace_string(", -pants", "");
  286.                         maximize(maximizer_string, false);
  287.                     }
  288.                 } else {
  289.                     adventure(1, whereToAdv);
  290.                 }
  291.             }
  292.             break;
  293.         case "Avatar of Sneaky Pete":
  294.             maximize(maximizer_string, false);
  295.             get_all_buffs(modifier_string);
  296.             while (my_adventures() > adventures_to_save) {
  297.                 if (have_equipped($item[pantsgiving])) {
  298.                     if (changePantsAfterAdventuringFor1(whereToAdv)) {
  299.                         maximizer_string.replace_string(", -pants", "");
  300.                         maximize(maximizer_string, false);
  301.                     }
  302.                 } else {
  303.                     adventure(1, whereToAdv);
  304.                 }
  305.             }
  306.             break;
  307.         case "Avatar of Jarlsberg":
  308.             if (my_companion() != "Eggman" && have_skill($skill[Egg Man]) && item_amount($item[Cosmic Egg]) > 0) {
  309.                 use_skill(1, $skill[Egg Man]);
  310.             }
  311.             maximize(maximizer_string, false);
  312.             get_all_buffs(modifier_string);
  313.             while (my_adventures() > adventures_to_save) {
  314.                 if (have_equipped($item[pantsgiving])) {
  315.                     if (changePantsAfterAdventuringFor1(whereToAdv)) {
  316.                         maximizer_string.replace_string(", -pants", "");
  317.                         maximize(maximizer_string, false);
  318.                     }
  319.                 } else {
  320.                     adventure(1, whereToAdv);
  321.                 }
  322.             }
  323.             break;
  324.         default:
  325.             // Use all item-dropping familiars which also buffs what you are trying to farm (item/meat)
  326.             foreach fam in dropperProperty {
  327.                 // Have it, correct drop modifier, adventures left
  328.                 if(have_familiar(fam) && numeric_modifier(fam, modifier_string, 20, familiar_equipment(fam)) > 0 && my_adventures() > adventures_to_save) {
  329.                     use_familiar(fam);
  330.                     // Get limited daily buffs, new one every time you switch familiar
  331.                     if (modifier_string.contains_text("Item")) {
  332.                         if (!get_item_buffs(false)) {
  333.                             get_meat_buffs(false);
  334.                         }
  335.                     } else {
  336.                         if (!get_meat_buffs(false)) {
  337.                             get_item_buffs(false);
  338.                         }
  339.                     }
  340.                     if (fam == $familiar[Li'l Xenomorph] && dropperProperty[fam] < 5) {
  341.                         maximizer_string.append(", equip tiny top hat and cane");
  342.                     }
  343.                     if (otherThan5 contains fam) {
  344.                         goal = otherThan5[fam];
  345.                     } else {
  346.                         goal = 5;
  347.                     }
  348.                     // Not at max drops
  349.                     if (to_int(get_property(dropperProperty[fam])) < goal) {
  350.                         // Change gear
  351.                         maximize(maximizer_string, false);
  352.                         // Adventure
  353.                         while(get_property(dropperProperty[fam]) < goal && my_adventures() > adventures_to_save) {
  354.                             if (have_equipped($item[pantsgiving])) {
  355.                                 if(changePantsAfterAdventuringFor1(whereToAdv)) {
  356.                                     maximizer_string.replace_string(", -pants", "");
  357.                                     maximize(maximizer_string, false);
  358.                                 }
  359.                             } else {
  360.                                 adventure(1, whereToAdv);
  361.                             }
  362.                         }
  363.                     }
  364.                     // If tiny top hat and cane added to maximizer string, remove it.
  365.                     maximizer_string.replace_string(", equip tiny top hat and cane", "");
  366.                 }
  367.             }
  368.             // Burn the rest of your adventures using the default familiar.
  369.             # Not during Crimbo
  370.            
  371.             if (my_adventures() > adventures_to_save) {
  372.                 use_familiar(defaultFamiliar);
  373.                 maximize(maximizer_string, false);
  374.                 get_all_buffs(modifier_string);
  375.                 // Spend one adventure at a time until the limit for pantsgiving is reached
  376.                 while(to_int(get_property("_pantsgivingFullness")) < 2 && have_equipped($item[pantsgiving])) {
  377.                     if(changePantsAfterAdventuringFor1(whereToAdv)) {
  378.                         maximizer_string.replace_string(", -pants", "");
  379.                     }
  380.                 }
  381.                 maximize(maximizer_string, false);
  382.                 adventure(my_adventures() - adventures_to_save, whereToAdv);
  383.             }
  384.             // End of switch
  385.     }
  386. }
  387.  
  388. void simple_farming(string what_to_farm) {
  389.     boolean overdrink_after_farming;
  390.     overdrink_after_farming = true;
  391.     // If overdrunk or not in aftercore, exit script
  392.     if (my_inebriety() <= inebriety_limit() && can_interact()) {
  393.         // Exit on invalid input
  394.         string modifier_string;
  395.         if (to_lower_case(what_to_farm).contains_text("meat")) {
  396.             modifier_string = "Meat Drop";
  397.         } else if (to_lower_case(what_to_farm).contains_text("item")) {
  398.             modifier_string = "Item Drop";
  399.         } else {
  400.             print("Error in input; \'" + what_to_farm + "\'. The string given to the script should be either \'meat\' or \'item'. Try again.", "red");
  401.             exit;
  402.         }
  403.        
  404.         // Consume
  405.         if (!have_equipped($item[plexiglass pendant]) && item_amount($item[plexiglass pendant]) >= 1) {
  406.             equip($slot[acc3], $item[plexiglass pendant]);
  407.         }
  408.         if (my_inebriety() < inebriety_limit()) {
  409.             manual_buffs(true);
  410.             wait(30);
  411.         }
  412.         consumption();
  413.        
  414.         // If no dog hair/distention pills left, get new ones
  415.         if (item_amount($item[distention pill]) < 1 || item_amount($item[   synthetic dog hair pill]) < 1) {
  416.             expanders();
  417.         }
  418.        
  419.         // Farm
  420.         farm(modifier_string);
  421.        
  422.         // Overdrink
  423.         if (overdrink_after_farming) {
  424.             get_ode();
  425.             eatdrink(0, inebriety_limit(), 0, true);
  426.         }
  427.         // Vamp out
  428.         if (available_amount($item[plastic vampire fangs]) > 0) {
  429.             vamp_out(13);
  430.         }
  431.        
  432.         // PVP
  433.         if (hippy_stone_broken()) {
  434.             cli_execute("refresh inv");
  435.             main@pvploot();
  436.             main@pvpbestgear();
  437.             cli_execute("flowers");
  438.         }
  439.        
  440.         // Libram-summoning
  441.         manaburn();
  442.        
  443.         // Sell staff
  444.         ocd_inventory_control();
  445.        
  446.         // Pajamas
  447.         if (hippy_stone_broken()) {
  448.             maximize("0.1 adv, pvp fights, -current", false);
  449.         } else {
  450.             maximize("adv, -current", false);
  451.         }
  452.         // Get Jick Jar
  453.         if (item_amount($item[psychoanalytic jar]) > 0) {
  454.             if(visit_url("showplayer.php?who=1&action=jung&whichperson=jick").contains_text("Use psychoanalytic jar on him")) {
  455.                 visit_url("showplayer.php?who=1&action=jung&whichperson=jick");
  456.             }
  457.             print("Checked for Jick Jar", "green");
  458.         }
  459.     } else if (!can_interact()) {
  460.         print("Wait till you are out of ronin before running this script.", "red");
  461.     } else {
  462.         print("You are overdrunk.", "red");
  463.     }
  464. }
  465.  
  466. void main(string what_to_farm) {
  467.     simple_farming(what_to_farm);
  468. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement