def do_generate_inventory_management_for_adventure(should_grind, should_sell): # At this point we're at the victory screen. We need to click the Inventory button on the # left side. This involves a loading screen and can take quite some time, so wait 15 seconds. memu.click_loc((80, 230), 15000) manage_inventory(should_grind, should_sell) # Exit back to Orvel map memu.click_button('exit', 3500)
def grind_or_sell_all(is_grind): # Grind button = 'grind' if is_grind else 'sell' memu.click_button(button, 3500) # Grind all memu.click_button('grind_all', 3500) # Click the Grind button on the window that pops up memu.click_button('grind_2', 3500) # Confirmation memu.click_button('grind_confirm', 3500) if is_grind: # Click on the screen to get rid of the results memu.click_button('dismiss_results', 3500)
def generate_one_click_cycle(): # No effect during battle or on victory screen, but if we get stuck in Get Ready # for Battle screen after inventory management, this starts us again. Make sure # to do this BEFORE the continue button, otherwise the continue button will click # one of our heroes and remove them from the lineup. By putting this click first # it guarantees that we either enter the battle, or get the stamina window (in # which case the click doesn't go through to the button underneath). memu.click_button('start_adventure', 500) # Be careful with the x coordinate here so that it clicks in between items in the # inventory if your inventory is full. memu.click_loc((503, 352), 500) # Continue (game pauses sometimes mid-battle) memu.click_loc((1204, 494), 500) # Retry memu.click_loc((572, 467), 500) # Single Repeat button. Careful not to click the button that # edits the count of stamina potions to use. if use_pot: memu.click_loc((759, 558), 500) # Stamina Potion OK else: memu.click_loc((940, 190), 500) # Close stamina pop-up
def gen_raid(): confirm(start_condition='The macro can be started in a raid lobby or while a raid is in progress.') time = 1000000 half_second = 500000 memu.click_button('start_raid', time) memu.click_button('confirm_insufficient_members', time + half_second) memu.click_button('abandon_raid', time + (half_second * 2))
def re_enter_adventure(use_potion): # Re-enter the map. Since there's a loading transition, this takes a little extra time. memu.click_button('enter_node', 3500) # Prepare battle -> start adventure. memu.click_button('start_adventure', 3500) memu.click_button('start_adventure', 3500) # The stamina window may have popped up. Use a potion if use_potion: memu.click_loc((759, 558), 2000) # Stamina Potion OK
def gen_raid_leader(): confirm(start_condition='The macro can be started in a raid lobby or while a raid is in progress.') time = 1000000 half_second = 500000 for i in range(0, 10): memu.click_button('start_raid', time) time = time + half_second memu.click_button('confirm_insufficient_members', time) memu.click_button('abandon_raid', time + half_second)
def gen_raid_experimental(): confirm() memu.click_button('start_raid', 10000) memu.click_button('stam_potion_confirm', 1000) memu.click_button('abandon_raid', 1000)
def gen_grindhouse(): # The generated macro assumes you are on the Buy screen, Tier 3 is already selected, and an item is # highlighted. print() items_to_buy = memu.prompt_user_for_int( "How many items should be purchased each cycle?\n" "If you don't have at least this much inventory space the macro will de-sync.\n" "Number of items to purchase: ") print() buy_delay = memu.prompt_user_for_int("Enter the number of milliseconds between each click while purchasing\n" "items. A lower number will make the macro run faster, but could cause\n" "the macro to get out of sync on slower machines. If the macro doesn't\n" "register clicks properly while buying items, run the generator again\n" "and choose a higher number until you find what works.\n\n" "Milliseconds (Default=325): ", default=325) confirm(properties={'Items to buy' : items_to_buy, 'Delay' : buy_delay }, start_condition='The macro should be started from the forge shop, with an item selected.') # Buy 300 items for i in range(0, items_to_buy): memu.click_button('buy', buy_delay) memu.click_button('buy_confirm', buy_delay) # Exit twice (to Orvel map) memu.click_button('exit', 1500) memu.click_button('exit', 1500) # Open inventory memu.click_button('inventory', 1500) grind_or_sell_all(True) # Exit back to Orvel world map memu.click_button('exit', 1500) # Re-enter the shop. Delay set to 2500 here since there's an animated transition # that takes a little extra time memu.click_button('enter_node', 5000) # Click Use Shop button memu.click_button('use_shop', 1500)