def xia_yi_pai(pai, handle): m = Mouse() m.mouse_to(handle.left + 600, handle.top + 200) time.sleep(0.2) # 滚轮滚2为一排 m.gun_lun(-2 * pai, 0) time.sleep(0.2)
def tuo(self, src_x, src_y, tar_x, tar_y): m = Mouse(self.metrics_x, self.metrics_y) dx = tar_x - src_x dy = tar_y - src_y x = src_x y = src_y m.mouse_to(x, y) # 鼠标移动到 m.left_down() i = 1 ddy = int(dy / 10) while i < 10: time.sleep(0.03) m.mouse_to(x, y + ddy * i) # 鼠标移动到 i += 1 i = 1 ddx = int(dx / 10) while i < 10: time.sleep(0.05) m.mouse_to(x + ddx * i, tar_y) # 鼠标移动到 i += 1 time.sleep(0.1) m.mouse_to(tar_x + 3, tar_y) # 鼠标移动到 time.sleep(0.3) m.left_up() time.sleep(1) Window.temp_jie_tu(self.handle) # 更新截图 return
def main1(): print("开始") tMouse = Mouse() time.sleep(3) while 1: print("grab") re = lianjie() if re == 0: print("find") print("当前时间戳为:") print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) tMouse.mouse_to(1920 - 200, 10) tMouse.click(1920 - 200, 10) break time.sleep(10 * 60) print("end")
def tuo(self, src_x, src_y, tar_x, tar_y): m = Mouse(self.metrics_x, self.metrics_y) dx = tar_x - src_x dy = tar_y - src_y x = src_x y = src_y m.mouse_to(x, y) # 鼠标移动到 m.left_down() i = 1 ddy = int(dy / 10) ddx = int(dx / 10) while i < 10: time.sleep(0.03) m.mouse_to(x + ddx * i, y + ddy * i) # 鼠标移动到 i += 1 time.sleep(0.02) m.mouse_to(tar_x, tar_y) # 鼠标移动到 time.sleep(0.1) m.left_up() time.sleep(1) return