def supply_first_ship(): print("supply_first_ship") point = random_point(Point(175, 150), Point(300, 180)) point.click() random_sleep(0.8) point = random_point(Point(660, 430), Point(748, 455)) point.click() wait("/kcsapi/api_req_hokyu/charge") random_sleep(1) # 动画时间
def sortie_confirm(): print("sortie_confirm") point = random_point(Point(593, 466), Point(768, 490)) point.click() random_sleep(1.6) point = random_point(Point(534, 466), Point(694, 490)) point.click() request = wait("/kcsapi/api_req_map/start") random_sleep(1) # 动画时间 return request
def dock_back_to_port(): print("dock_back_to_port") point = random_point(Point(30, 35), Point(75, 70)) point.click() request = wait("/kcsapi/api_port/port") random_sleep(1) return request
def port_open_panel_sortie(): random_sleep(2.1) port_open_main_sortie() point = random_point(Point(144, 175), Point(313, 335)) point.click() wait("/kcsapi/api_get_member/mapinfo") random_sleep(2.5) # 动画时间
def factory_destroy_do_destory(): print("factory_destroy_do_destory") point = random_point(Point(641, 420), Point(743, 452)) point.click() random_sleep(4) wait(("/kcsapi/api_req_kousyou/destroyship", "/kcsapi/api_req_kousyou/destroyitem2"))
def port_open_panel_sortie(): print("port_open_panel_sortie") point = random_point(Point(161, 211), Point(238, 298)) point.click() random_sleep(1) point.click() wait("/kcsapi/api_get_member/mapinfo") random_sleep(1.2) # 动画时间
def sortie_confirm(): print("sortie_confirm") point = random_point(Point(638, 450-22), Point(712, 481-22)) point.click() random_sleep(0.6) point.click() request = wait("/kcsapi/api_req_map/start") random_sleep(1) # 动画时间 return request
def port_expedition_back(): print("port_expedition_back") point = random_point(Point(500, 320), Point(750, 420)) point.click() request = wait("/kcsapi/api_port/port") wait("/kcsapi/api_get_member/useitem") random_sleep(9) point.click() random_sleep(1) point.click() random_sleep(2) return request
def combat_boss_dialog(): print("combat_boss_dialog") request = wait([ '/kcsapi/api_req_sortie/battle', '/kcsapi/api_req_sortie/airbattle', '/kcsapi/api_req_battle_midnight/sp_midnight', '/kcsapi/api_req_combined_battle/battle', '/kcsapi/api_req_combined_battle/battle_water', '/kcsapi/api_req_combined_battle/airbattle', '/kcsapi/api_req_combined_battle/sp_midnight', '/kcsapi/api_req_practice/battle', ], keep=True) point = random_point(Point(500, 320), Point(750, 420)) random_sleep(4) point.click() return request
def combat_result(): print("combat_result") request = wait(['/kcsapi/api_req_sortie/battleresult', '/kcsapi/api_req_combined_battle/battleresult', '/kcsapi/api_req_practice/battle_result']) point = random_point(Point(500, 320), Point(750, 420)) random_sleep(7.6) point.click() if "api_get_ship_exp" in request.body: random_sleep(5.3) point.click() if "api_get_ship_exp_combined" in request.body: random_sleep(6.6) point.click() if "api_get_useitem" in request.body: random_sleep(7.6) # 获得物品 point.click() if "api_get_ship" in request.body: random_sleep(7.6) # 获得舰船 point.click() random_sleep(1) return request
def combat_move_to_button_right(): point = random_point(Point(473, 238-22), Point(551, 289-22)) point.moveTo()
def combat_move_to_button_left(): point = random_point(Point(257, 247-22), Point(327, 289-22)) point.moveTo()
def combat_button_right(): point = random_point(Point(473, 238-22), Point(551, 289-22)) point.click()
def combat_button_left(): point = random_point(Point(257, 247-22), Point(327, 289-22)) point.click()
def sortie_select_area_4(): point = random_point(Point(355, 425), Point(390, 448)) point.click()
def port_open_panel_organize(): print("port_open_panel_supply") point = random_point(Point(175, 115), Point(215, 155)) point.click() random_sleep(1.2)
def combat_formation_diamond(): print("combat_formation_diamond") point = random_point(Point(667, 200-22), Point(755, 216-22)) point.click()
def sortie_select_map_3(): point = random_point(Point(138, 311-22), Point(425, 423-22)) point.click()
def sortie_select_map_5(): point = random_point(Point(682, 236-22), Point(777, 290-22)) point.click() random_sleep(1) point.click()
def combat_formation_line(): print("combat_formation_line") point = random_point(Point(403, 200-22), Point(492, 216-22)) point.click()
def combat_compass(): print("combat_compass") random_sleep(1.6) point = random_point(Point(500, 400-22), Point(750, 450-22)) point.click() random_sleep(4.2) # 动画时间
def sortie_select_area_2(): point = random_point(Point(215, 425), Point(250, 458)) point.click()
def sortie_select_area_5(): point = random_point(Point(435, 425), Point(468, 448)) point.click()
def sortie_select_map_2(): point = random_point(Point(464, 163-22), Point(659, 282-22)) point.click()
def port_open_panel_supply(): print("port_open_panel_supply") point = random_point(Point(48, 211-22), Point(102, 274-22)) point.click() random_sleep(1.2)
def combat_button_retreat_flagship_damaged(): point = random_point(Point(535, 220), Point(605, 260)) point.click()
def combat_formation_double(): print("combat_formation_double") point = random_point(Point(538, 200-22), Point(616, 216-22)) point.click()
def sortie_select_area_3(): point = random_point(Point(280, 447-22), Point(336, 480-22)) point.click()
import math from PIL import Image from utils import Point, random_point # Setting TIMES = 3000 IMAGE_SIZE = 500 # Produce point count prob = [[0 for x in range(IMAGE_SIZE)] for y in range(IMAGE_SIZE)] p1 = Point(0, 0) p2 = Point(IMAGE_SIZE, IMAGE_SIZE) for i in range(TIMES): p = random_point(p1, p2) x = math.floor(p.x) y = math.floor(p.y) prob[x][y] += 1 # Normalization of point probability max_c = 0 for x in range(IMAGE_SIZE): for y in range(IMAGE_SIZE): if prob[x][y] > max_c: max_c = prob[x][y] for x in range(IMAGE_SIZE): for y in range(IMAGE_SIZE): prob[x][y] = prob[x][y] / max_c
def combat_formation_abreast(): print("combat_formation_abreast") point = random_point(Point(607, 355-22), Point(685, 374-22)) point.click()