Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
1242509682 committed Jun 19, 2024
2 parents 17e643b + 36fea50 commit a8d587f
Show file tree
Hide file tree
Showing 23 changed files with 253 additions and 117 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/plugins_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
submodules: 'recursive'

- name: 初始化.NET 6
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
env:
DOTNET_CLI_UI_LANGUAGE: zh-CN
with:
Expand Down Expand Up @@ -62,12 +62,23 @@ jobs:
- name: 初始化Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: 安装Pandoc

- name: 安装beautifulsoup4
run: |
sudo pip install beautifulsoup4
- name: 更新论坛
env:
PYTHONIOENCODING: 'utf-8'
run:
sudo python ForumHelper.py ${{ secrets.MONIKA_TR_NAME }} ${{ secrets.MONIKA_TR_PASSWORD }}

- name: 安装Pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc
env:
PYTHONIOENCODING: 'utf-8'
Expand All @@ -83,7 +94,7 @@ jobs:
PYTHONIOENCODING: 'utf-8'

- name: 上传临时插件包
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Plugins
path: Plugins.zip
Expand Down Expand Up @@ -121,7 +132,7 @@ jobs:
git tag -f V1.0.0.0
git push -f origin V1.0.0.0
- name: 下载临时插件包
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Plugins
path: ./bin
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: 'recursive'

- name: 初始化.NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

Expand All @@ -29,7 +29,7 @@ jobs:
dotnet build Plugin.sln
- name: 初始化Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
2 changes: 0 additions & 2 deletions AnnouncementBoxPlus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
## 介绍

