上传秘境代码
This commit is contained in:
parent
530ab21db4
commit
d8a8f55e65
@ -60,23 +60,25 @@ func (f *ArenaScene) Run(ai lib.IRobot) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
Sleep(time.Second*3, time.Second*5)
|
Sleep(time.Second*3, time.Second*5)
|
||||||
if code = ai.SendMsg("arena", "challengereward", &pb.ArenaChallengeRewardReq{
|
if challenge.Code == pb.ErrorCode_Success {
|
||||||
Iswin: true,
|
if code = ai.SendMsg("arena", "challengereward", &pb.ArenaChallengeRewardReq{
|
||||||
Isai: v.Isai,
|
Iswin: true,
|
||||||
Aiintegral: v.Integral,
|
Isai: v.Isai,
|
||||||
Ainame: v.Name,
|
Aiintegral: v.Integral,
|
||||||
Report: &pb.BattleReport{
|
Ainame: v.Name,
|
||||||
Info: challenge.Info,
|
Report: &pb.BattleReport{
|
||||||
Costtime: 1,
|
Info: challenge.Info,
|
||||||
Incmd: make([]*pb.BattleCmd, 0),
|
Costtime: 1,
|
||||||
Outcmd: make([]*pb.BattleCmd, 0),
|
Incmd: make([]*pb.BattleCmd, 0),
|
||||||
Completetask: []int32{},
|
Outcmd: make([]*pb.BattleCmd, 0),
|
||||||
},
|
Completetask: []int32{},
|
||||||
}, &pb.ArenaChallengeRewardResp{}); code != pb.ErrorCode_Success {
|
},
|
||||||
ai.Stop()
|
}, &pb.ArenaChallengeRewardResp{}); code != pb.ErrorCode_Success {
|
||||||
return
|
ai.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Sleep(time.Second*1, time.Second*3)
|
||||||
}
|
}
|
||||||
Sleep(time.Second*1, time.Second*3)
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -30,19 +30,17 @@ func (f *MfantasyScene) Run(ai lib.IRobot) (err error) {
|
|||||||
battlereq *pb.MoonfantasyBattleResp = &pb.MoonfantasyBattleResp{}
|
battlereq *pb.MoonfantasyBattleResp = &pb.MoonfantasyBattleResp{}
|
||||||
)
|
)
|
||||||
|
|
||||||
if herolist := ai.Get("hero.list"); herolist == nil {
|
f.AddHero(ai, "25001") // 加阿宝
|
||||||
|
Sleep(time.Second*0, time.Second*1)
|
||||||
|
herolistreq := &pb.HeroListReq{}
|
||||||
|
herolistresp := &pb.HeroListResp{}
|
||||||
|
if code = ai.SendMsg("hero", "list", herolistreq, herolistresp); code != pb.ErrorCode_Success {
|
||||||
ai.Stop()
|
ai.Stop()
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
herolistrsp = herolist.(*pb.HeroListResp)
|
|
||||||
if herolistrsp.List == nil || len(herolistrsp.List) == 0 {
|
|
||||||
ai.Stop()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Sleep(time.Second*0, time.Second*1)
|
Sleep(time.Second*0, time.Second*1)
|
||||||
if code = ai.SendMsg("gm", "cmd", &pb.GMCmdReq{
|
if code = ai.SendMsg("gm", "cmd", &pb.GMCmdReq{
|
||||||
Cmod: "bingo:moon,1",
|
Cmod: "bingo:moon,25001",
|
||||||
}, &pb.GMCmdResp{}); code != pb.ErrorCode_Success {
|
}, &pb.GMCmdResp{}); code != pb.ErrorCode_Success {
|
||||||
ai.Stop()
|
ai.Stop()
|
||||||
}
|
}
|
||||||
@ -62,21 +60,39 @@ func (f *MfantasyScene) Run(ai lib.IRobot) (err error) {
|
|||||||
ai.Stop()
|
ai.Stop()
|
||||||
}
|
}
|
||||||
Sleep(time.Second*3, time.Second*5)
|
Sleep(time.Second*3, time.Second*5)
|
||||||
if code = ai.SendMsg("moonfantasy", "receive", &pb.MoonfantasyReceiveReq{
|
if battlereq.Code == pb.ErrorCode_Success {
|
||||||
Report: &pb.BattleReport{
|
if code = ai.SendMsg("moonfantasy", "receive", &pb.MoonfantasyReceiveReq{
|
||||||
Info: battlereq.Info,
|
Report: &pb.BattleReport{
|
||||||
Costtime: 1,
|
Info: battlereq.Info,
|
||||||
Incmd: make([]*pb.BattleCmd, 0),
|
Costtime: 1,
|
||||||
Outcmd: make([]*pb.BattleCmd, 0),
|
Incmd: make([]*pb.BattleCmd, 0),
|
||||||
Completetask: []int32{},
|
Outcmd: make([]*pb.BattleCmd, 0),
|
||||||
},
|
Completetask: []int32{},
|
||||||
}, &pb.MoonfantasyReceiveResp{}); code != pb.ErrorCode_Success {
|
},
|
||||||
ai.Stop()
|
}, &pb.MoonfantasyReceiveResp{}); code != pb.ErrorCode_Success {
|
||||||
return
|
ai.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Sleep(time.Second, time.Second*3)
|
||||||
}
|
}
|
||||||
Sleep(time.Second, time.Second*3)
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加英雄
|
||||||
|
func (f *MfantasyScene) AddHero(robot lib.IRobot, cid string) error {
|
||||||
|
var (
|
||||||
|
code pb.ErrorCode
|
||||||
|
)
|
||||||
|
req := &pb.GMCmdReq{
|
||||||
|
Cmod: "bingo:hero," + cid + ",1",
|
||||||
|
}
|
||||||
|
rsp := &pb.GMCmdResp{}
|
||||||
|
code = robot.SendMsg("gm", "cmd", req, rsp)
|
||||||
|
if code != pb.ErrorCode_Success {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user