示例#1
0
文件: run.py 项目: k471559444/bili2.0
area_ids = dict_user['other_control']['area_ids']

users = []
task_control = dict_user['task_control']
for i, user_info in enumerate(dict_user['users']):
    users.append(User(i, user_info, task_control, dict_bili))

notifier.set_values(loop)
notifier.set_users(users)
bili_statistics.init_area_num(len(area_ids))

loop.run_until_complete(notifier.exec_func(-2, LoginTask.handle_login_status))

# users[1].fall_in_jail()

console_thread = threading.Thread(target=Biliconsole(loop).cmdloop)
console_thread.start()

danmu_tasks = [connect.RaffleConnect(i).run() for i in area_ids]

yj_danmu_roomid = dict_user['other_control']['raffle_minitor_roomid']
danmu_tasks.append(connect.YjConnection(yj_danmu_roomid).run())

default_monitor_roomid = dict_user['other_control']['default_monitor_roomid']
connect.init_danmu_roomid(default_monitor_roomid)
danmu_tasks.append(connect.run_danmu())

notifier.exec_task(-2, HeartBeatTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvHeartGiftTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, OpenSilverBoxTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvDailyBagTask, 0, delay_range=(0, 5))
示例#2
0
            raffle_danmu_areaids=area_ids,
            yjmonitor_danmu_roomid=yjmonitor_danmu_roomid,
            printer_danmu_roomid=default_roomid,
            yjmonitor_tcp_addr=yjmonitor_tcp_addr,
            yjmonitor_tcp_key=yjmonitor_tcp_key,
            future=future))
    await future
    return future.result()


printer_danmu = loop.run_until_complete(get_printer_danmu())

if sys.platform != 'linux' or signal.getsignal(
        signal.SIGHUP) == signal.SIG_DFL:
    console_thread = threading.Thread(
        target=Biliconsole(loop, default_roomid, printer_danmu).cmdloop)
    console_thread.start()
else:
    console_thread = None

notifier.exec_task(-2, HeartBeatTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvHeartGiftTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, OpenSilverBoxTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvDailyBagTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SignTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, WatchTvTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SignFansGroupsTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SendGiftTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, ExchangeSilverCoinTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, JudgeCaseTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, BiliMainTask, 0, delay_range=(0, 5))