fix craft all

This commit is contained in:
shoopea 2020-01-30 12:44:35 +08:00
parent d5c92d6afd
commit 0733e158c0

59
job.go
View File

@ -1990,39 +1990,40 @@ func jobCraftAll(j Job) {
}
/* we can finish the job */
out := fmt.Sprintf("<code>Summary for %d %s\n", p.Quantity, item.Names[0])
out = fmt.Sprintf("%s Mana : %d\n", out, totalMana)
out = fmt.Sprintf("%s Items :\n", out)
for k, v := range requiredItems {
obj, _ := getObjItem(getObjItemID(k, ``))
ava, _ := availableItems[k]
out = fmt.Sprintf("%s [%s] %s : %d (%d)\n", out, obj.Code, obj.Names[0], v, ava)
}
out = fmt.Sprintf("%s Missing :\n", out)
for k, v := range missingItems {
if v > 0 {
/*
out := fmt.Sprintf("<code>Summary for %d %s\n", p.Quantity, item.Names[0])
out = fmt.Sprintf("%s Mana : %d\n", out, totalMana)
out = fmt.Sprintf("%s Items :\n", out)
for k, v := range requiredItems {
obj, _ := getObjItem(getObjItemID(k, ``))
out = fmt.Sprintf("%s [%s] %s : %d\n", out, obj.Code, obj.Names[0], v)
ava, _ := availableItems[k]
out = fmt.Sprintf("%s [%s] %s : %d (%d)\n", out, obj.Code, obj.Names[0], v, ava)
}
}
out = fmt.Sprintf("%s To craft :\n", out)
for k, v := range craftItems {
if v > 0 {
obj, _ := getObjItem(getObjItemID(k, ``))
out = fmt.Sprintf("%s [%s] %s : %d\n", out, obj.Code, obj.Names[0], v)
out = fmt.Sprintf("%s Missing :\n", out)
for k, v := range missingItems {
if v > 0 {
obj, _ := getObjItem(getObjItemID(k, ``))
out = fmt.Sprintf("%s [%s] %s : %d\n", out, obj.Code, obj.Names[0], v)
}
}
}
out = fmt.Sprintf("%s</code>", out)
c := TGCommand{
Type: commandReplyMsg,
Text: out,
FromMsgID64: p.MsgID64,
FromChatID64: p.ChatID64,
ParseMode: cmdParseModeHTML,
}
TGCmdQueue <- c
out = fmt.Sprintf("%s To craft :\n", out)
for k, v := range craftItems {
if v > 0 {
obj, _ := getObjItem(getObjItemID(k, ``))
out = fmt.Sprintf("%s [%s] %s : %d\n", out, obj.Code, obj.Names[0], v)
}
}
out = fmt.Sprintf("%s</code>", out)
c := TGCommand{
Type: commandReplyMsg,
Text: out,
FromMsgID64: p.MsgID64,
FromChatID64: p.ChatID64,
ParseMode: cmdParseModeHTML,
}
TGCmdQueue <- c
*/
err = setJobDone(j.ID64)
logOnError(err, "jobCraftItem : setJobDone")