dereklee0310 / RussianFishing4Script

Russian Fishing 4 Bot
GNU General Public License v3.0
75 stars 20 forks source link

消息提醒建议,已测试,只需要替换变量 #28

Closed hpsazz1 closed 5 months ago

hpsazz1 commented 5 months ago

不清楚为什么邮件一直会报SSL安全问题,翻出了之前看到的一个告警类的提醒软件(用自带的软件是免费的) image 先上告警平台链接:https://fwalert.com/ 告警平台速通:https://fwalert.com/wiki/quick-start/ image 创建转发规则,我这里直接创建RF4 image 接下来维护模板变量名称,这个随意,为了方便我直接取用项目里的内容 image 接下来维护通知简述、通知正文以及通知方式: image 到这里,平台内容维护完毕。 接下来添加用于通知的代码(需要修改,以下内容仅用于测试): `import requests

指定URL

url = "https://fwalert.com/baadac8e-18be-4373-8005-bb5ce7c8508a"

msg='Cause of termination' msg1='2024-06-11' msg2='2024-06-12' msg3='1' msg4='99' msg5='80/19/80%' msg6='99/1/99%' msg7='10' msg8='20' msg9='21' msg10='20' msg11='15'

要发送的结构化数据

data = { 'Cause_of_termination': msg, 'Start_time': msg1, 'Finish_time': msg2, 'Running_time': msg3, 'Fish_caught': msg4, 'Marked_Unmarked_Mark_ratio': msg5, 'Hit_Miss_Bite_ratio': msg6, 'Alcohol_consumed': msg7, 'Coffee_consumed': msg8, 'Tea_consumed': msg9, 'Carrot_consumed': msg10, 'Harvest_baits_count': msg11, 'message': 'RussianFishing4Script: Notice of Program Termination' }

发送GET请求,并将整个字典作为查询参数

response = requests.get(url, params=data)

打印响应内容

print(response.text)`

效果如下图所示: 18751fadb025e80ad33e54e3a0d9317 06b32fc6b2f86f47b57849a7b86b48b

后期可以添加类似上星、提醒换铒、钓住地球之类的提醒。

hpsazz1 commented 5 months ago

阅读不仔细,漏掉了一些内容,变量内容可以不用添加,直接使用相应的键就可以。 image 直接

hpsazz1 commented 5 months ago

Cause of termination:{{Cause_of_termination}} Start time:{{Start_time}} Finish time:{{Finish_time}} Running time:{{Running_time}} Fish caught:{{Fish_caught}} Marked / Unmarked / Mark ratio:{{Marked_Unmarked_Mark_ratio}} Hit / Miss / Bite ratio:{{Hit_Miss_Bite_ratio}} Alcohol consumed:{{Alcohol_consumed}} Coffee consumed:{{Coffee_consumed}} Tea consumed:{{Tea_consumed}} Carrot consumed:{{Carrot_consumed}} Harvest baits count:{{Harvest_baits_count}}

dereklee0310 commented 5 months ago

Implemented.