コード例 #1
0
ファイル: Form1.cs プロジェクト: Softwaretemp/SC2ExternalHack
        //Catch exception (when no SC2 is found)
        private void CallException()
        {
            HackAlreadyRunning();

            var bcheck = false;

            var pc = Process.GetProcesses();
            for (var i = 0; i < pc.Length; i++)
            {
                if (pc[i].ProcessName == "SC2")
                {
                    _pvView = new ProcessView("SC2");
                    _pcPointer = new PointerScan("SC2");
                    bcheck = true;
                    break;
                }
            }

            if (bcheck == false)
            {
                tmrTick.Enabled = false;
                MessageBox.Show("SC2 not found!", "Failure!");
                Close();
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Softwaretemp/SC2ExternalHack
        //Refresh the form
        private void TmrTickTick(object sender, EventArgs e)
        {
            try
            {
                #region PlayerInfo Intro

                //Catch the Playeramount, call the method with 0 players
                _pInfor = new PlayerInfo(0);
                //Create new pInfo and fill it with data (to call it only once)
                _pInfoPlayer = new List<PlayerInfo>();

                //Fill with Data
                for (var i = 0; i < _pInfor.PlayerAmount; i++)
                    _pInfoPlayer.Add(new PlayerInfo(i));

                #endregion

                #region UnitInfo Intro

                if (pnlMaphack.Enabled || pnlProduction.Enabled)
                {
                    //Catch the Unitamount
                    _uInfor = new UnitInfo(0);
                    //Create new uInfo and fill the Data
                    _uInfoUnit = new List<UnitInfo>();

                    //Fill with Data
                    for (var r = 0; r < _uInfor.TotalUnits; r++)
                        _uInfoUnit.Add(new UnitInfo(r));
                }

                #endregion

                _pvView = new ProcessView("SC2");
                if (!_pvView.ProcessAviable())
                    Application.Exit();

                if (_pvView.ProcessInForeground())
                    TopMost = true;

                //Proof for the panels (to safe ressources)
                if (pnlWorkers.Enabled)
                    pnlWorkers.Invalidate();

                if (pnlRessources.Enabled)
                    pnlRessources.Invalidate();

                if (pnlIncome.Enabled)
                    pnlIncome.Invalidate();

                if (pnlStates.Enabled)
                    pnlStates.Invalidate();

                if (pnlMaphack.Enabled)
                    pnlMaphack.Invalidate();

                if (pnlAPM.Enabled)
                    pnlAPM.Invalidate();

                if (pnlArmy.Enabled)
                    pnlArmy.Invalidate();

                if (pnlNotification.Enabled)
                    pnlNotification.Invalidate();

                AdjustPanelHeight();    //Adjust the height of the Panels
                //AutoInject();           //Calls the Autoinject- method
                //AutoCreepGroup();
            }

            catch { new Exception(); }
        }