新增参考面板和收益曲线攻略

This commit is contained in:
CMHopeSunshine 2022-03-22 21:35:53 +08:00
parent bc68bd1d70
commit b5c1f98e19
60 changed files with 175 additions and 70 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<a href="https://github.com/CMHopeSunshine/LittlePaimon"><img src="https://raw.githubusercontent.com/CMHopeSunshine/LittlePaimon/master/readme/logo.png" width="200" height="200" alt="LittlePaimon"></a>
<a href="https://github.com/CMHopeSunshine/LittlePaimon"><img src="https://raw.githubusercontent.com/CMHopeSunshine/LittlePaimon/master/readme/logo.png" width="256" height="256" alt="LittlePaimon"></a>
</p>
<h1 align="center">小派蒙|LittlePaimon</h1>
<h4 align="center">✨基于<a href="https://github.com/Ice-Cirno/HoshinoBot" target="_blank">HoshinoBot</a><a href="https://github.com/Mrs4s/go-cqhttp" target="_blank">go-cqhttp</a>的原神Q群机器人✨</h4>
@ -7,7 +7,7 @@
<p align="center">
<img src="https://img.shields.io/badge/version-v1.0.0-red" alt="version">
<a href="https://cdn.jsdelivr.net/gh/CMHopeSunshine/LittlePaimon@master/LICENSE"><img src="https://img.shields.io/github/license/CMHopeSunshine/LittlePaimon" alt="license"></a>
<img src="https://img.shields.io/badge/python-3.8+-yellow" alt="python">
<img src="https://img.shields.io/badge/Python-3.8+-yellow" alt="python">
<a href="https://github.com/Mrs4s/go-cqhttp"><img src="https://img.shields.io/badge/go--cqhttp-v1.0.0--rc1-green?style=flat-square" alt="go-cqhttp"></a>
<a href="https://docs.nonebot.dev/"><img src="https://img.shields.io/badge/NoneBot-1.6.0+,2.0.0---cyan?style=flat-square" alt="go-cqhttp"></a>
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=C7QsbLOA4SNWWy8_lofoR1CPipG-aTi3&jump_from=webapi"><img src="https://img.shields.io/badge/QQ群-906635633-blue?style=flat-square" alt="QQ Chat"></a>
@ -15,6 +15,10 @@
</p>
## 简介
通过米游社接口查询uid的游戏信息并附带各种娱乐功能。
## 功能示例
<img src="https://raw.githubusercontent.com/CMHopeSunshine/LittlePaimon/master/readme/ys.jpg" alt="ys">
@ -60,16 +64,16 @@
以下指令会记录上一次查询的uid因此只需第一次查询时写上uid即可。
| 指令 | 介绍 | 备注 |
| ----------------- | --------------------------------------- | :------------------------------------------------------ |
| ys uid | 查询uid的个人信息卡片 | |
| ysa uid | 查询uid拥有的角色和武器 | 没绑cookie则只显示8个 |
| ysc uid 角色名 | 查询uid指定角色的信息 | 没绑cookie则只能查公开的8个且不显示天赋支持角色别名 |
| ysb cookie | 绑定私人cookie到qq号 | |
| 添加公共ck cookie | 添加cookie到公共cookie池 | 至少需要添加一个公共cookie才能使用查询功能 |
| sy uid (层数) | 查询uid的深渊信息 | 绑定私人cookie后才能查看具体层数信息 |
| ssbq uid | 查询uid的实时便签包括树脂、派遣情况等 | uid必须绑定了对应私人cookie才能使用 |
| myzj uid 月份 | 查询uid的该月札记 | uid必须绑定了对应私人cookie才能使用 |
| 指令 | 介绍 | 备注 |
| ----------------- | --------------------------------------- | :----------------------------------------------------------- |
| ys uid | 查询uid的个人信息卡片 | |
| ysa uid | 查询uid拥有的角色和武器 | 没绑cookie则只显示8个 |
| ysc uid 角色名 | 查询uid指定角色的信息 | 没绑cookie则只能查公开的8个且不显示天赋支持角色别名 |
| ysb cookie | 绑定私人cookie到qq号 | 建议使用私聊绑定 |
| 添加公共ck cookie | 添加cookie到公共cookie池 | 需要添加至少一个公共cookie才能使用查询功能每个cookie每日查询上限30次 |
| sy uid (层数) | 查询uid的深渊信息 | 绑定私人cookie后才能查看具体层数信息 |
| ssbq uid | 查询uid的实时便签包括树脂、派遣情况等 | uid必须绑定了对应私人cookie才能使用 |
| myzj uid (月份) | 查询uid的该月札记 | uid必须绑定了对应私人cookie才能使用不写月份时默认为本月只能看最近3个月 |
### 模拟抽卡功能
@ -85,20 +89,22 @@
### 原神WIKI
| 指令 | 介绍 | 备注 |
| ---------- | ---------------------------------- | ---- |
| xx角色攻略 | 查看西风驿站出品的角色攻略一图流 | |
| xx角色材料 | 查看开发者本人出品的角色材料一图流 | |
| 指令 | 介绍 | 备注 |
| ---------- | ----------------------------------- | -------- |
| xx角色攻略 | 查看西风驿站出品的角色攻略一图流 | 支持别名 |
| xx角色材料 | 查看我出品的角色材料一图流 | 支持别名 |
| xx参考面板 | 查看bluemushoom出品的角色参考面板图 | 支持别名 |
| xx收益曲线 | 查看bluemushoom出品的角色收益曲线图 | 支持别名 |
### 米游币帮兑功能
私聊机器人回复```米游币兑换```,跟着机器人提示步骤来使用。
私聊机器人回复```米游币兑换```,跟着派蒙的提示步骤来使用。
### 派蒙语音功能
群聊关键词可能会触发派蒙语音哦需要额外安装ffmepg
> 发送语音功能需要额外安装FFmpeg请自行安装
群聊关键词可能会触发派蒙语音哦,尝试发送`诶嘿、大佬、羡慕`等词吧!
### 头像表情包制作
@ -106,12 +112,25 @@
| ------------------------------------------------------------ | --------------------------- | :-------- | -------------- |
| #亲亲/贴贴/拍拍/给爷爬/吃掉/扔掉/撕掉/精神支柱/要我一直 @人/qq号/图片 | 好玩的头像图片gif表情包生成 | 要以#开头 | #精神支柱@群主 |
## 更新日志
- 3.20 新增Windows一键部署脚本
- 3.22 新增蓝佬授权提供的收益曲线和参考面板攻略图
## 未来计划
- [ ] 实时便签树脂提醒
- [ ] 抽卡记录导出和分析
- [ ] ocr圣遗物评分和角色面板记录
- [ ] 角色、武器和圣遗物wiki
- [ ] 派蒙AI闲聊
## 部署方法
> 本项目和HoshinoBot的部署方式一样因此Linux可以参考
>
> https://cn.pcrbot.com/deploy-hoshinobot-on-centos/
>
### 一键安装脚本
@ -122,30 +141,31 @@
```powershell
iwr "https://cdn.jsdelivr.net/gh/CMHopeSunshine/LittlePaimon@master/LittlePaimon-install.ps1" -O .\pm.ps1 ; ./pm.ps1 ; Set-Location .. ; rm pm.ps1
```
安装成功后,`powershell`运行文件夹内的`启动.ps1`来启动机器人
完成go-cqhttp的登录后登录米游社网页版在地址栏粘贴
```
javascript:(function(){prompt(document.domain,document.cookie)})();
```
复制得到的cookie向机器人私聊发送`添加公共ck`和粘贴的内容即可开始使用
#### Linux
代补充...
## 未来计划
## 额外说明
- [ ] 实时便签树脂提醒
- [ ] 抽卡记录导出和分析
- [ ] ocr圣遗物评分和角色面板记录
- [ ] 角色、武器和圣遗物wiki
- [ ] 派蒙AI闲聊
本项目也可作为HoshinoBot的插件来使用移植`hoshino/modules`内模块即可不过对HoshinoBot有所魔改报错时查看修改一下代码即可。
## 感谢
代码水平很烂站在巨人的肩膀上努力学习ing......
- [HoshinoBot](https://github.com/Ice-Cirno/HoshinoBot) - 基于nonebot1的QQ-bot框架
- [go-cqhttp](https://github.com/Mrs4s/go-cqhttp) - Onebot标准的框架实现
- [egenshin](https://github.com/pcrbot/erinilis-modules/tree/master/egenshin) - 参考了它的抽卡代码和资源
- 西风驿站 - 角色攻略一图流来源
- [西风驿站](https://bbs.mihoyo.com/ys/collection/307224) - 角色攻略一图流来源
- [hoshino-installer](https://github.com/pcrbot/hoshino-installer) - 一键安装脚本参考
- [bluemushoom](https://bbs.nga.cn/nuke.php?func=ucp&uid=62861898) - 全角色收益曲线和参考面板攻略图来源

View File

@ -0,0 +1,70 @@
import hoshino,os
from PIL import Image
from hoshino import R,MessageSegment,aiorequests,logger,Service
from hoshino.typing import CQEvent, Message
from ..character_alias import get_id_by_alias
from .blue import get_blue_pic
from ..util import pil2b64
sv=hoshino.Service('原神角色wiki')
res_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'res')
@sv.on_prefix('角色攻略')
@sv.on_suffix('角色攻略')
async def genshinguide(bot,ev):
name = ev.message.extract_plain_text().strip()
chara_name = get_id_by_alias(name)
if not chara_name:
await bot.send(ev,f'没有找到{name}的攻略',at_sender=True)
elif chara_name[1][0] == '八重神子':
path = os.path.join(res_path, 'role_guide','八重神子.png')
cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True)
else:
img = f'[CQ:image,file=https://adachi-bot.oss-cn-beijing.aliyuncs.com/Version2/guide/{chara_name[1][0]}.png]'
await bot.send(ev,img)
@sv.on_prefix('角色材料')
@sv.on_suffix('角色材料')
async def genshinmaterial(bot,ev):
name = ev.message.extract_plain_text().strip()
name = get_id_by_alias(name)
if not name:
await bot.send(ev,f'没有找到{name}的材料',at_sender=True)
else:
path = os.path.join(res_path, 'role_material',f'{name[1][0]}材料.png')
cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True)
@sv.on_prefix('参考面板')
@sv.on_suffix('参考面板')
async def genshinAttribute(bot,ev):
name = ev.message.extract_plain_text().strip()
if name != '风主' or name != '岩主' or name != '雷主':
name = get_id_by_alias(name)
if not name:
await bot.send(ev,f'没有找到{name}的参考面板',at_sender=True)
return
name = name[1][0]
pic_data = get_blue_pic(name)
pic = Image.open(os.path.join(res_path, 'blue', f'{pic_data[0]}.jpg'))
pic = pic.crop((0, pic_data[1][0], 1080, pic_data[1][1]))
pic = pil2b64(pic, 85)
pic = MessageSegment.image(pic)
await bot.send(ev,pic,at_sender=True)
@sv.on_prefix('收益曲线')
@sv.on_suffix('收益曲线')
async def genshinAttribute2(bot,ev):
name = ev.message.extract_plain_text().strip()
if name != '风主' or name != '岩主' or name != '雷主':
name = get_id_by_alias(name)
if not name:
await bot.send(ev,f'没有找到{name}的参考面板',at_sender=True)
return
name = name[1][0]
pic = Image.open(os.path.join(res_path, 'blue', f'{name}.png'))
pic = pil2b64(pic, 85)
pic = MessageSegment.image(pic)
await bot.send(ev,pic,at_sender=True)

View File

@ -0,0 +1,56 @@
blue={
'胡桃': ['', (0, 2420)],
'宵宫': ['', (2420, 2955)],
'烟绯': ['', (2955, 3492)],
'可莉': ['', (3492, 4029)],
'迪卢克': ['', (4029, 4567)],
'辛焱': ['', (4567, 5511)],
'安柏': ['', (5511, 6047)],
'香菱': ['', (6047, 6982)],
'班尼特': ['', (6982, 7932)],
'珊瑚宫心海': ['', (0, 950)],
'达达利亚': ['', (950, 1674)],
'行秋': ['', (1674, 2195)],
'莫娜': ['', (2195, 2916)],
'芭芭拉': ['', (2916, 3646)],
'申鹤': ['', (0, 959)],
'神里绫华': ['', (959, 1496)],
'优菈': ['', (1496, 2231)],
'甘雨': ['', (2231, 3569)],
'凯亚': ['', (3569, 4102)],
'重云': ['', (4102, 4639)],
'七七': ['', (4639, 5374)],
'迪奥娜': ['', (5374, 5710)],
'罗莎莉亚': ['', (5710, 6044)],
'埃洛伊': ['', (6044, 6394)],
'八重神子': ['', (0, 947)],
'雷电将军': ['', (947, 1474)],
'九条裟罗': ['', (1474, 2001)],
'刻晴': ['', (2001, 2730)],
'雷泽': ['', (2730, 3258)],
'菲谢尔': ['', (3258, 3786)],
'丽莎': ['', (3786, 4310)],
'北斗': ['', (4310, 4838)],
'雷主': ['', (4838, 5177)],
'早柚': ['', (0, 553)],
'枫原万叶': ['', (553, 1078)],
'': ['', (1078, 1803)],
'温迪': ['', (1803, 2527)],
'': ['', (2527, 3252)],
'砂糖': ['', (3252, 3977)],
'风主': ['', (3977, 4311)],
'荒泷一斗': ['', (0, 741)],
'五郎': ['', (741, 1055)],
'阿贝多': ['', (1055, 1767)],
'钟离': ['', (1767, 2475)],
'诺艾尔': ['', (2475, 3188)],
'凝光': ['', (3188, 3900)],
'岩主': ['', (3900, 4608)],
'云堇': ['', (4608, 5325)]
}
def get_blue_pic(name):
for c in blue.items():
if c[0] == name:
return c[1]
return None

View File

@ -1,41 +0,0 @@
import hoshino,os
from hoshino import R,MessageSegment,aiorequests,logger,Service
from hoshino.typing import CQEvent, Message
from hoshino.util import pic2b64
from .character_alias import get_id_by_alias
sv=hoshino.Service('原神角色wiki')
res_dir = os.path.join(os.path.dirname(__file__), 'res')
role_list=['云堇','申鹤','荒泷一斗','五郎','优菈','阿贝多','托马','胡桃','达达利亚','雷电将军','珊瑚宫心海','埃洛伊','宵宫','神里绫华','枫原万叶','温迪','刻晴','莫娜','可莉','','迪卢克','七七','','钟离','甘雨','旅行者','早柚','九条裟罗','凝光','菲谢尔','班尼特','丽莎','行秋','迪奥娜','安柏','重云','雷泽','芭芭拉','罗莎莉亚','香菱','凯亚','北斗','诺艾尔','砂糖','辛焱','烟绯','八重神子','神里绫人']
@sv.on_prefix('角色攻略')
@sv.on_suffix('角色攻略')
async def genshinguide(bot,ev):
if ev.message_type == 'guild' and (ev.channel_id != '2219931' and ev.channel_id != '1916789'):
return
name = ev.message.extract_plain_text().strip()
chara_name = get_id_by_alias(name)
if not chara_name:
await bot.send(ev,f'没有找到{name}的攻略',at_sender=True)
elif chara_name[1][0] == '八重神子':
path = os.path.join(res_dir, 'role_guide','八重神子.png')
cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True)
else:
img = f'[CQ:image,file=https://adachi-bot.oss-cn-beijing.aliyuncs.com/Version2/guide/{chara_name[1][0]}.png]'
await bot.send(ev,img)
@sv.on_prefix('角色材料')
@sv.on_suffix('角色材料')
async def genshinmaterial(bot,ev):
if ev.message_type == 'guild' and (ev.channel_id != '2219931' and ev.channel_id != '1916789'):
return
name = ev.message.extract_plain_text().strip()
name = get_id_by_alias(name)
if not name:
await bot.send(ev,'没有找到该角色的材料图',at_sender=True)
else:
path = os.path.join(res_dir, 'role_material',f'{name[1][0]}材料.png')
cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True)

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 876 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 967 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB