Exemplo n.º 1
0
        private bool AutoSearch()
        {
            try
            {
                GlobalSpecs.NeedReSearch = false;
                GlobalSpecs.RoleStartAddress.Clear();

                if (GlobalSpecs.FDPSProcess.HasExited)
                {
                    gBoxProcess.Text   = "进程   无";
                    gboxSearch.Enabled = false;
                    MessageBox.Show("游戏不存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }

                FrmAutoSerachQuestion fq = new FrmAutoSerachQuestion();
                if (fq.ShowDialog() == DialogResult.OK)
                {
                    GlobalSpecs.SearchType = fq.SearchType;
                }
                else
                {
                    return(false);
                }

                int[] magicData;
                magicData = Win32Lib.MagicDataLandis;

                Win32Lib.ProgramProcess = GlobalSpecs.FDPSProcess;
                int baseAddress = Win32Lib.SearchMemory(magicData, 1, -40);
                if (baseAddress == -1)
                {
                    magicData   = Win32Lib.MagicDataFalianNa;
                    baseAddress = Win32Lib.SearchMemory(magicData, 1, -40);
                }
                if (baseAddress == -1)
                {
                    MessageBox.Show("抱歉,没找到!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }

                string startAddress = Win32Lib.GetAddress(baseAddress);
                GlobalSpecs.SearchStartAddress = startAddress;
                GlobalSpecs.RoleStartAddress.AddRange(Win32Lib.GetAllRoleByStartAddress(startAddress));

                List <Role> friendsRoleList = new List <Role>();
                List <Role> enemyRoleList   = new List <Role>();
                List <Role> NpcRoleList     = new List <Role>();

                for (int i = 0; i < GlobalSpecs.RoleStartAddress.Count; i++)
                {
                    Role role = new Role(GlobalSpecs.RoleStartAddress[i]);
                    role.FillData();

                    if (role.M48_MaxHP.IntVal == 0 ||
                        role.M34_等级.IntVal == 0 ||
                        role.M44_移动.IntVal == 0 ||
                        role.M53_HIT.IntVal == 0 ||
                        role.M06_是否可动.IntVal == 1)
                    {
                        continue;
                    }

                    switch (role.M07_人物阵营.IntVal)
                    {
                    case 0:
                        enemyRoleList.Add(role);
                        break;

                    case 1:
                        NpcRoleList.Add(role);
                        break;

                    case 2:
                        friendsRoleList.Add(role);
                        break;

                    default:
                        break;
                    }
                }


                fLPanelFriend.Controls.Clear();
                fLPanelEnemy.Controls.Clear();
                fLPanelNPC.Controls.Clear();

                FillFlowLayoutPanel(fLPanelFriend, friendsRoleList);
                FillFlowLayoutPanel(fLPanelNPC, NpcRoleList);
                FillFlowLayoutPanel(fLPanelEnemy, enemyRoleList);

                MessageBox.Show("找到了!选角色开始改吧。", "好消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show("出错啦!" + Environment.NewLine + "去贴吧找我。记得保留存档,以及出错情况介绍 。", "坏了", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(true);
        }
Exemplo n.º 2
0
        private bool SingleSearch()
        {
            GlobalSpecs.NeedReSearch = false;
            if (GlobalSpecs.FDPSProcess.HasExited)
            {
                gBoxProcess.Text   = "进程   无";
                gboxSearch.Enabled = false;
                MessageBox.Show("游戏不存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            if (txtSNowHP.Text == "" ||
                txtSMaxHP.Text == "" ||
                txtSNowMP.Text == "" ||
                txtSMaxMP.Text == "" ||
                txtSAP.Text == "" ||
                txtSDP.Text == "")
            {
                MessageBox.Show("所有条件必须都填!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            FrmAutoSerachQuestion fq = new FrmAutoSerachQuestion();

            if (fq.ShowDialog() == DialogResult.OK)
            {
                GlobalSpecs.SearchType = fq.SearchType;
            }
            else
            {
                return(false);
            }

            //GlobalSpecs.SearchType = MemorySearchType.self;

            int lNowHP;
            int lMaxHP;
            int lNowMP;
            int lMaxMP;
            int lAP;
            int lDP;

            int.TryParse(txtSNowHP.Text, out lNowHP);
            int.TryParse(txtSMaxHP.Text, out lMaxHP);
            int.TryParse(txtSNowMP.Text, out lNowMP);
            int.TryParse(txtSMaxMP.Text, out lMaxMP);
            int.TryParse(txtSAP.Text, out lAP);
            int.TryParse(txtSDP.Text, out lDP);

            Win32Lib.ProgramProcess = GlobalSpecs.FDPSProcess;
            int[] sampleData = new int[6];
            sampleData[0] = lNowHP;
            sampleData[1] = lMaxHP;
            sampleData[2] = lNowMP;
            sampleData[3] = lMaxMP;
            sampleData[4] = lAP;
            sampleData[5] = lDP;

            int baseAddress = Win32Lib.SearchMemory(sampleData, 2, -64);

            if (baseAddress == -1)
            {
                MessageBox.Show("抱歉,没找到!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            string startAddress = Win32Lib.GetAddress(baseAddress);

            if (!Win32Lib.IsCorrectStartAddress(startAddress))
            {
                MessageBox.Show("抱歉,没找到!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            GlobalSpecs.SearchStartAddress = startAddress;

            Role role = new Role(GlobalSpecs.SearchStartAddress);

            role.FillData();

            frmRoleInfo roleInfo = new frmRoleInfo(role);

            roleInfo.ShowDialog();

            return(true);
        }