Ejemplo n.º 1
0
def initil():
	cancel_selection()
	time.sleep(0.6)
	# 选择两星的角色
	humanbeing_click(lt_gl.star2X, lt_gl.star2Y)
	dc.auto_hide(True)
	dc.sleep(0.4)
	back()
Ejemplo n.º 2
0
def improve_click():
    for improve_click_count in xrange(4):  # 4 times
        dc.sleep(0.6)
        dc.humanbeing_click(lt_a2c.impression_classX, lt_a2c.impression_classY)
        dc.sleep(0.3)
        # 点击红色的确认按键
        dc.humanbeing_click(lt_a2c.improve_impression_confirmX,
                            lt_a2c.improve_impression_confirmY)
        dc.sleep(0.2)
        dc.back()
    dc.sleeptime(1)
    # 点击最后一个S class 按键,由于这个位置不确定,使用图像匹配的方法来确认位置
    # 图像匹配 S class
    ims.image_match(image.s_class, 0.8)
    dc.humanbeing_click_point(ims.point(zoom=0.2, x_add=0, y_add=-58))
    dc.sleep(0.5)
    # 点击红色的确认按键
    dc.humanbeing_click(lt_a2c.improve_impression_confirmX,
                        lt_a2c.improve_impression_confirmY)

    ims.whileset(image.improve_finish, 4.5, 4.6, threshold=0.7)
    dc.humanbeing_click_point(ims.point(zoom=0))
    dc.back()
    dc.sleep(0.3)
    # 获取奖励
    dc.humanbeing_click(lt_a2c.rewardX, lt_a2c.rewardY)
    dc.sleep(0.2)

    # 返回天子选择界面
    # 方法一,一步步图像匹配然后返回
    ims.backtopage(image.flag_selcte_interface, a=0.5, b=0.6)
Ejemplo n.º 3
0
def team_conf(vacancy):
	"""
	配置队伍,更换满级的角色
	vacancy(Int): 1-5 从右到左替换几位child
	return:
	"""
	global count
	humanbeing_click(lt.fselectX,lt.fselectY)
	# 第一次战斗前需要修改角色筛选配置
	if count == 1:
		initil()
	count+=1
	time.sleep(1)
	flag1 = image.flag_selcte_interface
	flag_res = ims.image_match(flag1)
	if flag_res[0]==1: # 重复角色
		repeat = image.repeat
		screenswipe((602, 742), (561, 654), (94, 237), (561, 654))  # swipe screen
		time.sleep(1.5)
		
		# loop add child
		for i in xrange(vacancy):
			# check_level()
			# 判断后续是否还有角色
			next_chara_cropped = ims.capture_adb()
			next_chara_cropped = next_chara_cropped[
								 lt_gl.cropped_rightsideY[0]:
								 lt_gl.cropped_rightsideY[1],
								 lt_gl.cropped_rightsideX[0]:
								 lt_gl.cropped_rightsideX[1]
								 ]
			res = ims.image_match(image.none_charater, threshold=0.8,
								  screen_image=next_chara_cropped)
			if res[0] == 1:  # 右边没有角色
				print " All charater improved"
				sys.exit(0)
				
			good = False
			while not good:
				humanbeing_click(lt.join_teamX,lt.join_teamY)
				time.sleep(0.6)
				repeat_res = ims.image_match(repeat, threshold=0.6)
				if repeat_res[0] == 1:  # 出现重复角色的问题
					# click back button
					back()
					# humanbeing_click(lt.confirm_backX, lt.confirm_backY)
					# time.sleep(0.2)
					# click RIGHTSIDE child
					humanbeing_click(lt_gl.leftsideX, lt_gl.leftsideY)
					time.sleep(0.2)
				else:
					print repeat_res[1]
					good =True
			# 将选择好的天子放到队伍中
			# 点击上面的位置
			one_position = lt.position[i]
			humanbeing_click(one_position[0], one_position[1],  a=0.1, b =0.2)
			time.sleep(0.1)
		back(a=0.2, b=0.3)
