update gstock

This commit is contained in:
shoopea 2020-06-22 15:29:33 +02:00
parent 9703bb19b2
commit fa38da9749
2 changed files with 5 additions and 5 deletions

View File

@ -570,7 +570,7 @@
{
"prio": 5000,
"descn": "Guild stock any Ack",
"rule": "^Guild Warehouse:(?P<Stock>(\\n[0-9a-z]+ (.*) x ([0-9]+))+)$",
"rule": "^Guild Warehouse:(?P<Stock>(\\n[0-9a-z]+[ᵃᵇᶜᵈᵉ]{0,1} (.*) x ([0-9]+))+)$",
"msg_type": "msg_gstock_any_ack",
"chat_id": 0,
"user_id": 0

8
msg.go
View File

@ -325,14 +325,14 @@ func parseSubTypeMessageWithdrawRcv(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
func parseSubTypeMessageGStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWarsMessageGStock, error) {
cwm := ChatWarsMessageGStock{}
stock := []ChatWarsItems{}
re := regexp.MustCompile(`\n([0-9a-z]+) (.*) x ([0-9]+)`)
re := regexp.MustCompile(`\n([0-9a-z]+)([ᵃᵇᶜᵈᵉ]{0,1}) (.*) x ([0-9]+)`)
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Stock}"), -1) {
i := getObjItemID(l[1], l[2])
q, _ := strconv.ParseInt(l[3], 10, 64)
i := getObjItemID(l[1], l[3])
q, _ := strconv.ParseInt(l[4], 10, 64)
if i != 0 {
item := ChatWarsItems{
Code: l[1],
Name: l[2],
Name: l[3],
ItemID64: i,
Quantity: q,
}