diff --git a/README.md b/README.md index ffc701f..536bc75 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ChirpNestBot - [ ] Transform import/export to jobs, feed msg to identification channel instead of inserting directly - [ ] Turn on/off queue consumption - [ ] Client de-registration announce -- [ ] Items parsing/identification +- [ ] Update items parsing/identification with gear details (atk/def/mana) - [ ] Auto identificate weight of items - [ ] Tribute interception - [ ] Withdrawal bot @@ -25,6 +25,7 @@ ChirpNestBot - [x] Export/import all messages - [x] Test HTML in message - [x] Update auction from broadcast +- [x] Items parsing/identification - Progression : - 0 -> 4 : Forest + Foray ; - 5 -> 10 : Forest + Foray + Arena ; \ No newline at end of file diff --git a/job.go b/job.go index f72123b..e9f5a44 100644 --- a/job.go +++ b/job.go @@ -160,13 +160,39 @@ func jobRescan(j Job) { logOnError(err, "jobRescan : Unmarshal payload") start := time.Now() + milestone := time.Now() ids := getSQLListID64(r.Query) if len(ids) > 1 { + txt := fmt.Sprintf("Rescanning %d messages.", len(ids)) + m := TGCommand{ + Type: commandReplyMsg, + Text: txt, + FromMsgID64: p.MsgID64, + FromChatID64: p.ChatID64, + } + TGCmdQueue <- m + + i := 0 for _, id := range ids { SQLMsgIdentifyQueue <- id + + i = i + 1 + if time.Now().After(milestone.Add(1 * time.Minute)) { + txt := fmt.Sprintf("Rescanned %d/%d messages.", i, len(ids)) + m = TGCommand{ + Type: commandReplyMsg, + Text: txt, + FromMsgID64: p.MsgID64, + FromChatID64: p.ChatID64, + } + TGCmdQueue <- m + milestone = time.Now() + } + } + p := JobPayloadSetDone{ JobID64: j.ID64, MsgID64: r.MsgID64, diff --git a/obj.go b/obj.go index 8642570..eb77739 100644 --- a/obj.go +++ b/obj.go @@ -622,7 +622,7 @@ func silentGetObjItemID(code string, name string) int64 { if ok, _ := regexp.MatchString(`^(a|e)[0-9]+$`, i.Code); !ok { //only gear can be custom named return true } - s := regexp.QuoteMeta(i.Name) + s := strings.ToUpper(regexp.QuoteMeta(i.Name)) m := fmt.Sprintf("^(%s.*|.*%s)$ ", s, s) if ok, _ := regexp.MatchString(m, n2); ok { return false