1. 广播盒内插占位符和格式化
![image](https://github.com/ACaiCat/TShockPlugin/assets/62058454/cc489eff-de45-4264-bc4e-8e19c9c91883)
2. 可以添加编辑广播盒的权限
![image](https://github.com/ACaiCat/TShockPlugin/assets/62058454/9177fc0f-df5b-4568-81fa-496364587497)
4. 可以开关广播盒
5. 可以设置广播盒有效范围(单位:像素)

Expand Down
3 changes: 2 additions & 1 deletion BuildHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def md_to_pdf(file_name):
print(f"⚠️ README移动失败({file_name})")
shutil.copyfile('README.md', f"out/{build_type}/README.md")
print("✅ README.md移动成功!")

shutil.copyfile('Plugins.json', f"out/{build_type}/Plugins.json")
print("✅ Plugins.json移动成功!")
if build_type == "Release":
print("🔄 准备转换PDF...")
urllib.request.urlretrieve("https://raw.githubusercontent.com/lxgw/LxgwWenKai/main/fonts/TTF/LXGWWenKaiMono-Regular.ttf", "LXGWWenKaiMono-Regular.ttf")
Expand Down
3 changes: 3 additions & 0 deletions BuildMaster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- 玩家将需要在一定时间内完成相对应主题的建筑,时间到后将由每位玩家进行评分,
- 得分会在游戏结束后进行一个排名。快来发挥你的想象力,把建筑搞起来!

> [!NOTE]
> 需要安装前置插件:MiniGamesAPI (本仓库)
## 更新日志

```
Expand Down
6 changes: 4 additions & 2 deletions ConsoleSql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

- 作者: Cai
- 出处: 本仓库
- 允许你使用在控制台和BOT中执行SQL语句
![image](https://github.com/ACaiCat/TShockPlugin/assets/62058454/e0d24d17-cea7-49b3-9172-0b8d49e3e23f)
- 允许你使用在控制台和BOT中执行SQL语句

> [!CAUTION]
> 执行危险SQL语句(DELETE、DROP等)时,请仔细检查(条件等),否则可能造成严重不可逆后果
## 示例
```
Expand Down
3 changes: 3 additions & 0 deletions Economics.Deal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- 出处: 无
- 交易物品插件

> [!NOTE]
> 需要安装前置插件:EconomicsAPI (本仓库)
## 更新日志

```
Expand Down
3 changes: 3 additions & 0 deletions Economics.NPC/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- 出处: 无
- 配置 NPC 专属奖励

> [!NOTE]
> 需要安装前置插件:EconomicsAPI(本仓库)
## 更新日志

```
Expand Down
3 changes: 3 additions & 0 deletions Economics.Projectile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- 出处: 无
- 自定义弹幕让你的武器更加炫酷

> [!NOTE]
> 需要安装前置插件:EconomicsAPI、Economics.RPG (本仓库)
## 更新日志

```
Expand Down
7 changes: 5 additions & 2 deletions Economics.RPG/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

- 作者: 少司命
- 出处: 无
- RPG 升级插件
- RPG 升级插件

> [!NOTE]
> 需要安装前置插件:EconomicsAPI (本仓库)
## 更新日志

Expand Down Expand Up @@ -62,4 +65,4 @@ V1.0.0.1
```
## 反馈
- 共同维护的插件库:https://github.com/Controllerdestiny/TShockPlugin
- 国内社区trhub.cn 或 TShock官方群等
- 国内社区trhub.cn 或 TShock官方群等
3 changes: 3 additions & 0 deletions Economics.Regain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- 出处: 无
- 可自定义回收物品插件

> [!NOTE]
> 需要安装前置插件:EconomicsAPI (本仓库)
## 更新日志

```
Expand Down
3 changes: 3 additions & 0 deletions Economics.Shop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- 出处: 无
- 商店插件

> [!NOTE]
> 需要安装前置插件:EconomicsAPI、Economics.RPG (本仓库)
## 更新日志

```
Expand Down
4 changes: 3 additions & 1 deletion Economics.Skill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
- 作者: 少司命
- 出处: 无
- 一个可以释放技能的插件
- 注意安装前置插件 `EconomicsAPI` `Economics.RPG`

> [!NOTE]
> 需要安装前置插件:EconomicsAPI、Economics.RPG (本仓库)
## 更新日志

```
Expand Down
4 changes: 3 additions & 1 deletion Economics.Task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
- 作者: 少司命
- 出处: 无
- 给玩家发任务
- 注意安装前置插件 `EconomicsAPI` `Economics.RPG`

> [!NOTE]
> 需要安装前置插件:EconomicsAPI、Economics.RPG (本仓库)
## 更新日志

Expand Down
3 changes: 3 additions & 0 deletions Economics.WeaponPlus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- 通过tshock.sqlite数据库储存玩家武器强化等级不会因丢弃武器或重进服务器丢失已有强化
- 本插件支持中英文转换

> [!NOTE]
> 需要安装前置插件:EconomicsAPI (本仓库)
## 更新日志

```
Expand Down
79 changes: 79 additions & 0 deletions ForumHelper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import json
import re
import sys
import requests as rq
from bs4 import BeautifulSoup

# 读取用户名 密码
name = sys.argv[1]
password = sys.argv[2]
print(f"论坛自动更新脚本 (by Cai😘)")
print(f"登录名: {name}")
print(f"密码: {password}")
# 创建会话
session = rq.Session()
resp = session.get("https://tr.monika.love/")

# 获取xf_token
soup = BeautifulSoup(resp.text, 'html.parser')
data_csrf = soup.html['data-csrf']

# 模拟登录
data = {
"_xfToken": data_csrf,
"login":name,
"password": password,
"remember": 0,
"_xfRedirect": "https://tr.monika.love/",
}
session.post("https://tr.monika.love/login/login",data=data,allow_redirects=True)

# 使用GithubAPI转换MD到Html
with open('README.md', 'r',encoding='utf-8') as file:
md = file.read()
headers = {
"Accept": "application/vnd.github+json",
#"Authorization": "Bearer <YOUR-TOKEN>",
"X-GitHub-Api-Version": "2022-11-28"
}

# 修复插件列表路径
md = re.sub(r'\b[^(\[]*\/README.md\b', lambda x: "https://gitee.com/kksjsj/TShockPlugin/blob/master/" + x.group(), md)

# 编辑论坛仓库帖子
data = {
"text": md
}
html = rq.post("https://api.github.com/markdown", headers=headers, data=json.dumps(data)).text
data = {
"_xfToken": data_csrf,
"prefix_id[]": 7,
"title": "TShock插件收集仓库(自动更新版)",
"tag_line": "此帖会自动更新插件列表",
"version_string": "总是最新",
"external_download_url": "https://github.moeyy.xyz/https://github.com/Controllerdestiny/TShockPlugin/releases/download/V1.0.0.0/Plugins.zip",
"description_html": f"{html}",
# "attachment_hash": "291d0c03815801596ec54fa208a79bfb", # 附件相关
# "attachment_hash_combined": {
# "type": "resource_update",
# "context": {
# "resource_update_id": 130
# },
# "hash": "291d0c03815801596ec54fa208a79bfb"
# },
"external_url": "",
"icon_action": "custom",
"_xfRequestUri": "/resources/104/edit",
"_xfWithData": 1,
"_xfResponseType": "json"
}
try:
resp = session.post("https://tr.monika.love/resources/104/edit",data=data)
res = resp.json()
if res['status'] == 'ok':
print(f"修改成功: {res}")
else:
print(f"修改失败: {res}")
except:
print(f"修改失败!{resp.text}")

4 changes: 3 additions & 1 deletion GenerateMap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
- 作者: 少司命
- 出处: 无
- 生成地图图片
- 注意安装前置插件 CaiLib

> [!NOTE]
> 注意安装前置插件CaiLib(本仓库)
## 更新日志

Expand Down
8 changes: 6 additions & 2 deletions Platform/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Platform 判断玩家设备

- 作者: Cai
- 作者: Cai、cc04(维度)
- 出处: [github](https://github.com/ACaiCat/CaiPlugins)
- 判断玩家是用什么设备进来的(只能判断类型)

> [!NOTE]
> 此插件是用于作为前置插件供其他插件调用的(可用于聊天前缀、计分板判定等)
> 目前支持区分的的PE、Stadia、XBOX、PSN、Editor、Switch、PC
## 更新日志

```
Expand All @@ -23,4 +27,4 @@
```
## 反馈
- 共同维护的插件库:https://github.com/Controllerdestiny/TShockPlugin
- 国内社区trhub.cn 或 TShock官方群等
- 国内社区trhub.cn 或 TShock官方群等
4 changes: 3 additions & 1 deletion ProgressRestrict/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
- 出处: github
- 超进度检测
- 可对物品,弹幕,buff 进行超进度检测
- 注意安装前置插件[DataSync](../DataSync/README.md)

> [!NOTE]
> 需要安装前置插件:DataSync(本仓库)
## 更新日志

Expand Down
Loading

0 comments on commit a8d587f

Please sign in to comment.