Skip to content

Commit

Permalink
Merge remote-tracking branch 'upsteram/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang-Red committed Aug 22, 2024
2 parents 33e5f05 + ac909f9 commit 9c5bb14
Show file tree
Hide file tree
Showing 29 changed files with 332 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]
jobs:
docker-builder:
name: build docker
runs-on: ubuntu-latest
runs-on: ubuntu-23.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@master
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Tidy Modules
run: go mod tidy

- name: golangci-lint
uses: golangci/golangci-lint-action@master
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@master

- name: Tidy Modules
run: go mod tidy

- name: Run Lint
uses: golangci/golangci-lint-action@master
with:
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@

> 专为[后 go-cqhttp 时代](https://github.com/Mrs4s/go-cqhttp/issues/2471)开发迁移的`类zbp`新机器人现已出炉,基于官方api,稳定不风控: [NanoBot-Plugin](https://github.com/FloatTech/NanoBot-Plugin)
> 如果您不知道什么是 [OneBot](https://github.com/howmanybots/onebot) 或不希望运行多个程序,还可以直接前往 [gocqzbp](https://github.com/FloatTech/gocqzbp)[Release](https://github.com/FloatTech/gocqzbp/releases) 页面下载单一可执行文件或前往 [Packages](https://github.com/FloatTech/gocqzbp/pkgs/container/gocqzbp) 页面使用`docker`,运行后按提示登录即可。
> 如果您对开发插件感兴趣,欢迎加入[ZeroBot-Plugin-Playground](https://github.com/FloatTech/ZeroBot-Plugin-Playground)
> webui持续开发中, 欢迎加入[ZeroBot-Plugin-Webui](https://github.com/FloatTech/ZeroBot-Plugin-Webui)
Expand Down Expand Up @@ -1307,10 +1305,18 @@ print("run[CQ:image,file="+j["img"]+"]")

`import _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wallet"`

- [x] 查看我的钱包

- [x] 查看钱包排名

- [x] 设置硬币名称[ATRI币]

- [x] 管理钱包余额[+金额|-金额][@xxx]

- [x] 查看我的钱包|查看钱包余额[@xxx]

- [x] 钱包转账[金额][@xxx]

- 注:仅超级用户能"管理钱包余额",

</details>
<details>
<summary>据意查句</summary>
Expand Down Expand Up @@ -1547,8 +1553,7 @@ print("run[CQ:image,file="+j["img"]+"]")

### 1. 使用稳定版/测试版 (推荐)

可以前往[Release](https://github.com/FloatTech/ZeroBot-Plugin/releases)页面下载对应系统版本可执行文件,编译时开启了全部插件。您还可以选择 [gocqzbp](https://github.com/FloatTech/gocqzbp)[Release](https://github.com/FloatTech/gocqzbp/releases)[Package](https://github.com/FloatTech/gocqzbp/pkgs/container/gocqzbp),它是 [Mrs4s/go-cqhttp](https://github.com/Mrs4s/go-cqhttp) 与本插件的合体。

可以前往[Release](https://github.com/FloatTech/ZeroBot-Plugin/releases)页面下载对应系统版本可执行文件,编译时开启了全部插件。
### 2. 本地直接运行

1. 下载安装最新 [Go](https://studygolang.com/dl) 环境
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/FloatTech/rendercard v0.1.1
github.com/FloatTech/sqlite v1.6.3
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1
github.com/FloatTech/zbpctrl v1.6.1
github.com/FloatTech/zbputils v1.7.2-0.20240530064059-af6f6773ba94
github.com/FloatTech/zbpctrl v1.6.2-0.20240819160950-8c602be65fc6
github.com/FloatTech/zbputils v1.7.2-0.20240822065525-5ea6811ed91c
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7
github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5
github.com/antchfx/htmlquery v1.3.1
Expand Down Expand Up @@ -40,7 +40,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/tidwall/gjson v1.17.1
github.com/wcharczuk/go-chart/v2 v2.1.1
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240627150749-3ff3d73940da
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240819160523-35d33e774a2d
gitlab.com/gomidi/midi/v2 v2.1.7
golang.org/x/image v0.16.0
golang.org/x/sys v0.20.0
Expand Down
18 changes: 6 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,20 @@ github.com/FloatTech/AnimeAPI v1.7.1-0.20240530072450-71c23d2f01f8 h1:2i36tl5VlB
github.com/FloatTech/AnimeAPI v1.7.1-0.20240530072450-71c23d2f01f8/go.mod h1:Ru6q5pZUnfMg1iu0M1Hp73q9N3LNIbDr16kjkzyG6Xk=
github.com/FloatTech/floatbox v0.0.0-20240505082030-226ec6713e14 h1:8O0Iq9MnKsKowltY9txhOqcJdmGTjxHPQ4gEYzbJc9A=
github.com/FloatTech/floatbox v0.0.0-20240505082030-226ec6713e14/go.mod h1:OzGLhvmtz1TKIdGaJDd8pQumvD36UqK+dWsiCISmzQQ=
github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08 h1:dPLeoiTVSBlgls+66EB/UJ2e38BaASmBN5nANaycSBU=
github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08/go.mod h1:uzPzAeT35egARdRuu+1oyjU3CmTwCceoq3Vvje7LpcI=
github.com/FloatTech/gg v1.1.3-0.20240713082823-e278d9aa62b5 h1:yfZaFFYGIiAZqP7Rdz8I8EI8z6bH9UqKF56Hr/HfQkY=
github.com/FloatTech/gg v1.1.3-0.20240713082823-e278d9aa62b5/go.mod h1:/9oLP54CMfq4r+71XL26uaFTJ1uL1boAyX67680/1HE=
github.com/FloatTech/gg v1.1.3 h1:+GlL02lTKsxJQr4WCuNwVxC1/eBZrCvypCIBtxuOFb4=
github.com/FloatTech/gg v1.1.3/go.mod h1:/9oLP54CMfq4r+71XL26uaFTJ1uL1boAyX67680/1HE=
github.com/FloatTech/imgfactory v0.2.2-0.20230413152719-e101cc3606ef h1:CJbK/2FRwPuZpeb6M4sWK2d7oXDnBEGhpkQuQrgc91A=
github.com/FloatTech/imgfactory v0.2.2-0.20230413152719-e101cc3606ef/go.mod h1:el5hGpj1C1bDRxcTXYRwEivDCr40zZeJpcrLrB1fajs=
github.com/FloatTech/rendercard v0.0.10-0.20230223064326-45d29fa4ede9 h1:hffajvmQFfP68U6wUwHemPuuwCUoss+SEFfoLYwbGwE=
github.com/FloatTech/rendercard v0.0.10-0.20230223064326-45d29fa4ede9/go.mod h1:NBFPhWae4hqVMeG8ELBBnUQkKce3nDjkljVn6PdiUNs=
github.com/FloatTech/rendercard v0.1.1 h1:vXz3x92bLavmNexTywdUvhft2/ipUSuo8aPRkqVdGQ8=
github.com/FloatTech/rendercard v0.1.1/go.mod h1:Sbojcy1t3NfFz7/WicZRmR/uKFxNMYkKF8qHx69dxY0=
github.com/FloatTech/sqlite v1.6.3 h1:MQkqBNlkPuCoKQQgoNLuTL/2Ci3tBTFAnVYBdD0Wy4M=
github.com/FloatTech/sqlite v1.6.3/go.mod h1:zFbHzRfB+CJ+VidfjuVbrcin3DAz283F7hF1hIeHzpY=
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo=
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
github.com/FloatTech/zbpctrl v1.6.1 h1:SilK5R2poO8iUT6JPzpgr/BSzxYAaybBYNZkMyZ8STw=
github.com/FloatTech/zbpctrl v1.6.1/go.mod h1:I+MetM++1sJhNPg3zww1aw04BicYsNohvHC4Jh52XSo=
github.com/FloatTech/zbputils v1.7.2-0.20240530064059-af6f6773ba94 h1:ITQPmNSHE5bNFBpdwldUpfTDLXROEahSKspkJrSLWvQ=
github.com/FloatTech/zbputils v1.7.2-0.20240530064059-af6f6773ba94/go.mod h1:nHWYtF4g2NRv3GXZiAZDvgPjdcHGUaQHxGgD0aHz30I=
github.com/FloatTech/zbpctrl v1.6.2-0.20240819160950-8c602be65fc6 h1:PsB+ZN7NHUhJTJwcu64BKQy2/nKLsaCju0/LCfBQgbE=
github.com/FloatTech/zbpctrl v1.6.2-0.20240819160950-8c602be65fc6/go.mod h1:I+MetM++1sJhNPg3zww1aw04BicYsNohvHC4Jh52XSo=
github.com/FloatTech/zbputils v1.7.2-0.20240822065525-5ea6811ed91c h1:hFiqx4uk6+lc2zHAaQ3JkkI2KH59c6O4yHKWKXFzxLs=
github.com/FloatTech/zbputils v1.7.2-0.20240822065525-5ea6811ed91c/go.mod h1:MwTFLPhlP0qMMLcq4x90oiu1IVE1T5dN0ZsxyTGSf6k=
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 h1:S/ferNiehVjNaBMNNBxUjLtVmP/YWD6Yh79RfPv4ehU=
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7/go.mod h1:vD7Ra3Q9onRtojoY5sMCLQ7JBgjUsrXDnDKyFxqpf9w=
Expand Down Expand Up @@ -210,8 +204,8 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/wcharczuk/go-chart/v2 v2.1.1 h1:2u7na789qiD5WzccZsFz4MJWOJP72G+2kUuJoSNqWnE=
github.com/wcharczuk/go-chart/v2 v2.1.1/go.mod h1:CyCAUt2oqvfhCl6Q5ZvAZwItgpQKZOkCJGb+VGv6l14=
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240627150749-3ff3d73940da h1:VDoA8sK4unUQIscev0k+flDFqgyZ8HNdEm9QO8xLKYg=
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240627150749-3ff3d73940da/go.mod h1:J6uHaXS/Am2VsLxF9TcU6il19PbOeC4SvgxHJ1E2jaE=
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240819160523-35d33e774a2d h1:6fdh+WpXcIcCXPoOpuJMp4RhMc4yjp9iAmn5UPyIcGQ=
github.com/wdvxdr1123/ZeroBot v1.7.5-0.20240819160523-35d33e774a2d/go.mod h1:J6uHaXS/Am2VsLxF9TcU6il19PbOeC4SvgxHJ1E2jaE=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
Expand Down
20 changes: 10 additions & 10 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ schema = 3
version = "v0.0.0-20240505082030-226ec6713e14"
hash = "sha256-v296D9T1QzFmcHQJNxJvx7sMtK+Jd1TUHXWqZtIvvf4="
[mod."github.com/FloatTech/gg"]
version = "v1.1.3-0.20230226151425-6ea91286ba08"
hash = "sha256-AeMzjMK1ZwFERb5xuNAV5PdHp7rzoT4ZF7kZ6Kj2/0s="
version = "v1.1.3"
hash = "sha256-7K/R2mKjUHVnoJ3b1wDObJ5Un2Htj59Y97G1Ja1tuPo="
[mod."github.com/FloatTech/imgfactory"]
version = "v0.2.2-0.20230413152719-e101cc3606ef"
hash = "sha256-2okFyPQSYIxrc8hxICsbjEM9xq25a3I2A4wmDIYFCg8="
[mod."github.com/FloatTech/rendercard"]
version = "v0.0.10-0.20230223064326-45d29fa4ede9"
hash = "sha256-Zn8agmyWWEC2QQfIBa60jlQrEap9Bps+z1Ekay6Y0cg="
version = "v0.1.1"
hash = "sha256-w5GcscWQzgdcfC0Vw4u+7/NipP3PTB2UrVcxki88IPo="
[mod."github.com/FloatTech/sqlite"]
version = "v1.6.3"
hash = "sha256-zWPByEMi89ms67ubPg0fAPIRxfpBC2IRKc0iNVLqkPU="
[mod."github.com/FloatTech/ttl"]
version = "v0.0.0-20230307105452-d6f7b2b647d1"
hash = "sha256-BQzWUzoIOLwfZa7WElqaa3EYrcz1Ql6JApgxZIQHBro="
[mod."github.com/FloatTech/zbpctrl"]
version = "v1.6.1"
hash = "sha256-S5KSLZSUt6s7i6ZfKovlJawXF5NYkenPSNVWk+xtO8o="
version = "v1.6.2-0.20240819160950-8c602be65fc6"
hash = "sha256-Yvbi12yoX4KPSN7YIdQDvvC8327TwxUaLoWoKNf9UWI="
[mod."github.com/FloatTech/zbputils"]
version = "v1.7.2-0.20240530064059-af6f6773ba94"
hash = "sha256-cpanspZVMKWAXUtXUFKmIiCS+Xmzr6JNNYc6xxRSMb0="
version = "v1.7.2-0.20240822065525-5ea6811ed91c"
hash = "sha256-ouAExps1iPCcD1AmOxyhRXMBGHBDXvUGkplcnQCf3Bg="
[mod."github.com/RomiChan/syncx"]
version = "v0.0.0-20240418144900-b7402ffdebc7"
hash = "sha256-L1j1vgiwqXpF9pjMoRRlrQUHzoULisw/01plaEAwxs4="
Expand Down Expand Up @@ -221,8 +221,8 @@ schema = 3
version = "v2.1.1"
hash = "sha256-emvjt/ze8skM+MBflwV0EgS/svpaEGU/mn27Ie4VTXs="
[mod."github.com/wdvxdr1123/ZeroBot"]
version = "v1.7.5-0.20240627150749-3ff3d73940da"
hash = "sha256-kpseKieBzE3xYHvB+18J5L6croCCqoQ9KPHvP318Uus="
version = "v1.7.5-0.20240819160523-35d33e774a2d"
hash = "sha256-5I+24K6xt9p5Cd/ZXWZ7MTVq+sbHqGdD2P6uMtSZ5YU="
[mod."github.com/yusufpapurcu/wmi"]
version = "v1.2.4"
hash = "sha256-N+YDBjOW59YOsZ2lRBVtFsEEi48KhNQRb63/0ZSU3bA="
Expand Down
2 changes: 1 addition & 1 deletion plugin/aifalse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func drawstatus(m *ctrl.Control[*zero.Ctx], uid int64, botname string, botrunsta
return
}

data, err = web.GetData("http://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
data, err = web.GetData("https://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
if err != nil {
return
}
Expand Down
12 changes: 6 additions & 6 deletions plugin/drawlots/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ func randGif(gifName string, uid int64) (image.Image, error) {
// https://zhuanlan.zhihu.com/p/27718135
rect := image.Rect(0, 0, config.Width, config.Height)
if rect.Min == rect.Max {
var max image.Point
var maxP image.Point
for _, frame := range im.Image {
maxF := frame.Bounds().Max
if max.X < maxF.X {
max.X = maxF.X
if maxP.X < maxF.X {
maxP.X = maxF.X
}
if max.Y < maxF.Y {
max.Y = maxF.Y
if maxP.Y < maxF.Y {
maxP.Y = maxF.Y
}
}
rect.Max = max
rect.Max = maxP
}
img := image.NewRGBA(rect)
b := fcext.RandSenderPerDayN(uid, len(im.Image)) + 1
Expand Down
2 changes: 1 addition & 1 deletion plugin/gif/logo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (cc *context) prepareLogos(s ...string) error {
if err != nil {
err = file.DownloadTo("https://gchat.qpic.cn/gchatpic_new//--"+strings.ToUpper(v)+"/0", cc.headimgsdir[i])
} else {
err = file.DownloadTo("http://q4.qlogo.cn/g?b=qq&nk="+v+"&s=640", cc.headimgsdir[i])
err = file.DownloadTo("https://q4.qlogo.cn/g?b=qq&nk="+v+"&s=640", cc.headimgsdir[i])
}
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion plugin/gif/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func init() { // 插件主体
PrivateDataFolder: "gif",
}).ApplySingle(ctxext.DefaultSingle)
datapath = file.BOTPATH + "/" + en.DataFolder()
en.OnRegex(`^(` + strings.Join(cmd, "|") + `)[\s\S]*?(\[CQ:(image\,file=([0-9a-zA-Z]{32}).*|at.+?(\d{5,11}))\].*|(\d+))$`).
en.OnRegex(`^(` + strings.Join(cmd, "|") + `)[\s\S]*?(\[CQ:(image\,file=([0-9a-zA-Z]{32}).*|at.+?qq=(\d{5,11})).*\].*|(\d+))$`).
SetBlock(true).Handle(func(ctx *zero.Ctx) {
list := ctx.State["regex_matched"].([]string)
atUserID, _ := strconv.ParseInt(list[4]+list[5]+list[6], 10, 64)
Expand Down
2 changes: 1 addition & 1 deletion plugin/kfccrazythursday/kfccrazythursday.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

const (
crazyURL = "https://api.jixs.cc/api/wenan-fkxqs/index.php"
crazyURL = "http://api.jixs.cc/api/wenan-fkxqs/index.php"
)

func init() {
Expand Down
12 changes: 6 additions & 6 deletions plugin/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,12 @@ func init() { // 插件主体

// 传入 ctx 和 welcome格式string 返回cq格式string 使用方法:welcometocq(ctx,w.Msg)
func welcometocq(ctx *zero.Ctx, welcome string) string {
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
at := "[CQ:at,qq=" + uid + "]" // at用户
avatar := "[CQ:image,file=" + "http://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640,cache=0]" // 用户头像
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
groupname := ctx.GetThisGroupInfo(true).Name // 群名
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
at := "[CQ:at,qq=" + uid + "]" // at用户
avatar := "[CQ:image,file=" + "https://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640]" // 用户头像
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
groupname := ctx.GetThisGroupInfo(true).Name // 群名
cqstring := strings.ReplaceAll(welcome, "{at}", at)
cqstring = strings.ReplaceAll(cqstring, "{nickname}", nickname)
cqstring = strings.ReplaceAll(cqstring, "{avatar}", avatar)
Expand Down
6 changes: 3 additions & 3 deletions plugin/manager/timer/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ func GetFilledTimer(dateStrs []string, botqq, grp int64, matchDateOnly bool) *Ti
if len(minuteStr) == 3 {
minuteStr = []rune{minuteStr[0], minuteStr[2]} // 去除中间的十
}
min := chineseNum2Int(minuteStr)
if min < -1 || min > 59 { // 分钟非法
minute := chineseNum2Int(minuteStr)
if minute < -1 || minute > 59 { // 分钟非法
t.Alert = "分钟非法!"
return &t
}
t.SetMinute(min)
t.SetMinute(minute)
if !matchDateOnly {
urlStr := dateStrs[5]
if urlStr != "" { // 是图片url
Expand Down
12 changes: 6 additions & 6 deletions plugin/manager/timer/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func (t *Timer) Hour() (h int) {
}

// Minute 6bits
func (t *Timer) Minute() (min int) {
min = int(t.En1Month4Day5Week3Hour5Min6 & 0x00003f)
if min == 0b111111 {
min = -1
func (t *Timer) Minute() (m int) {
m = int(t.En1Month4Day5Week3Hour5Min6 & 0x00003f)
if m == 0b111111 {
m = -1
}
return
}
Expand Down Expand Up @@ -82,6 +82,6 @@ func (t *Timer) SetHour(h int) {
}

// SetMinute ...
func (t *Timer) SetMinute(min int) {
t.En1Month4Day5Week3Hour5Min6 = (int32(min) & 0x00003f) | (t.En1Month4Day5Week3Hour5Min6 & 0xffffc0)
func (t *Timer) SetMinute(m int) {
t.En1Month4Day5Week3Hour5Min6 = (int32(m) & 0x00003f) | (t.En1Month4Day5Week3Hour5Min6 & 0xffffc0)
}
6 changes: 3 additions & 3 deletions plugin/mcfish/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
for {
select {
case <-time.After(time.Second * 120):
ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text("等待超时,取消钓鱼")))
ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text("等待超时,取消购买")))
return
case e := <-recv:
nextcmd := e.Event.Message.String()
Expand All @@ -69,7 +69,7 @@ func init() {
}
money := wallet.GetWalletOf(uid)
if money < 100 {
ctx.SendChain(message.Text("你钱包当前只有", money, "ATRI币,无法完成支付"))
ctx.SendChain(message.Text("你钱包当前只有", money, wallet.GetWalletName(), ",无法完成支付"))
return
}
err = wallet.InsertWalletOf(uid, -100)
Expand Down Expand Up @@ -147,7 +147,7 @@ func init() {
fishNumber = 0
for name, number := range fishNmaes {
fishNumber += number
msg += strconv.Itoa(number) + name + ""
msg += strconv.Itoa(number) + name + " "
}
msg += ")"
fishNumber /= 2
Expand Down
12 changes: 6 additions & 6 deletions plugin/mcfish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var (
"5.鱼类信息:\n-> 鳕鱼 : 均价:10 上钩概率:0.69%\n-> 鲑鱼 : 均价:50 上钩概率:0.2%\n-> 热带鱼 : 均价:100 上钩概率:0.06%\n-> 河豚 : 均价:300 上钩概率:0.03%\n-> 鹦鹉螺 : 均价:500 上钩概率:0.01%\n-> 墨鱼 : 均价:500 上钩概率:0.01%\n" +
"6.垃圾:\n-> 均价:10 上钩概率:30%\n" +
"7.物品BUFF:\n-> 钓鱼佬 : 当背包名字含有'鱼'的物品数量超过100时激活,钓到物品概率提高至90%\n-> 修复大师 : 当背包鱼竿数量超过10时激活,修复物品时耐久百分百继承\n" +
"8.合成:\n-> 铁竿 : 3x木竿\n-> 金竿 : 3x铁竿\n-> 钻石竿 : 3x金竿\n-> 下界合金竿 : 3x钻石竿\n-> 三叉戟 : 3x下界合金竿\n注:合成成功率90%,继承附魔等级合/3的等级\n" +
"8.合成:\n-> 铁竿 : 3x木竿\n-> 金竿 : 3x铁竿\n-> 钻石竿 : 3x金竿\n-> 下界合金竿 : 3x钻石竿\n-> 三叉戟 : 3x下界合金竿\n注:合成成功率90%(包括梭哈),合成鱼竿的附魔等级=(附魔等级合/合成鱼竿数量)\n" +
"9.杂项:\n-> 无装备的情况下,每人最多可以购买3次100块钱的鱼竿\n-> 默认状态钓鱼上钩概率为60%(理论值!!!)\n-> 附魔的鱼竿会因附魔变得昂贵,每个附魔最高3级\n-> 三叉戟不算鱼竿,修复时可直接满耐久\n" +
"-> 鱼竿数量大于50的不能买东西;\n 鱼竿数量大于30的不能钓鱼;\n 每购/售10次鱼竿获得1层宝藏诅咒;\n 每购买20次物品将获得3次价格减半福利;\n 每钓鱼75次获得1本净化书;\n" +
" 每天最多只可出售5个鱼竿和购买15次物品;",
Expand Down Expand Up @@ -208,7 +208,7 @@ func init() {
Min: probableList[2],
Max: probableList[3],
}
min := make(map[string]int, 4)
minMap := make(map[string]int, 4)
for _, info := range articlesInfo.ArticleInfo {
switch {
case info.Type == "pole" || info.Name == "美西螈":
Expand All @@ -228,10 +228,10 @@ func init() {
durationList[info.Name] = info.Durable
}
probabilities[info.Name] = probabilityLimit{
Min: min[info.Type],
Max: min[info.Type] + info.Probability,
Min: minMap[info.Type],
Max: minMap[info.Type] + info.Probability,
}
min[info.Type] += info.Probability
minMap[info.Type] += info.Probability
}
// }()
}
Expand Down Expand Up @@ -413,9 +413,9 @@ func (sql *fishdb) pickFishFor(uid int64, number int) (fishNames map[string]int,
}
if fishInfo.Number < i {
k++
fishInfo.Number = 0
i -= fishInfo.Number
fishNames[fishInfo.Name] += fishInfo.Number
fishInfo.Number = 0
} else {
fishNames[fishInfo.Name] += i
fishInfo.Number -= i
Expand Down
Loading

0 comments on commit 9c5bb14

Please sign in to comment.