Exemplo n.º 1
0
    private void AutoScript(string statClassName)
    {
        TextBox_Result.Clear();

        Task.Run(() =>
        {
            try
            {
                int index = StatData.StatDataClass.FindIndex(t => t.ClassName == statClassName);
                if (index != -1)
                {
                    AppendTextBox($"正在执行 {StatData.StatDataClass[index].ClassName} 脚本代码");

                    for (int i = 0; i < StatData.StatDataClass[index].StatInfo.Count; i++)
                    {
                        AppendTextBox($"正在执行 第 {i + 1}/{StatData.StatDataClass[index].StatInfo.Count} 条代码");

                        Hacks.WriteStat(StatData.StatDataClass[index].StatInfo[i].Hash, StatData.StatDataClass[index].StatInfo[i].Value);
                        Task.Delay(500).Wait();
                    }

                    AppendTextBox($"{StatData.StatDataClass[index].ClassName} 脚本代码执行完毕");
                }
            }
            catch (Exception ex)
            {
                AppendTextBox($"错误:{ex.Message}");
            }
        });
    }
Exemplo n.º 2
0
        private void Enter_2_Click(object sender, RoutedEventArgs e)
        {
            if (TextBox_Result.Text == "0")
            {
                TextBox_Result.Clear();
            }

            TextBox_Result.Text = TextBox_Result.Text + "2";
        }
Exemplo n.º 3
0
 private void Enter_History_Click(object sender, RoutedEventArgs e)
 {
     if (TextBox_Result.Text == "0")
     {
         TextBox_Result.Clear();
     }
     i = Int32.Parse(TextBox_Result.Text);
     OperationPreformed  = 'N';
     TextBox_Result.Text = "";
 }
Exemplo n.º 4
0
        private void button_click(object sender, EventArgs e)
        {
            if ((TextBox_Result.Text == "0") || (isOperationPerformed))
            {
                TextBox_Result.Clear();     // забирає 0 при кліку
            }
            Button button = (Button)sender; // виводить клік в TextBox_Result

            if (button.Text == ".")         // не дозволяє нажимати багато разів "."
            {
                if (!TextBox_Result.Text.Contains("."))
                {
                    TextBox_Result.Text = TextBox_Result.Text + button.Text;
                }
            }
            else
            {
                TextBox_Result.Text = TextBox_Result.Text + button.Text;
            }

            isOperationPerformed = false;
        }
Exemplo n.º 5
0
        private void Button_Click(object sender, EventArgs e)
        {
            //Function that gets the button that we click
            if (isEqualPerformed || isSinPerformed || isCosPerformed ||
                isOneOverXPerformed || isSquarePerformed || isSquareRootPerformed)
            {
                //Set everything to false for optimaization of use
                TextBox_Result.Text   = "";
                resultValue           = 0;
                isEqualPerformed      = false;
                isSinPerformed        = false;
                isCosPerformed        = false;
                isOneOverXPerformed   = false;
                isSquarePerformed     = false;
                isSquareRootPerformed = false;
            }

            if ((TextBox_Result.Text == "0") || isOperationPerformed)
            {
                TextBox_Result.Clear();
            }
            isOperationPerformed = false;
            Button button = (Button)sender;

            //Take care of point (.)
            if (button.Text == ".")
            {
                if (!TextBox_Result.Text.Contains("."))
                {
                    TextBox_Result.Text = TextBox_Result.Text + button.Text;
                }
            }
            else
            {
                TextBox_Result.Text = TextBox_Result.Text + button.Text;
            }
        }