| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- 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 {}
- }
|