예제 #1
0
 def swipe(self, org: (int, int), tar: (int, int), delay, sfts: (int, int) = (10, 10)):
     original = (org[0] + self.shifts[0], org[1] + self.shifts[1])
     target = (tar[0] + self.shifts[0], tar[1] + self.shifts[1])
     util.swipe(
         util.shifter(original, sfts[0], sfts[1]),
         util.shifter(target, sfts[0], sfts[1]),
         delay)
예제 #2
0
 def advance_support(self, spt: str = None, tms: int = 3):
     if spt is None:
         spt = self.support
     flag1 = True
     flag2 = True
     while flag1:
         spt_pos = util.standby(spt)
         if spt_pos == False:
             print("[INFO] Friend not found")
             if flag2:
                 bar_pos = util.standby("images/bar.png")
                 if bar_pos == False:
                     if self.debug:
                         print("no bar")
                     self.update_support()
                 else:
                     if self.debug:
                         print("have bar")
                     flag2 = False
                     end_pos = util.standby("images/friendEnd.png")
                     end_pos = end_pos[:1]
                     if end_pos == False:
                         print("[INFO] End of friend list")
                         self.update_support()
                         flag2 = True
                     else:
                         gap_pos, gap_h, gap_w = util.standby(
                             "images/friend_gap.png", 0.8, True)
                         util.swipe(
                             gap_pos[0]+(gap_w/2), gap_pos[1]+(gap_h/2), gap_pos[0]+(gap_w/2), 210, 1.5)
             else:
                 end_pos = util.standby("images/friendEnd.png")
                 if end_pos[0] != False:
                     print("[INFO] End of friend list")
                     self.update_support()
                     flag2 = True
                 else:
                     if self.debug:
                         print("swipe down")
                     gap_pos, gap_h, gap_w = util.standby(
                         "images/friend_gap.png", 0.8, True)
                     util.swipe(
                         gap_pos[0]+(gap_w/2), gap_pos[1]+(gap_h/2), gap_pos[0]+(gap_w/2), 210, 1.5)
         else:
             flag1 = False
             spt_center = [int(spt_pos[0][0]+5),
                           int(spt_pos[0][1]+5)]
             util.list_tap(spt_center)