MihoyoBBSTools/main.py

68 lines
2.6 KiB
Python
Raw Normal View History

2021-05-24 08:16:52 +00:00
import login
2021-05-26 10:11:27 +00:00
import tools
2021-05-24 08:16:52 +00:00
import config
import genshin
import setting
import mihoyobbs
import honkai3rd
2021-05-24 08:16:52 +00:00
def main():
#初始化,加载配置
config.Load_config()
2021-06-06 13:19:28 +00:00
if config.enable_Config == True:
#检测参数是否齐全,如果缺少就进行登入操作
2021-06-06 13:19:28 +00:00
if config.mihoyobbs_Login_ticket == "" or config.mihoyobbs_Stuid == "" or config.mihoyobbs_Stoken == "":
2021-05-26 10:11:27 +00:00
#登入
login.login()
#获取要使用的BBS列表,#判断是否开启bbs_Singin_multi
2021-06-06 13:19:28 +00:00
if config.mihoyobbs["bbs_Singin_multi"] == True:
2021-06-06 05:04:18 +00:00
#速度快,但是无法设置主社区,主社区默认为第一个
'''
2021-05-26 10:11:27 +00:00
for i in setting.mihoyobbs_List:
2021-06-06 13:19:28 +00:00
if int(i["id"]) in config.mihoyobbs["bbs_Singin_multi_list"]:
2021-05-26 10:11:27 +00:00
setting.mihoyobbs_List_Use.append(i)
2021-06-06 05:04:18 +00:00
'''
#用这里的方案可以实现当让id在第一个的时候为主社区
for i in config.mihoyobbs["bbs_Singin_multi_list"]:
for i2 in setting.mihoyobbs_List:
2021-06-06 13:19:28 +00:00
if i == int(i2["id"]):
2021-06-06 05:04:18 +00:00
setting.mihoyobbs_List_Use.append(i2)
2021-05-26 10:11:27 +00:00
else:
#关闭bbs_Singin_multi后只签到大别墅
for i in setting.mihoyobbs_List:
2021-06-06 13:19:28 +00:00
if int(i["id"]) == 5:
2021-05-26 10:11:27 +00:00
setting.mihoyobbs_List_Use.append(i)
#米游社签到
2021-06-06 13:31:46 +00:00
if config.mihoyobbs["bbs_Global"] == True:
2021-05-26 10:11:27 +00:00
bbs = mihoyobbs.mihoyobbs()
2021-06-06 13:19:28 +00:00
if config.mihoyobbs["bbs_Singin"] == True:
2021-05-26 10:11:27 +00:00
bbs.Singin()
2021-06-06 13:19:28 +00:00
if config.mihoyobbs["bbs_Read_posts"] == True:
2021-05-26 10:11:27 +00:00
bbs.Readposts()
2021-06-06 13:19:28 +00:00
if config.mihoyobbs["bbs_Like_posts"] == True:
2021-05-26 10:11:27 +00:00
bbs.Likeposts()
2021-06-06 13:19:28 +00:00
if config.mihoyobbs["bbs_Share"] == True:
2021-05-26 10:11:27 +00:00
bbs.Share()
2021-06-06 07:27:33 +00:00
tools.log.info(f"今天还能获得{mihoyobbs.Today_getcoins}个米游币,目前有{mihoyobbs.Have_coins}个米游币")
2021-06-01 11:16:01 +00:00
else:
tools.log.info("米游社功能未启用!")
#原神签到
2021-05-26 10:11:27 +00:00
if(config.genshin_AutoSingin == True):
2021-06-01 11:16:01 +00:00
tools.log.info("正在进行原神签到")
2021-05-26 10:11:27 +00:00
genshin_Help = genshin.genshin()
genshin_Help.Sing_acc()
2021-06-01 11:16:01 +00:00
else:
tools.log.info("原神签到功能未启用!")
#崩坏3签到
2021-06-06 13:19:28 +00:00
if config.honkai3rd_AutoSing == True:
tools.log.info("正在进行崩坏3签到")
honkai3rd_Help = honkai3rd.honkai3rd()
honkai3rd_Help.Sing_acc()
else:
tools.log.info("崩坏3签到功能未启用")
2021-05-24 08:16:52 +00:00
else:
2021-05-26 10:11:27 +00:00
tools.log.warn ("Config未启用")
2021-05-24 08:16:52 +00:00
if __name__ == "__main__":
main()
pass