package main import ( "f1-game/internal/constant" "f1-game/internal/enum" "f1-game/tool/client-cli/cli" "testing" "time" ) func testLgySetup() *cli.Robot { var ( // loginURL = "http://dev.f1.chun-pu.com" // gateAddr = "192.168.1.232:30001" // gateAddr = "192.168.1.225:30001" // pid = "2188001" // serverId = "1" loginURL = "http://127.0.0.1:18080" gateAddr = "127.0.0.1:30001" pid = "2188002" serverId = "2" account = "nico005" password = "123456" ) cli.RegisterDevAccount(loginURL, account, password) robot := cli.EnterServer(loginURL, pid, account, password, gateAddr, serverId, true) return robot } func TestLgyMain(t *testing.T) { robot := testLgySetup() // robot.Time() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapSiegeRank(10002) // robot.GmAssetGet(39999, 10) select {} } func TestLgyNewMapLogin(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.BornStateInfo() time.Sleep(3 * time.Second) robot.SelectState(1) time.Sleep(3 * time.Second) robot.MapEnter() time.Sleep(3 * time.Second) select {} } func TestLgyReinforce(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapEnter() time.Sleep(3 * time.Second) robot.Reinforce() time.Sleep(3 * time.Second) // robot.ReinforceCancel() // time.Sleep(3 * time.Second) select {} } func TestLgyMapComeback(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapComeback(true, 0) time.Sleep(3 * time.Second) robot.MapComeback(false, 0) time.Sleep(3 * time.Second) // robot.GmAssetGet(39999, 10) select {} } func TestLordUpgrade(t *testing.T) { robot := testLgySetup() robot.GmAssetGet(10001, 1000) select {} } func TestLgyHero(t *testing.T) { robot := testLgySetup() // robot.HeroStar( // 1050922, // 1050932, // 1050933, // 1050934, // 1050935, // 1050936, // 1050937, // ) robot.HeroSkillUp(1050922, 3999901) select {} } func TestItemUse(t *testing.T) { robot := testLgySetup() robot.ItemUse(119997, 1) time.Sleep(500 * time.Millisecond) select {} } func TestQuest(t *testing.T) { robot := testLgySetup() robot.QuestGetReward(1001000) select {} } func TestEquip(t *testing.T) { robot := testLgySetup() // robot.EquipCraft(301611) // robot.EquipCraft(301512) // robot.EquipRandomCraft() // robot.EquipEnhance(1050912, true) // robot.EquipDimantle(1048587, 1048588) robot.EquipSkillActive(1050921) select {} } func TestLgyLeaguePoint(t *testing.T) { robot := testLgySetup() robot.CreateLeague("我的联盟1", "我1", 101, 201) // robot.JoinLeague(1875) select {} } func TestLgyEnterMap(t *testing.T) { robot := testLgySetup() time.Sleep(3 * time.Second) robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapSlide(57, 755) time.Sleep(3 * time.Second) // robot.MapQuit() // time.Sleep(3 * time.Second) // robot.MapSlide(164, 751) // time.Sleep(3 * time.Second) // robot.MapSlide(82, 820) // time.Sleep(3 * time.Second) // robot.MapLeave() // time.Sleep(3 * time.Second) // robot.MapSlide(164, 751) // time.Sleep(3 * time.Second) // robot.MapSlide(280, 790) // time.Sleep(3 * time.Second) // robot.MapSlide(313, 951) // time.Sleep(3 * time.Second) // robot.MapSlide(48, 964) select {} } func TestLgyMapMarchSiege(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapMarch(1, enum.MarchType_Siege, 696, 255, false, 10003) time.Sleep(3 * time.Second) robot.MapMarch(2, enum.MarchType_Siege, 696, 255, false, 10003) time.Sleep(3 * time.Second) robot.MapMarch(3, enum.MarchType_Siege, 696, 255, false, 10003) time.Sleep(3 * time.Second) select {} } func TestLgyMapSiegeAssemble(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapSiegeAssemble(1, 10016, true) time.Sleep(3 * time.Second) robot.MapSiegeAssemble(2, 10016, true) time.Sleep(3 * time.Second) robot.MapSiegeAssemble(3, 10016, false) time.Sleep(3 * time.Second) select {} } func TestLgyTeam(t *testing.T) { robot := testLgySetup() robot.TeamUp(1052265, 2, 1, 1) time.Sleep(3 * time.Second) select {} } func TestLgyMapRes(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) // robot.MapMarch(1, enum.MarchType_Occupy, 77, 708, true, false) // time.Sleep(3 * time.Second) // robot.MapDiscard(2409, enum.ObjectType_Res) select {} } func TestLgyMapBuild(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) // 地基 // robot.MapPlayerBuild(constant.MapBuild_Camp, 857, 28) // robot.MapDiscard(21228, enum.ObjectType_Build) robot.MapLeagueBuild(constant.MapBuild_LeagueFlag, 857, 28) // robot.MapLeagueBuild(constant.MapBuild_LeaguePoint, 733, 33) // 攻城大营 // robot.MapLeagueBuild(constant.MapBuild_SiegeCamp, 63, 755) // 联盟大营 // robot.MapLeagueBuild(constant.MapBuild_LeaguePoint, 14, 769) select {} } func TestLgyMapRelocate(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapRelocate(31466) // robot.MapRelocateBack() select {} } func TestLgyMapStartWar(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapStartWar(10002, 1) time.Sleep(3 * time.Second) select {} } func TestLgyMapLeague(t *testing.T) { robot := testLgySetup() robot.JoinLeague(1000000) select {} } func TestLgyMapResArmies(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapResArmies(10172) select {} } func TestLgyMapAssemble(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.AssembleList() time.Sleep(3 * time.Second) robot.AssembleStop(24306) time.Sleep(3 * time.Second) robot.AssembleList() time.Sleep(3 * time.Second) // robot.Assemble(&pb.MapAssembleRequest{ // TeamID: 1, // ObjectID: 15163, // ObjectType: int32(enum.ObjectType_Monster), // Point: &pb.Point{ // X: 333, // Y: 878, // }, // AssembleTime: 5, // }) // time.Sleep(3 * time.Second) // robot.AssembleJoin(1, 23840) // time.Sleep(3 * time.Second) select {} } func TestMapWar(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapJoin() time.Sleep(3 * time.Second) robot.MapWarList() time.Sleep(3 * time.Second) select {} } func TestDiscardCancel(t *testing.T) { robot := testLgySetup() robot.MapLogin() time.Sleep(3 * time.Second) robot.MapDiscardCancelPlayer(10001, enum.ObjectType_Res) time.Sleep(3 * time.Second) robot.MapDiscardCancelLeague(10002, enum.ObjectType_Build) select {} }