def auto_1_1_single(): game.set_foremost() game.dock_back_to_port() game.port_open_panel_sortie() game.sortie_select(1, 1) game.sortie_confirm() game.combat_map_loading() game.combat_map_moving() game.combat_battle(False) game.combat_result() utils.random_sleep(1.6) game.combat_advance() game.combat_compass() game.combat_map_moving() game.combat_battle(False) utils.random_sleep(1.6) game.combat_result() api_server.wait("/kcsapi/api_get_member/useitem") utils.random_sleep(1.6) game.port_open_panel_supply() game.supply_first_ship()
def auto_22(): game.set_foremost() while True: request = game.dock_back_to_port() if battle.port_has_damaged_ship(request): break game.port_open_panel_sortie() game.sortie_select(2, 2) game.sortie_confirm() game.combat_map_loading() game.combat_map_moving() game.combat_compass() game.combat_map_moving() game.combat_formation_line() # point B game.combat_result() game.combat_advance() # point A game.combat_map_moving() game.combat_map_moving() request = game.combat_summary() game.port_open_panel_supply() game.supply_current_fleet() if battle.port_has_damaged_ship(request): game.dock_open_panel_organize() break
def spot_battle_with_challenge(self): spot = self.spot_list[self.spot_no] if spot.compass: game.combat_compass() game.combat_map_moving() if spot.enemy_detection: game.combat_map_enemy_animation() if spot.enemy_animation: game.combat_map_enemy_animation() if self.auto_formation and spot.formation is not None: spot.formation() if self.auto_night: battle_request = game.combat_battle(self.should_night_battle()) else: battle_request = api_server.wait('/kcsapi/api_req_sortie/battle') self.fleet_status = battle.battle_analyze( battle_request, combined=self.fleet_combined) game.combat_result() if spot.final: api_server.wait("/kcsapi/api_get_member/useitem") self.spot_no = 0 return self.end elif self.auto_advance: if self.should_retreat(): game.combat_retreat() self.spot_no = 0 return self.end if self.fleet_status == battle.BattleResult.Flagship_Damaged: game.combat_retreat_flagship_damaged() self.spot_no = 0 return self.end if self.fleet_status == battle.BattleResult.Ship_Damaged: req_ship_deck, req_next = game.combat_advance() self.spot_no = req_next.body["api_no"] if self.spot_no in self.safe_spot_list: return self.spot_dispatcher else: self.spot_no = 0 game.poi_refresh_page() return None if self.fleet_status == battle.BattleResult.Safe: req_ship_deck, req_next = game.combat_advance() if battle.advance_has_damaged_ship(req_ship_deck): self.fleet_status = battle.BattleResult.Ship_Damaged game.poi_refresh_page() raise Exception("BattleAnalyzeFailure") else: self.spot_no = req_next.body["api_no"] return self.spot_dispatcher
def path_battle(self): game.combat_map_moving() game.combat_formation_line() request = game.combat_battle(self.should_night_battle()) game.combat_result() battle_result = battle.battle_analyze(request) if battle_result == battle.BattleResult.Flagship_Damaged: game.combat_retreat_flagship_damaged() self.cell_no = 0 return self.port if battle_result == battle.BattleResult.Ship_Damaged: game.combat_retreat() self.cell_no = 0 return self.port if battle_result == battle.BattleResult.Safe: req_ship_deck, req_next = game.combat_advance() if battle.advance_has_damaged_ship(req_ship_deck): game.poi_refresh_page() raise Exception("battle_analyze_failure") else: self.cell_no = req_next.body["api_no"] return self.path_dict.get(self.cell_no, None)