Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.IO;
- namespace OpticTradeBot
- {
- public partial class Form1 : Form
- {
- public Form1() // Actual launch
- {
- InitializeComponent();
- if (File.Exists(@"C:\OpticTradeBot\config\OTBautoUpdater.exe"))
- {
- Process process = new Process();
- process.StartInfo.FileName = "C:\\OpticTradeBot\\config\\OTBautoUpdater.exe";
- process.StartInfo.Arguments = "-n";
- process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
- process.Start();
- process.WaitForExit();// Waits here for the process to exit.
- // Process.Start(@"C:\OpticTradeBot\config\OTBautoUpdater.exe");
- }
- else
- {
- MessageBox.Show("The program can not update. Make sure \\config\\OTBautoUpdater.exe exists and try again.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- listBox1.Items.Add("[" + DateTime.Now + "] Program launched");
- button1.Enabled = false;
- button2.Enabled = false;
- button16.Enabled = false;
- button4.Enabled = false;
- button15.Enabled = false;
- button18.Enabled = false;
- textBox1.Enabled = false;
- textBox2.Enabled = false;
- textBox3.Enabled = false;
- button5.Enabled = false;
- button6.Enabled = false;
- button7.Enabled = false;
- button8.Enabled = false;
- button10.Enabled = false;
- button11.Enabled = false;
- button9.Enabled = false;
- button19.Enabled = false;
- button20.Enabled = false;
- button21.Enabled = false;
- button22.Enabled = false;
- checkBox1.Enabled = false;
- checkBox2.Enabled = false;
- checkBox3.Enabled = false;
- checkBox4.Enabled = false;
- button24.Enabled = false;
- button25.Enabled = false;
- button27.Enabled = false;
- button28.Enabled = false;
- textBox4.Enabled = false;
- listBox2.Items.Clear();
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat")) // Launch
- {
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Auto logged in due to existing credentials");
- button15.Enabled = false;
- string data_accname = null;
- string data_accstatus = null;
- string data_acctype = null;
- string data_accuid = null;
- string data_ltdatetime = null;
- string data_lttradeid = null;
- string data_ltutrade = null;
- string data_ltstatus = null;
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
- {
- data_accname = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_001.txt"); // accname
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_002.txt"))
- {
- data_accstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_002.txt"); // accstatus
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
- {
- data_acctype = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_003.txt"); // acctype
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
- {
- data_accuid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_004.txt"); // accuid
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_001.txt"))
- {
- data_ltdatetime = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_001.txt"); // ltdatetime
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
- {
- data_lttradeid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_002.txt"); // lttradeid
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_003.txt"))
- {
- data_ltutrade = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_003.txt"); // ltutrade
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
- {
- data_ltstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_004.txt"); // ltstatus
- }
- if (data_acctype == "9CD84851657327D9" || data_acctype == "444674CEDD4729C6" || data_acctype == "4FC5A327CA42927E")
- {
- listBox3.Items.Clear();
- listBox3.Items.Add("Developer account running");
- button24.Enabled = true;
- button25.Enabled = true;
- button27.Enabled = true;
- button28.Enabled = true;
- textBox4.Enabled = true;
- }
- else
- {
- listBox3.Items.Clear();
- listBox3.Items.Add("Your account does not have dev permissions.");
- button24.Enabled = false;
- button25.Enabled = false;
- button27.Enabled = false;
- button28.Enabled = false;
- textBox4.Enabled = false;
- }
- if (data_accuid == "null" || data_accname == "null" || data_acctype == "null")
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- MessageBox.Show("There was an error verifiying your account. The program will exit.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- listBox2.Items.Clear();
- listBox2.Items.Add("Account Info");
- listBox2.Items.Add("");
- listBox2.Items.Add("Username: " + data_accname);
- listBox2.Items.Add("Account Status: " + data_accstatus);
- if (data_acctype == "9CD84851657327D9")
- listBox2.Items.Add("Account Type: Admin"); // Admin: 9CD84851657327D9
- else if (data_acctype == "444674CEDD4729C6")
- listBox2.Items.Add("Account Type: Developer"); // Dev: 444674CEDD4729C6
- else if (data_acctype == "837D631BC9C74667")
- listBox2.Items.Add("Account Type: Lite"); // Lite: 837D631BC9C74667
- else if (data_acctype == "9BB6A981FE2C3A5E")
- listBox2.Items.Add("Account Type: Pro"); // Pro: 9BB6A981FE2C3A5E
- else if (data_acctype == "2CF8476266713C68")
- listBox2.Items.Add("Account Type: Demo"); // Demo: 2CF8476266713C68
- else if (data_acctype == "F8BE87D9B7A61341")
- listBox2.Items.Add("Account Type: Premium"); // Premium: F8BE87D9B7A61341
- else if (data_acctype == "62DCBF6F294E23DF")
- listBox2.Items.Add("Account Type: Review"); // Review: 62DCBF6F294E23DF
- else if (data_acctype == "4FC5A327CA42927E")
- listBox2.Items.Add("Account Type: Admin Bot"); // Bot: 4FC5A327CA42927E
- else if (data_acctype == "57639D64481A5F28")
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- listBox2.Items.Add("Account Type: Banned"); // Banned: 57639D64481A5F28
- MessageBox.Show("The accout you are trying to access has been banned.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- else
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- MessageBox.Show("There was an error verifiying your account. The program will exit.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- listBox2.Items.Add("User ID: " + data_accuid);
- listBox2.Items.Add("");
- listBox2.Items.Add("Latest Trade");
- listBox2.Items.Add("");
- listBox2.Items.Add("Date & Time: " + data_ltdatetime);
- listBox2.Items.Add("TradeID: " + data_lttradeid);
- listBox2.Items.Add("User Traded: " + data_ltutrade);
- listBox2.Items.Add("Status: " + data_ltstatus);
- button15.Text = "Connect";
- button18.Enabled = true;
- button1.Enabled = true;
- button2.Enabled = true;
- button16.Enabled = true;
- button4.Enabled = true;
- button14.Enabled = true;
- textBox1.Enabled = true;
- textBox2.Enabled = true;
- textBox3.Enabled = true;
- button5.Enabled = true;
- button6.Enabled = true;
- button7.Enabled = true;
- button8.Enabled = true;
- button10.Enabled = true;
- button11.Enabled = true;
- button9.Enabled = true;
- button19.Enabled = true;
- button20.Enabled = true;
- button21.Enabled = true;
- button22.Enabled = true;
- checkBox1.Enabled = true;
- checkBox2.Enabled = true;
- checkBox3.Enabled = true;
- checkBox4.Enabled = true;
- string set_SteamID = null;
- string set_SteamName = null;
- string set_ScreenSize = null;
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
- {
- set_SteamID = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
- {
- set_SteamName = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
- {
- set_ScreenSize = File.ReadAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
- }
- textBox1.Text = set_SteamID;
- textBox2.Text = set_SteamName;
- textBox3.Text = set_ScreenSize;
- }
- else
- {
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Waiting for login");
- button15.Enabled = true;
- listBox2.Items.Add("Waiting for login..");
- listBox2.Items.Add("Press 'Connect' once you have logged in.");
- button15.Text = "Connect";
- }
- }
- private void tabPage3_Click(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e) // START BOT
- {
- listBox1.Items.Add("[" + DateTime.Now + "] Bot started");
- button2.Enabled = true;
- MessageBox.Show("Started!");
- progressBar1.Value = 100;
- }
- private void button2_Click(object sender, EventArgs e) // STOP BOT
- {
- listBox1.Items.Add("[" + DateTime.Now + "] Bot stopped");
- MessageBox.Show("Stopped!");
- progressBar1.Value = 100;
- }
- private void button3_Click(object sender, EventArgs e)
- {
- Close();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- }
- private void pictureBox2_Click(object sender, EventArgs e)
- {
- }
- private void progressBar1_Click(object sender, EventArgs e)
- {
- }
- private void textBox2_TextChanged(object sender, EventArgs e) // Bot Name text entry #1
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e) // Bot SteamID64 text entry
- {
- }
- private void textBox2_TextChanged_1(object sender, EventArgs e) // Bot Name text entry #2
- {
- }
- private void textBox3_TextChanged(object sender, EventArgs e) // Screen Size text entry
- {
- }
- private void button5_Click(object sender, EventArgs e) // Save button on settings
- {
- listBox1.Items.Add("[" + DateTime.Now + "] Saving settings..");
- progressBar2.Value = 100;
- label6.Text = "Saving..";
- Update();
- listBox1.Items.Add("[" + DateTime.Now + "] Settings saved");
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\SteamID.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\SteamName.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
- }
- File.AppendAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt", textBox1 + Environment.NewLine);
- File.AppendAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt", textBox2 + Environment.NewLine);
- File.AppendAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt", textBox3 + Environment.NewLine);
- if (File.Exists(@"C:\OpticTradeBot\config\OTBsettingsCompiler.exe"))
- {
- Process.Start(@"C:\OpticTradeBot\config\OTBsettingsCompiler.exe");
- }
- System.Threading.Thread.Sleep(3000);
- label6.Text = "No Action";
- Update();
- progressBar2.Value = 0;
- }
- private void button6_Click(object sender, EventArgs e) // Reset settings button
- {
- listBox1.Items.Add("[" + DateTime.Now + "] Reset settings");
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\SteamID.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\SteamName.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
- }
- }
- private void button9_Click(object sender, EventArgs e)
- {
- }
- private void button15_Click(object sender, EventArgs e) // Connect button
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- label7.Text = "Connecting..";
- listBox2.Items.Clear();
- listBox2.Items.Add("Waiting for login..");
- listBox2.Items.Add("Press 'Connect' once you have logged in.");
- listBox2.Items.Add("");
- listBox2.Items.Add("Please Wait..");
- Update();
- System.Threading.Thread.Sleep(3000);
- listBox2.Items.Clear();
- label7.Text = "Idle";
- Update();
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Logged in (manually)");
- button15.Enabled = false;
- button18.Enabled = true;
- string data_accname = null;
- string data_accstatus = null;
- string data_acctype = null;
- string data_accuid = null;
- string data_ltdatetime = null;
- string data_lttradeid = null;
- string data_ltutrade = null;
- string data_ltstatus = null;
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
- {
- data_accname = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_001.txt"); // accname
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_002.txt"))
- {
- data_accstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_002.txt"); // accstatus
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
- {
- data_acctype = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_003.txt"); // acctype
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
- {
- data_accuid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_004.txt"); // accuid
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_001.txt"))
- {
- data_ltdatetime = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_001.txt"); // ltdatetime
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
- {
- data_lttradeid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_002.txt"); // lttradeid
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_003.txt"))
- {
- data_ltutrade = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_003.txt"); // ltutrade
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
- {
- data_ltstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_004.txt"); // ltstatus
- }
- if (data_acctype == "9CD84851657327D9" || data_acctype == "444674CEDD4729C6" || data_acctype == "4FC5A327CA42927E")
- {
- listBox3.Items.Clear();
- listBox3.Items.Add("Developer account running");
- button24.Enabled = true;
- button25.Enabled = true;
- button27.Enabled = true;
- button28.Enabled = true;
- textBox4.Enabled = true;
- }
- else
- {
- listBox3.Items.Clear();
- listBox3.Items.Add("Your account does not have dev permissions.");
- button24.Enabled = false;
- button25.Enabled = false;
- button27.Enabled = false;
- button28.Enabled = false;
- textBox4.Enabled = false;
- }
- if (data_accuid == "null" || data_accname == "null" || data_acctype == "null")
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- MessageBox.Show("There was an error verifiying your account. The program will exit.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- listBox2.Items.Clear();
- listBox2.Items.Add("Account Info");
- listBox2.Items.Add("");
- listBox2.Items.Add("Username: " + data_accname);
- listBox2.Items.Add("Account Status: " + data_accstatus);
- if (data_acctype == "9CD84851657327D9")
- listBox2.Items.Add("Account Type: Admin"); // Admin: 9CD84851657327D9
- else if (data_acctype == "444674CEDD4729C6")
- listBox2.Items.Add("Account Type: Developer"); // Dev: 444674CEDD4729C6
- else if (data_acctype == "837D631BC9C74667")
- listBox2.Items.Add("Account Type: Lite"); // Lite: 837D631BC9C74667
- else if (data_acctype == "9BB6A981FE2C3A5E")
- listBox2.Items.Add("Account Type: Pro"); // Pro: 9BB6A981FE2C3A5E
- else if (data_acctype == "2CF8476266713C68")
- listBox2.Items.Add("Account Type: Demo"); // Demo: 2CF8476266713C68
- else if (data_acctype == "F8BE87D9B7A61341")
- listBox2.Items.Add("Account Type: Premium"); // Premium: F8BE87D9B7A61341
- else if (data_acctype == "62DCBF6F294E23DF")
- listBox2.Items.Add("Account Type: Review"); // Review: 62DCBF6F294E23DF
- else if (data_acctype == "4FC5A327CA42927E")
- listBox2.Items.Add("Account Type: Admin Bot"); // Bot: 4FC5A327CA42927E
- else if (data_acctype == "57639D64481A5F28")
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- listBox2.Items.Add("Account Type: Banned"); // Banned: 57639D64481A5F28
- MessageBox.Show("The accout you are trying to access has been banned.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- else
- {
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- MessageBox.Show("There was an error verifiying your account. The program will exit.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- //MessageBoxIcon.Warning // for Warning
- MessageBoxIcon.Error // for Error
- //MessageBoxIcon.Information // for Information
- //MessageBoxIcon.Question // for Question
- );
- Close();
- }
- listBox2.Items.Add("User ID: " + data_accuid);
- listBox2.Items.Add("");
- listBox2.Items.Add("Latest Trade");
- listBox2.Items.Add("");
- listBox2.Items.Add("Date & Time: " + data_ltdatetime);
- listBox2.Items.Add("TradeID: " + data_lttradeid);
- listBox2.Items.Add("User Traded: " + data_ltutrade);
- listBox2.Items.Add("Status: " + data_ltstatus);
- button1.Enabled = true;
- button2.Enabled = true;
- button16.Enabled = true;
- button4.Enabled = true;
- button14.Enabled = true;
- textBox1.Enabled = true;
- textBox2.Enabled = true;
- textBox3.Enabled = true;
- button5.Enabled = true;
- button6.Enabled = true;
- button7.Enabled = true;
- button8.Enabled = true;
- button10.Enabled = true;
- button11.Enabled = true;
- button9.Enabled = true;
- button19.Enabled = true;
- button20.Enabled = true;
- button21.Enabled = true;
- button22.Enabled = true;
- checkBox1.Enabled = true;
- checkBox2.Enabled = true;
- checkBox3.Enabled = true;
- checkBox4.Enabled = true;
- string set_SteamID = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt");
- string set_SteamName = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt");
- string set_ScreenSize = File.ReadAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
- textBox1.Text = set_SteamID;
- textBox2.Text = set_SteamName;
- textBox3.Text = set_ScreenSize;
- }
- else
- {
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Connection declined, user not logged in (manually)");
- button18.Enabled = false;
- button15.Enabled = true;
- listBox2.Items.Clear();
- listBox2.Items.Add("Waiting for login..");
- listBox2.Items.Add("Press 'Connect' once you have logged in.");
- listBox2.Items.Add("");
- listBox2.Items.Add("Could not log you in.");
- button15.Text = "Connect";
- }
- }
- private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- private void button16_Click(object sender, EventArgs e)
- {
- }
- private void button14_Click(object sender, EventArgs e)
- {
- if (File.Exists(@"C:\OpticTradeBot\config\OTBautoUpdater.exe"))
- {
- Process process = new Process();
- process.StartInfo.FileName = "C:\\OpticTradeBot\\config\\OTBautoUpdater.exe";
- process.StartInfo.Arguments = "-n";
- process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
- process.Start();
- // Process.Start(@"C:\OpticTradeBot\config\OTBautoUpdater.exe");
- listBox1.Items.Add("[" + DateTime.Now + "] [UPDATE] Program Updating.. (manually)");
- }
- }
- private void groupBox1_Enter(object sender, EventArgs e)
- {
- }
- private void button18_Click(object sender, EventArgs e) // Disconnect button on login page
- {
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Disconnected (manually)");
- button15.Enabled = true;
- if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
- {
- File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
- }
- button18.Enabled = false;
- listBox3.Items.Clear();
- listBox3.Items.Add("Not Logged In.");
- listBox2.Items.Clear();
- listBox2.Items.Add("Waiting for login..");
- listBox2.Items.Add("Press 'Connect' once you have logged in.");
- button15.Text = "Connect";
- button1.Enabled = false;
- button2.Enabled = false;
- button16.Enabled = false;
- button4.Enabled = false;
- textBox1.Enabled = false;
- textBox2.Enabled = false;
- textBox3.Enabled = false;
- button5.Enabled = false;
- button6.Enabled = false;
- button7.Enabled = false;
- button8.Enabled = false;
- button10.Enabled = false;
- button11.Enabled = false;
- button9.Enabled = false;
- button19.Enabled = false;
- button20.Enabled = false;
- button21.Enabled = false;
- button22.Enabled = false;
- checkBox1.Enabled = false;
- checkBox2.Enabled = false;
- checkBox3.Enabled = false;
- checkBox4.Enabled = false;
- button24.Enabled = false;
- button25.Enabled = false;
- button27.Enabled = false;
- button28.Enabled = false;
- textBox4.Enabled = false;
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\temp\data_01_001.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\temp\data_01_003.txt");
- }
- if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
- {
- File.Delete(@"C:\OpticTradeBot\config\temp\data_01_004.txt");
- }
- }
- private void button17_Click(object sender, EventArgs e) // Login button on main page
- {
- listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Opened login dialog");
- if (File.Exists(@"C:\OpticTradeBot\config\OTBlogin.exe"))
- {
- Process.Start(@"C:\OpticTradeBot\config\OTBlogin.exe");
- }
- else
- {
- MessageBox.Show("Coul not start login dialouge. Make sure \\config\\OTBlogin.exe exists and try again.",
- "OpticTradeBot",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error
- );
- }
- }
- private void button12_Click(object sender, EventArgs e) // Log Clear Button
- {
- listBox1.Items.Clear();
- }
- private void button13_Click(object sender, EventArgs e) // Log Copy Button
- {
- string s1 = "";
- foreach (object item in listBox1.Items) s1 += item.ToString() + "\r\n";
- if (s1 == "")
- s1 = null;
- else
- Clipboard.SetText(s1);
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e) // Log Listbox (actual log)
- {
- }
- private void button7_Click(object sender, EventArgs e) // Load config button settings
- {
- }
- private void button23_Click(object sender, EventArgs e) // Help Button
- {
- }
- private void listBox3_SelectedIndexChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement