Beispiel #1
0
 def noTip():
     util.logOut(
         __file__,
         'findPicLoop 循环找图开始 ' + const.publicPath() + 'bmp/anchor.bmp')
     util.logOut(
         __file__,
         'findPicLoop 循环找图开始 ' + const.publicPath() + 'bmp/quit.jpg')
     for i in range(600):
         x, y = util.findPic(const.publicPath() + 'bmp/anchor.bmp',
                             threshold=0.8,
                             size=(0, 0, 0, 0))
         if x != -1 and y != -1:
             util.logOut(
                 __file__, 'findPicLoop 循环找图结束 ' + const.publicPath() +
                 'bmp/anchor.bmp')
             return
         x, y = util.findPic(const.publicPath() + 'bmp/quit.jpg',
                             threshold=0.8,
                             size=(0, 0, 0, 0))
         if x != -1 and y != -1:
             util.logOut(
                 __file__, 'findPicLoop 循环找图结束 ' + const.publicPath() +
                 'bmp/quit.jpg')
             util.click(x, y)
             util.logOut(__file__, '今日不再提示')
             return
     util.logOut(__file__, 'picLoop没找到图 需要重启脚本!!!!!!')
     const.restartProcess()
     raise ValueError('restart')
Beispiel #2
0
 def aOrB():
     util.logOut(__file__,
                 'findPicLoop 循环找图开始 ' + const.publicPath() + 'bmp/OK.jpg')
     util.logOut(
         __file__,
         'findPicLoop 循环找图开始 ' + const.publicPath() + 'bmp/leave.jpg')
     for i in range(600):
         x, y = util.findPic(const.publicPath() + 'bmp/OK.jpg',
                             threshold=0.8,
                             size=(0, 0, 0, 0))
         if x != -1 and y != -1:
             util.logOut(
                 __file__,
                 'findPicLoop 循环找图结束 ' + const.publicPath() + 'bmp/OK.jpg')
             util.click(x, y)
             beaconProcess()
             x, y = const.picLoop(const.publicPath() + 'bmp/leave.jpg')
             util.click(x, y)
             x, y = const.picLoop(const.publicPath() + 'bmp/zilv.jpg')
             time.sleep(4)
             util.click(x, y)
             aOrB()
             return
         x, y = util.findPic(const.publicPath() + 'bmp/leave.jpg',
                             threshold=0.8,
                             size=(0, 0, 0, 0))
         if x != -1 and y != -1:
             util.logOut(
                 __file__, 'findPicLoop 循环找图结束 ' + const.publicPath() +
                 'bmp/leave.jpg')
             util.click(x, y)
             x, y = const.picLoop(path + 'exit.jpg')
             util.click(x, y)
             x, y = const.picLoop(const.publicPath() + 'bmp/OK.jpg')
             util.click(x, y)
             time.sleep(2)
             util.click(433, 462)
             return
     util.logOut(__file__, 'picLoop没找到图 需要重启脚本!!!!!!')
     const.restartProcess()
     raise ValueError('restart')
Beispiel #3
0
        def noTipAgain():
            util.logOut(__file__,'findPicLoop 循环找图开始 '+const.publicPath() + 'bmp/again.jpg')
            util.logOut(__file__,'findPicLoop 循环找图开始 '+const.publicPath() + 'bmp/zhengli.jpg')
            for i in range(600):
                x, y = util.findPic(const.publicPath() + 'bmp/again.jpg', threshold=0.8, size=(0, 0, 0, 0))
                if x != -1 and y != -1:
                    util.logOut(__file__,'findPicLoop 循环找图结束 '+const.publicPath() + 'bmp/again.jpg')
                    util.logOut(__file__,'活动图结束-------------------------')
                    x,y = const.picLoop(const.publicPath() + 'bmp/leave.jpg')
                    util.click(x,y)
                    return
                x, y = util.findPic(const.publicPath() + 'bmp/zhengli.jpg', threshold=0.8, size=(0, 0, 0, 0))
                if x != -1 and y != -1:
                    util.logOut(__file__,'findPicLoop 循环找图结束 '+const.publicPath() + 'bmp/zhengli.jpg')
                    util.logOut(__file__,'船坞已满')
                    time.sleep(2)
                    util.click(x,y)
                    const.retireProcess()
                    time.sleep(4.000)
                    x,y = const.picLoop(const.publicPath() + 'bmp/zilv.jpg')
                    util.click(x,y)
                #红脸特殊(屑)
                if redFace and util.isFindPic(const.publicPath() + 'bmp/OK.jpg'):
                    util.logOut(__file__,'红脸判断 开始')
                    list = util.getWords((237, 201 , 627, 263))
                    isRedFace = False
                    if len(list) != 0:
                        for m in list:
                            if '低心情' in list[m]:
                                isRedFace = True
                                break
                    if len(list) != 0 and isRedFace:
                        util.logOut(__file__,'我是粪提 结束')
                        x, y = const.picLoop(const.publicPath() + 'bmp/OK.jpg')
                        util.click(x, y)

            util.logOut(__file__,'picLoop没找到图 需要重启脚本!!!!!!')
            const.restartProcess()
            raise ValueError('restart')