コード例 #1
0
        void OnTimerTick(object obj, EventArgs args)
        {
            if (pd == null)
            {
                return;
            }

            var newState = Keyboard.IsKeyDown(toggleTreesKey);

            if (newState == toggleState)
            {
                return;
            }

            toggleState = newState;

            if (!noTreesCheckBox.Checked || !inBothModesCheckBox.Checked)
            {
                return;
            }

            pd.RefreshMemory();
            if (pd.HasExited)
            {
                return;
            }

            using (var suspender = pd.MakeSuspender())
            {
                if (toggleState)
                {
                    AlwaysSniperBP.Enabled = false;
                    TreeRaidusBp.Enabled   = false;

                    AlwaysSniperBP.WriteVals(false, pd);
                    TreeRaidusBp.WriteVals(10, 15, pd);
                }
                else
                {
                    AlwaysSniperBP.Enabled = true;
                    TreeRaidusBp.Enabled   = true;

                    AlwaysSniperBP.WriteVals(true, pd);
                    TreeRaidusBp.WriteVals(1000, 1000, pd);
                }
            }
        }