test recipe in crafting stock
This commit is contained in:
parent
31c9022da8
commit
9a5f62b4c7
5
msg.go
5
msg.go
@ -59,8 +59,10 @@ func parseSubTypeMessageStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
|
|||||||
cwm := ChatWarsMessageStockAnyAck{}
|
cwm := ChatWarsMessageStockAnyAck{}
|
||||||
items := []ChatWarsItems{}
|
items := []ChatWarsItems{}
|
||||||
|
|
||||||
re := regexp.MustCompile(`([a-zA-Z ]+) \(([0-9]+)\)\n{0,1}`)
|
re := regexp.MustCompile(`(📃){0,1}([a-zA-Z ]+) \(([0-9]+)\)( /view_[a-z0-9]+){0,1}\n{0,1}`)
|
||||||
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Items}"), -1) {
|
for _, l := range re.FindAllStringSubmatch(r.ReplaceAllString(m.Text, "${Items}"), -1) {
|
||||||
|
fmt.Printf("parseSubTypeMessageStockAnyAck : %+q\n", l)
|
||||||
|
/*
|
||||||
i := getObjItemID(``, l[1])
|
i := getObjItemID(``, l[1])
|
||||||
q, _ := strconv.ParseInt(l[2], 10, 64)
|
q, _ := strconv.ParseInt(l[2], 10, 64)
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
@ -70,6 +72,7 @@ func parseSubTypeMessageStockAnyAck(m *ChatWarsMessage, r *regexp.Regexp) (*Chat
|
|||||||
}
|
}
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
cwm.Stock = items
|
cwm.Stock = items
|
||||||
|
2
rules.go
2
rules.go
@ -200,7 +200,7 @@ func resetMsgParsingRules() {
|
|||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageEquipStockReq) + `, "Equipment Stock Req", "^🏷Equipment$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageEquipStockReq) + `, "Equipment Stock Req", "^🏷Equipment$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageCraftStockReq) + `, "Crafting Stock Req", "^⚒Crafting$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageCraftStockReq) + `, "Crafting Stock Req", "^⚒Crafting$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageStockEmpty) + `, "Stock Empty", "^\\[empty\\]$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageStockEmpty) + `, "Stock Empty", "^\\[empty\\]$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageStockAnyAck) + `, "Any Stock Ack", "^(?P<Items>(([a-zA-Z ]+ \\([0-9]+\\)\\n{0,1})+))$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageStockAnyAck) + `, "Any Stock Ack", "^(?P<Items>(([a-zA-Z 📃]+ \\([0-9]+\\)( /view_[a-z0-9]+){0,1}\\n{0,1})+))$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositReq) + `, "GDeposit Req", "^/g_deposit (?P<Item>[a-z0-9]+) (?P<Quantity>[0-9]+)$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositReq) + `, "GDeposit Req", "^/g_deposit (?P<Item>[a-z0-9]+) (?P<Quantity>[0-9]+)$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositAck) + `, "GDeposit Ack #2", "^Deposited successfully: (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\)$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositAck) + `, "GDeposit Ack #2", "^Deposited successfully: (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\)$")
|
||||||
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositAck) + `, "GDeposit Ack #1", "^Deposited (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\) successfully$")
|
,(5000, ` + strconv.Itoa(objSubTypeMessageGDepositAck) + `, "GDeposit Ack #1", "^Deposited (?P<Item>.*) \\((?P<Quantity>[0-9]+)\\) successfully$")
|
||||||
|
Loading…
Reference in New Issue
Block a user