Ejemplo n.º 4
0
def initil():
    dc.cancel_selection()
    dc.sleep(1)
    # 选择一星和两星的角色 # TODO 还要取消自动隐藏选项
    dc.humanbeing_click(lt_gl.star1X, lt_gl.star1Y)
    dc.humanbeing_click(lt_gl.star2X, lt_gl.star2Y)
    dc.auto_hide(False)
    dc.back()
    dc.sleep(0.5)
    dc.screenswipe(
        (113, 253),
        (498, 650),
        (600, 740),
        (503, 640),
    )  # swipe screen
Ejemplo n.º 5
0
def next_chara():
    """向右点击,获取下一位child"""
    # 将屏幕中角色选择区域右侧截取
    next_chara_cropped = ims.capture_adb()
    next_chara_cropped = next_chara_cropped[
        lt_gl.cropped_rightsideY[0]:lt_gl.cropped_rightsideY[1],
        lt_gl.cropped_rightsideX[0]:lt_gl.cropped_rightsideX[1]]
    res = ims.image_match(image.none_charater,
                          threshold=0.6,
                          screen_image=next_chara_cropped)
    if res[0] == 1:  # 右边没有角色
        print " All charater improved"
        sys.exit(0)
    else:
        # print res[1]
        # 向右点击,获取下一位child
        dc.humanbeing_click(lt_gl.rightsideX, lt_gl.rightsideY, a=0, b=0.1)
Ejemplo n.º 6
0
def buy_ticket(point):
	"""
	auto buy tickets while there is showing no ticket
	point(Object) such as: ims.point(zoom=0) 那个红色的X按键
	"""
	dc.sleep(2)
	res = ims.image_match(imageraid.no_ticket)
	if res[0] ==1:
		dc.back()
		# button of buy tickets
		dc.humanbeing_click(lt_raid.buy_ticket_buttonX, lt_raid.buy_ticket_buttonY, a=0.6, b =1.2)
		# The comfirm button of buy tickets
		dc.sleep(0.5)
		dc.humanbeing_click(lt_raid.buy_ticketX, lt_raid.buy_ticketY)
		print "<<Buying Tickets!>>"
		dc.back(1,2)
		# need click battle button after buy tickets
		dc.humanbeing_click_point(point)
Ejemplo n.º 7
0
def start():
	"""
	从战斗配置主界面开始,进行连续战斗
	"""
	time.sleep(1)
	# 配置自动战斗系统
	# 选择自动战斗的方式,我们选择重新开始(分别有暂停、下一场、重新开始)
	humanbeing_click(lt.battle_styleX, lt.battle_styleY)
	time.sleep(0.3)
	humanbeing_click(lt.loopX,lt.loopY)
	back()
	sleeptime(0.2, 0.51)
	# 匹配开始按键 如果必要,匹配loading(转圈圈那个图案)
	start_button = image.start_button
	res = ims.image_match(start_button)[0]
	if res == 1:
		sleeptime(0.3, 0.7)
		humanbeing_click_point(ims.point(0.1))
Ejemplo n.º 8
0
def filter_sort():
	"""排序设置"""
	# 排序设置
	# 点击过滤按键
	dc.humanbeing_click(lt_raid.raid_filterX, lt_raid.raid_refreshY, 0.3)
	# 点击 未参加
	dc.humanbeing_click(lt_raid.raid_23X, lt_raid.raid_23Y, 0.5)
	# 点击 按 HP 排序
	dc.humanbeing_click(lt_raid.raid_12X, lt_raid.raid_12Y, 0.8)
	# 点击确认键以返回
	dc.humanbeing_click(lt_raid.filter_OKX, lt_raid.filter_OKY, 0.8)
Ejemplo n.º 9
0
def mian():
    os.chdir("../adb")
    # c从主界面开始
    cv2value1, cv2real_value = image_match(pf.mian_flags, 0.8)
    if 1 not in cv2value1:
        print u"请从主界面开始"
        exit()
    # 点击夜世界
    humanbeing_click(lt.nightwordX, lt.nightwordY)
    time.sleep(2)
    humanbeing_click(lt.menu_springX, lt.menu_springY)
    time.sleep(3)
    judgment_value, match_value = image_match(
        u"G:/MoveOn/boomboost/image/spring/flag1.png", 0.7)
    if judgment_value == 1:
        print "0001 judgment_value:{} match_value:{}".format(
            judgment_value, match_value)
        for i in lt.spring_house:
            replace_towels(i[0], i[0])
    else:
        print "\npostion1 not matched!"
