Exemplo n.º 1
0
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()
Exemplo n.º 2
0
 def path_compass_final_battle(self):
     game.combat_compass()
     game.combat_map_moving()
     game.combat_battle(self.should_night_battle())
     game.combat_result()
     api_server.wait("/kcsapi/api_get_member/useitem")
     self.cell_no = 0
     return self.port
Exemplo n.º 3
0
    def spot_battle(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 spot.boss_dialog:
            game.combat_boss_dialog()

        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.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:
                game.combat_retreat()
                self.spot_no = 0
                return self.end

            if self.should_retreat():
                game.combat_retreat()
                self.spot_no = 0
                return self.end

            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

        else:
            req_next = game.combat_map_next()
            self.spot_no = req_next.body["api_no"]
            return self.spot_dispatcher
Exemplo n.º 4
0
    def start(self):
        while True:
            request = api_server.wait(("/kcsapi/api_req_map/next",
                                       "/kcsapi/api_req_map/start",
                                       "/kcsapi/api_port/port"))
            if request.path == "/kcsapi/api_port/port":
                if battle.port_has_damaged_ship(request):
                    self.fleet_status = battle.BattleResult.Ship_Damaged
                else:
                    self.fleet_status = battle.BattleResult.Safe
                return self.start

            if request.path == "/kcsapi/api_req_map/start":
                if request.body['api_maparea_id'] != self.map_area or \
                   request.body['api_mapinfo_no'] != self.map_no or \
                   self.fleet_status != battle.BattleResult.Safe:
                    return None
                else:
                    self.spot_no = request.body["api_no"]
                    game.combat_map_loading()
                    return self.spot_dispatcher

            if request.path == "/kcsapi/api_req_map/next":
                if request.body['api_maparea_id'] != self.map_area or \
                   request.body['api_mapinfo_no'] != self.map_no:
                    return None
                else:
                    self.spot_no = request.body["api_no"]
                    return self.spot_dispatcher
Exemplo n.º 5
0
def test_battle_analyze():
    # Assure current fleet is not combined.
    while True:
        request = api_server.wait([
            '/kcsapi/api_req_sortie/battle',
            '/kcsapi/api_req_sortie/airbattle',
            '/kcsapi/api_req_battle_midnight/battle',
            '/kcsapi/api_req_battle_midnight/sp_midnight',
            '/kcsapi/api_req_sortie/ld_airbattle'
        ])
        battle.battle_analyze(request, 0, True)
Exemplo n.º 6
0
    def start(self):
        request = api_server.wait("/kcsapi/api_port/port")
        self.decks = request.body["api_deck_port"]
        for deck in self.decks:
            i = deck["api_id"] - 2
            if i < 0:
                continue
            mission = deck["api_mission"]
            if mission[0] in (1, 2) and mission[1] > 0:
                self.exp_no[i] = mission[1]

        print("Expedition:", self.exp_no)
        utils.random_sleep(1)
        return self.port
Exemplo n.º 7
0
def help_5_4():
    while True:
        request = api_server.wait(
            ("/kcsapi/api_req_map/next", "/kcsapi/api_req_map/start"))

        # HS: c1d c7 12d c18 19d
        # SS: c2 4d 6n 9 c10d 15d

        if request.body["api_no"] in (1, ):
            game.combat_map_loading()
            game.combat_compass()
            game.combat_map_moving()
            game.combat_formation_line()
            game.combat_move_to_button_left()
            game.combat_result()
            game.combat_move_to_button_left()

        if request.body["api_no"] in (2, ):
            game.combat_map_loading()
            game.combat_compass()

        if request.body["api_no"] in (7, 18):
            utils.random_sleep(2)
            game.combat_compass()

        if request.body["api_no"] in (10, ):
            game.combat_compass()
            game.combat_map_moving()
            game.combat_formation_line()
            game.combat_move_to_button_left()
            game.combat_result()
            game.combat_move_to_button_left()

        if request.body["api_no"] in (4, 6, 10, 12, 15, 19):
            game.combat_map_moving()
            game.combat_formation_line()
            game.combat_move_to_button_left()
            game.combat_result()
            game.combat_move_to_button_left()