async def load_one_task(tasks, user_task): if user_task['name'] == 'Silver' and user_task['status']: task = Silver().run() tasks.append({"name": "Silver", "task": task}) asyncio.create_task(task, name="Silver") # tasks.append(Silver().run()) # 领取银瓜子 elif user_task['name'] == 'EverydayTask' and user_task['status']: task = Tasks().run() tasks.append({"name": "EverydayTask", "task": task}) asyncio.create_task(task, name="Tasks") # tasks.append(Tasks().run()) # 获取每日包裹奖励,签到功能,领取每日任务奖励,应援团签到,过期礼物处理,银瓜子兑换硬币,硬币换瓜子,将当前佩戴的勋章亲密度送满, elif user_task['name'] == 'LotteryResult' and user_task['status']: task = LotteryResult().query() tasks.append({"name": "LotteryResult", "task": task}) asyncio.create_task(task, name="LotteryResult") # tasks.append(LotteryResult().query())# 广播抽奖检测 elif user_task['name'] == 'connect' and user_task['status']: task = connect().create() tasks.append({"name": "connect", "task": task}) asyncio.create_task(task, name="connect") # tasks.append(connect().create()) # 新的战疫分区直播间实际上没有弹幕区??? elif user_task['name'] == 'PKLottery' and user_task['status']: task = PKLottery().run() tasks.append({"name": "PKLottery", "task": task}) asyncio.create_task(task, name="PKLottery") # tasks.append(PKLottery().run()) # 大乱斗抽奖? elif user_task['name'] == 'GuardLottery' and user_task['status']: task = GuardLottery().run() tasks.append({"name": "GuardLottery", "task": task}) asyncio.create_task(task, name="GuardLottery") # tasks.append('GuardLottery') # tasks.append(GuardLottery().run()) # 上船奖励? else: pass
from bilibili import bilibili cf = ConfigLoader("color.conf", "user.conf", "bilibili.conf") printer = Printer(cf) bilibili = bilibili(cf) login = Login(bilibili) login.success() bilibili = login.return_bilibili() api = API(bilibili) api.user_info() api.get_bag_list() task = OnlineHeart(bilibili) task1 = Silver(bilibili) task2 = Tasks(bilibili) task3 = LotteryResult(bilibili) task4 = connect(printer, bilibili, api) tasks = [ task.run(), task1.run(), task2.run(), task4.connect(), task3.query() ] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks)) loop.close()
from OnlineHeart import OnlineHeart from Silver import Silver from LotteryResult import LotteryResult from Tasks import Tasks from login import Login from connect import connect import asyncio from API import API login = Login().success() API.user_info() API.get_bag_list() task = OnlineHeart() task1 = Silver() task2 = Tasks() task3 = LotteryResult() task4 = connect() tasks = [ task.run(), task1.run(), task2.run(), task4.connect(), task3.query() ] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks)) loop.close()
import threading import biliconsole # print('Hello world.') printer = Printer() bilibili() Statistics() utils.fetch_user_info() utils.fetch_bag_list() utils.fetch_medal() task = OnlineHeart() task1 = Silver() task2 = Tasks() task3 = LotteryResult() task4 = connect() console_thread = threading.Thread(target=biliconsole.controler) console_thread.start() loop = asyncio.get_event_loop() tasks = [ task.run(), task1.run(), task2.run(), task4.connect(), task3.query(), printer.clean_printlist() ]
from connect import connect import asyncio from API import API from configloader import ConfigLoader from printer import Printer from bilibili import bilibili cf = ConfigLoader("color.conf", "user.conf", "bilibili.conf") printer = Printer(cf) bilibili = bilibili(cf) login = Login(bilibili, cf) login.success() bilibili = login.return_bilibili() api = API(bilibili) api.user_info() api.get_bag_list() task = OnlineHeart(bilibili) task1 = Silver(bilibili) task2 = Tasks(bilibili) task3 = LotteryResult(bilibili) task4 = connect(printer, bilibili, api) tasks = [task.run(), task1.run(), task2.run(), task4.connect(), task3.query()] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks)) loop.close()
fileDir = os.path.dirname(os.path.realpath('__file__')) file_user = fileDir + "/conf/user.conf" dic_user = configloader.load_user(file_user) loop = asyncio.get_event_loop() printer = Printer(dic_user['thoroughly_log']['on']) bilibili() Statistics() rafflehandler = Rafflehandler() biliconsole.Biliconsole() task = OnlineHeart() # 在线心跳 task1 = Silver() # 领取银瓜子 task2 = Tasks( ) # 获取每日包裹奖励,签到功能,领取每日任务奖励,应援团签到,过期礼物处理,银瓜子兑换硬币,硬币换瓜子,将当前佩戴的勋章亲密度送满, task3 = LotteryResult() # 广播抽奖检测 task4 = connect() # 新的战疫分区直播间实际上没有弹幕区??? task5 = PKLottery() # 大乱斗抽奖? task6 = GuardLottery() # 上船奖励? tasks1 = [login().login_new()] loop.run_until_complete(asyncio.wait(tasks1)) # 任务 # import threading # console_thread = threading.Thread(target=biliconsole.controler) # console_thread.start() tasks = [ task.run(), task1.run(),