Ejemplo n.º 10
0
def get_money():
    dc.humanbeing_click(lt_a2c.open_attributeX, lt_a2c.open_attributeY)
    dc.sleep(1)
    # 点击进入好感度提升界面
    res = ims.image_match(image.improve_impression, 0.9)
    dc.humanbeing_click_point(ims.point(0.5))
    dc.sleep(0.6)
    # 检查好感进度条,留下为0的
    cropped = ims.capture_adb()
    cropped = cropped[lt_a2c.croppedY[0]:lt_a2c.croppedY[1],
                      lt_a2c.croppedX[0]:lt_a2c.croppedX[1]]
    res = ims.image_match(image.check_impression,
                          threshold=0.86,
                          screen_image=cropped)
    if res[0] == 1:  # 0 好感的
        improve_click()
    else:  # 有好感了,返回
        # log.debug("已经存在好感度! 返回")
        ims.backtopage(image.flag_selcte_interface)

        dc.sleep(0.7)
        next_chara()
        get_money()
Ejemplo n.º 11
0
def refresh():
	"""点击右侧刷新按键"""
	dc.sleeptime(5,6)
	dc.humanbeing_click(lt_raid.raid_refreshX, lt_raid.raid_refreshY)
Ejemplo n.º 12
0
def replace_towels(housex, housey):
    # 点击温泉是哪一楼
    # humanbeing_click(lt_sp.spring2fX, lt_sp.spring2fY) # 点击浴场的位置
    time.sleep(3)
    humanbeing_click(housex, housey)  # 点击浴场的位置
    time.sleep(5)
    # 进入泡温泉界面
    humanbeing_click(lt.enter_hotspringX, lt.enter_hotspringY)
    time.sleep(8)
    judgment_value, match_value = image_match(
        u"G:/MoveOn/boomboost/image/spring/flag2.png", 0.8)
    if judgment_value == 1:  # 有感叹号,可以进行收获!
        print "0002 judgment_value:{} match_value:{}".format(
            judgment_value, match_value)
        print "!"
        # click ! 点击右上角的感叹号
        humanbeing_click(lt.end_spaX, lt.end_spaY)
        # 加速点击
        humanbeing_click(lt.spring_skipX, lt.spring_skipY, a=0.5, b=0.7)
        time.sleep(4)

        two_condition = [
            u"G:/MoveOn/boomboost/image/spring/change_towel.png",
            u"G:/MoveOn/boomboost/image/spring/levelup.png",
        ]
        for i in [0, 1, 2, 3, 4]:  # 循环五次
            res, real_res = image_match(two_condition, 0.8)
            time.sleep(2)
            # 加速点击
            humanbeing_click(lt.spring_skipX, lt.spring_skipY, a=0.5, b=0.7)
            if res[0] == 1:  # not levelup
                humanbeing_click(lt.change_towelX, lt.change_towelY)
            elif res[1] == 1:  # leveluped
                os.system("adb shell input keyevent 4")  # back tap
                time.sleep(5)
                humanbeing_click(lt.change_towelX, lt.change_towelY)
            else:
                print u"0005 有问题,温泉"
            time.sleep(8)

            # re1,re2 = image_match(ur"G:\MoveOn\boomboost\image\spring\after_spa.png",0.85)
            humanbeing_click(lt.after_spaX, lt.after_spaY)
            time.sleep(1)
            back()
            time.sleep(5)

    else:
        print "no !"
        back()  # 没有感叹号,返回房子那里
        time.sleep(5)
Ejemplo n.º 13
0
def ug():
	# 进入 night world
	dc.humanbeing_click(lt_gl.nightworldX, lt_gl.nightworldY)
	ims.whileset(image.ug)
	dc.humanbeing_click_point(ims.point(zoom=0.1))