def find_and_guzzle_rock_cake(): cake_location = Mouse.get_on_screen(Items.ITEM_ROCK_CAKE, 0.991) if cake_location is None: sys.exit('Could not find rock cake, exiting script') else: random_location = cake_location[0] + Mouse.get_rand_int( 0, 16), cake_location[1] + Mouse.get_rand_int(0, 1) Mouse.move_humanly_mouse_to_location(random_location[0], random_location[1]) guzzle_rock_cake_uncached()
def super_ranging_mode(): min_interval = input( 'Enter minimum time in minutes to sleep (minimum 2 min): ') max_interval = input( 'Enter maximum time in minutes to sleep (maximum 19 min): ') try: min_interval = float(min_interval) max_interval = float(max_interval) except ValueError: sys.exit('Sleep min/max time was not a number!') if min_interval < 2 or max_interval > 19 or min_interval >= max_interval: sys.exit('Sleep times were not correct!') input('Press enter to start...') while True: open_inventory_if_closed() log.info('Trying to find absorption potions') absorption_potions = get_potion_doses_and_locations( list_abs_potions_enum, 0.96) absorption_potions_doses_before_drinking = get_doses_left( absorption_potions) log.info('Drinking absorption potions until full') drink_absorptions_until_full(absorption_potions) if absorption_potions_doses_before_drinking == get_doses_left( get_potion_doses_and_locations(list_abs_potions_enum, 0.96)): sys.exit('Did not drink absorption potions, exiting script') log.info('Trying to find rock cake and guzzle it') find_and_guzzle_rock_cake() super_ranging_potions = get_potion_doses_and_locations( list_super_ranging_potions_enum, 0.96) log.debug('Drinking super ranging potion if there are any') drink_a_dose_if_possible(super_ranging_potions) Mouse.move_humanly_mouse_to_location(5, 5) if not get_doses_left(absorption_potions) > 0: break else: temp_min_interval = int(min_interval * 60 * 1000) temp_max_interval = int(max_interval * 60 * 1000) Mouse.sleep_with_countdown(temp_min_interval, temp_max_interval, 40000) sys.exit('No more absorption potions left, exiting script!')
def overload_mode(): do_drink_absorptions = True min_interval = 5.05 max_interval = 5.1 input( 'You need to have absorption potions, overloads and a rock cake in your inventory' ) input('Press enter to start...') while True: open_inventory_if_closed() absorption_potions = get_potion_doses_and_locations( list_abs_potions_enum, 0.985) abs_doses_left = get_doses_left(absorption_potions) if do_drink_absorptions: drink_absorptions_until_full(absorption_potions) do_drink_absorptions = do_drink_absorptions is False overload_potions = get_potion_doses_and_locations( list_overload_potions_enum, 0.985) overload_doses_before_drinking = get_doses_left(overload_potions) drink_a_dose_if_possible(overload_potions) Mouse.move_humanly_mouse_to_location(20, 20) after_drinking_doses = get_doses_left( get_potion_doses_and_locations(list_overload_potions_enum, 0.985)) if overload_doses_before_drinking == after_drinking_doses: sys.exit('Did not drink a dose of overload potion, exiting script') Mouse.sleep_with_countdown(2395, 3542, 10000) find_and_guzzle_rock_cake() Mouse.move_humanly_mouse_to_location(20, 20) if not abs_doses_left > 0 or not overload_doses_before_drinking > 0: break else: temp_min_interval = int(min_interval * 60 * 1000) temp_max_interval = int(max_interval * 60 * 1000) Mouse.sleep_with_countdown(temp_min_interval, temp_max_interval, 40000) sys.exit('No more absorption potions left, exiting script!')