Skript数据库 (skript-db)
Skript数据库是一个为Skript提供直接数据库访问的强大插件。
功能:
- 自动防止SQL注入攻击
- 支持连接到多个数据库
- 非常直观的列表变量系统,用于读取查询结果
配置:
该插件需要在Minecraft版本Legacy(< 1.13)中使用,并在1.9至1.17版本进行了测试。
用法:
1. 在脚本加载时,设置数据库连接:
on script load: set {-sql} to the database "mysql:\/\/localhost:3306\/mydatabase?user=admin&password=12345&useSSL=false"
2. 执行数据库查询并存储结果:
command \/dbtest: trigger: execute "select from table" in {-sql} and store the result in {_output::} send "First entry in column: %{_output::columnname::1}%"
3. 插入数据到数据库:
command \/insertmyprofile: trigger: execute "INSERT INTO table (uuid,name,lastjoin) VALUES (%uuid of player%,%name of player%,%rounded unix timestamp of now%) ON DUPLICATE KEY UPDATE name=VALUES(name),lastjoin=VALUES(lastjoin)" in {-sql}
权限:
无需特殊权限。
支持:
您可以在git仓库创建问题以获得支持,或者您也可以在我的Matrix聊天室中获得实时聊天支持。
收录