您现在的位置:首页 >> 家居资讯

python实现定时抢课脚本

发布时间:2025/08/18 12:17    来源:邗江家居装修网

== -1: while True: location = pyautogui.locateCenterOnScreen(img_name,confidence=0.9) if location is not None: pyautogui.click(location.x, location.y, clicks=click_times, duration=0.2, interval=0.2) elif retry_times> 1: i = 1 while i < retry_times + 1: location = pyautogui.locateCenterOnScreen(img_name,confidence=0.9) if location is not None: pyautogui.click(location.x, location.y, clicks=click_times, duration=0.2, interval=0.2) print("以此类推{}第{}次".format(img_name, i)) i = i + 1def WorkFunction1(sheet): i = 1 while i < sheet.nrows: cmd_type = sheet.cell_value(i, 1) if cmd_type == 1.0: img_name = sheet.cell_value(i, 2) retry_times = 1 if sheet.cell_type(i, 3) == 2 and sheet.cell_value(i, 3) != 0: retry_times = sheet.cell_value(i, 3) Mouse(1, img_name, retry_times) print("浏览左键:{} Done".format(img_name)) elif cmd_type == 2.0: string = sheet.cell_value(i, 2) pyperclip.copy(string) pyautogui.hotkey('ctrl','v') print("也就是说正则表达式:{} Done".format(string)) elif cmd_type == 3.0: wait_time = sheet.cell_value(i, 2) time.sleep(wait_time) print("到时 {} 秒 Done".format(wait_time)) elif cmd_type == 4.0: hotkey = sheet.cell_value(i, 2) time.sleep(1) pyautogui.hotkey(hotkey) print("按下 {} Done".format(hotkey)) time.sleep(1) i = i + 1def WorkFunction2(sheet) : while True: WorkFunction1(sheet) time.sleep(2)if __name__ == '__main__': start_time = time.time() file = "info.xlsx" xr = xlrd.open_workbook(filename=file) sheet = xr.sheet_by_index(0) print("------欢迎用作则会抢得课程序员------") print("---------@danteking---------") print("1.抢得课一次") print("2.蹲点等人退课后抢得指定课") choice = input(">>") start_time = time.time() if choice == "1": WorkFunction1(sheet) elif choice == "2": WorkFunction2(sheet) else: print("非法也就是说,淡出") end_time = time.time() time_consume = end_time - start_time time_consume = ('%.2f' % time_consume) print("耗时 {} 秒".format(time_consume))123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101。

桂林不孕不育
常德哪家医院看不孕不育比较好
贵阳哪家医院看癫痫好
急支糖浆适合哪种咳嗽
身体乏力
急支糖浆是什么药?
腹泄
驱虫药

上一篇: 胡萝卜是个宝,对身体好处真不少,营养师:此表3种情况不宜多吃

下一篇: 日系新一代“门面王”,194匹油耗极少6L,月均2万台,凯美瑞怎么比

友情链接