Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 32.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Diagnostics;
  11. using System.IO;
  12.  
  13. namespace OpticTradeBot
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1() // Actual launch
  18.         {
  19.             InitializeComponent();
  20.             if (File.Exists(@"C:\OpticTradeBot\config\OTBautoUpdater.exe"))
  21.             {
  22.                 Process process = new Process();
  23.                 process.StartInfo.FileName = "C:\\OpticTradeBot\\config\\OTBautoUpdater.exe";
  24.                 process.StartInfo.Arguments = "-n";
  25.                 process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
  26.                 process.Start();
  27.                 process.WaitForExit();// Waits here for the process to exit.
  28.                 // Process.Start(@"C:\OpticTradeBot\config\OTBautoUpdater.exe");
  29.             }
  30.             else
  31.             {
  32.                 MessageBox.Show("The program can not update. Make sure \\config\\OTBautoUpdater.exe exists and try again.",
  33.                 "OpticTradeBot",
  34.                 MessageBoxButtons.OK,
  35.                 //MessageBoxIcon.Warning // for Warning  
  36.                 MessageBoxIcon.Error // for Error
  37.                 //MessageBoxIcon.Information  // for Information
  38.                 //MessageBoxIcon.Question // for Question
  39.                 );
  40.                 Close();
  41.             }
  42.             listBox1.Items.Add("[" + DateTime.Now + "] Program launched");
  43.             button1.Enabled = false;
  44.             button2.Enabled = false;
  45.             button16.Enabled = false;
  46.             button4.Enabled = false;
  47.             button15.Enabled = false;
  48.             button18.Enabled = false;
  49.             textBox1.Enabled = false;
  50.             textBox2.Enabled = false;
  51.             textBox3.Enabled = false;
  52.             button5.Enabled = false;
  53.             button6.Enabled = false;
  54.             button7.Enabled = false;
  55.             button8.Enabled = false;
  56.             button10.Enabled = false;
  57.             button11.Enabled = false;
  58.             button9.Enabled = false;
  59.             button19.Enabled = false;
  60.             button20.Enabled = false;
  61.             button21.Enabled = false;
  62.             button22.Enabled = false;
  63.             checkBox1.Enabled = false;
  64.             checkBox2.Enabled = false;
  65.             checkBox3.Enabled = false;
  66.             checkBox4.Enabled = false;
  67.             button24.Enabled = false;
  68.             button25.Enabled = false;
  69.             button27.Enabled = false;
  70.             button28.Enabled = false;
  71.             textBox4.Enabled = false;
  72.             listBox2.Items.Clear();
  73.             if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat")) // Launch
  74.             {
  75.                 listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Auto logged in due to existing credentials");
  76.                 button15.Enabled = false;
  77.                 string data_accname = null;
  78.                 string data_accstatus = null;
  79.                 string data_acctype = null;
  80.                 string data_accuid = null;
  81.                 string data_ltdatetime = null;
  82.                 string data_lttradeid = null;
  83.                 string data_ltutrade = null;
  84.                 string data_ltstatus = null;
  85.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
  86.                 {
  87.                     data_accname = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_001.txt"); // accname
  88.                 }
  89.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_002.txt"))
  90.                 {
  91.                     data_accstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_002.txt"); // accstatus
  92.                 }
  93.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
  94.                 {
  95.                     data_acctype = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_003.txt"); // acctype
  96.                 }
  97.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
  98.                 {
  99.                     data_accuid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_004.txt"); // accuid
  100.                 }
  101.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_001.txt"))
  102.                 {
  103.                     data_ltdatetime = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_001.txt"); // ltdatetime
  104.                 }
  105.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
  106.                 {
  107.                     data_lttradeid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_002.txt"); // lttradeid
  108.                 }
  109.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_003.txt"))
  110.                 {
  111.                     data_ltutrade = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_003.txt"); // ltutrade
  112.                 }
  113.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
  114.                 {
  115.                     data_ltstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_004.txt"); // ltstatus
  116.                 }
  117.                 if (data_acctype == "9CD84851657327D9" || data_acctype == "444674CEDD4729C6" || data_acctype == "4FC5A327CA42927E")
  118.                 {
  119.                     listBox3.Items.Clear();
  120.                     listBox3.Items.Add("Developer account running");
  121.                     button24.Enabled = true;
  122.                     button25.Enabled = true;
  123.                     button27.Enabled = true;
  124.                     button28.Enabled = true;
  125.                     textBox4.Enabled = true;
  126.                 }
  127.                 else
  128.                 {
  129.                     listBox3.Items.Clear();
  130.                     listBox3.Items.Add("Your account does not have dev permissions.");
  131.                     button24.Enabled = false;
  132.                     button25.Enabled = false;
  133.                     button27.Enabled = false;
  134.                     button28.Enabled = false;
  135.                     textBox4.Enabled = false;
  136.                 }
  137.                 if (data_accuid == "null" || data_accname == "null" || data_acctype == "null")
  138.                 {
  139.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  140.                     {
  141.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  142.                     }
  143.                     MessageBox.Show("There was an error verifiying your account. The program will exit.",
  144.                     "OpticTradeBot",
  145.                     MessageBoxButtons.OK,
  146.                     //MessageBoxIcon.Warning // for Warning  
  147.                     MessageBoxIcon.Error // for Error
  148.                     //MessageBoxIcon.Information  // for Information
  149.                     //MessageBoxIcon.Question // for Question
  150.                     );
  151.                     Close();
  152.                 }
  153.                 listBox2.Items.Clear();
  154.                 listBox2.Items.Add("Account Info");
  155.                 listBox2.Items.Add("");
  156.                 listBox2.Items.Add("Username: " + data_accname);
  157.                 listBox2.Items.Add("Account Status: " + data_accstatus);
  158.                 if (data_acctype == "9CD84851657327D9")
  159.                     listBox2.Items.Add("Account Type: Admin"); // Admin: 9CD84851657327D9
  160.                 else if (data_acctype == "444674CEDD4729C6")
  161.                     listBox2.Items.Add("Account Type: Developer"); // Dev: 444674CEDD4729C6
  162.                 else if (data_acctype == "837D631BC9C74667")
  163.                     listBox2.Items.Add("Account Type: Lite"); // Lite: 837D631BC9C74667
  164.                 else if (data_acctype == "9BB6A981FE2C3A5E")
  165.                     listBox2.Items.Add("Account Type: Pro"); // Pro: 9BB6A981FE2C3A5E
  166.                 else if (data_acctype == "2CF8476266713C68")
  167.                     listBox2.Items.Add("Account Type: Demo"); // Demo: 2CF8476266713C68
  168.                 else if (data_acctype == "F8BE87D9B7A61341")
  169.                     listBox2.Items.Add("Account Type: Premium"); // Premium: F8BE87D9B7A61341
  170.                 else if (data_acctype == "62DCBF6F294E23DF")
  171.                     listBox2.Items.Add("Account Type: Review"); // Review: 62DCBF6F294E23DF
  172.                 else if (data_acctype == "4FC5A327CA42927E")
  173.                     listBox2.Items.Add("Account Type: Admin Bot"); // Bot: 4FC5A327CA42927E
  174.                 else if (data_acctype == "57639D64481A5F28")
  175.                 {
  176.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  177.                     {
  178.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  179.                     }
  180.                     listBox2.Items.Add("Account Type: Banned"); // Banned: 57639D64481A5F28
  181.                     MessageBox.Show("The accout you are trying to access has been banned.",
  182.                     "OpticTradeBot",
  183.                     MessageBoxButtons.OK,
  184.                     //MessageBoxIcon.Warning // for Warning  
  185.                     MessageBoxIcon.Error // for Error
  186.                     //MessageBoxIcon.Information  // for Information
  187.                     //MessageBoxIcon.Question // for Question
  188.                     );
  189.                     Close();
  190.                 }
  191.                 else
  192.                 {
  193.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  194.                     {
  195.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  196.                     }
  197.                     MessageBox.Show("There was an error verifiying your account. The program will exit.",
  198.                     "OpticTradeBot",
  199.                     MessageBoxButtons.OK,
  200.                     //MessageBoxIcon.Warning // for Warning  
  201.                     MessageBoxIcon.Error // for Error
  202.                     //MessageBoxIcon.Information  // for Information
  203.                     //MessageBoxIcon.Question // for Question
  204.                     );
  205.                     Close();
  206.                 }
  207.                 listBox2.Items.Add("User ID: " + data_accuid);
  208.                 listBox2.Items.Add("");
  209.                 listBox2.Items.Add("Latest Trade");
  210.                 listBox2.Items.Add("");
  211.                 listBox2.Items.Add("Date & Time: " + data_ltdatetime);
  212.                 listBox2.Items.Add("TradeID: " + data_lttradeid);
  213.                 listBox2.Items.Add("User Traded: " + data_ltutrade);
  214.                 listBox2.Items.Add("Status: " + data_ltstatus);
  215.                 button15.Text = "Connect";
  216.                 button18.Enabled = true;
  217.                 button1.Enabled = true;
  218.                 button2.Enabled = true;
  219.                 button16.Enabled = true;
  220.                 button4.Enabled = true;
  221.                 button14.Enabled = true;
  222.                 textBox1.Enabled = true;
  223.                 textBox2.Enabled = true;
  224.                 textBox3.Enabled = true;
  225.                 button5.Enabled = true;
  226.                 button6.Enabled = true;
  227.                 button7.Enabled = true;
  228.                 button8.Enabled = true;
  229.                 button10.Enabled = true;
  230.                 button11.Enabled = true;
  231.                 button9.Enabled = true;
  232.                 button19.Enabled = true;
  233.                 button20.Enabled = true;
  234.                 button21.Enabled = true;
  235.                 button22.Enabled = true;
  236.                 checkBox1.Enabled = true;
  237.                 checkBox2.Enabled = true;
  238.                 checkBox3.Enabled = true;
  239.                 checkBox4.Enabled = true;
  240.                 string set_SteamID = null;
  241.                 string set_SteamName = null;
  242.                 string set_ScreenSize = null;
  243.                 if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
  244.                 {
  245.                     set_SteamID = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt");
  246.                 }
  247.                 if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
  248.                 {
  249.                     set_SteamName = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt");
  250.                 }
  251.                 if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
  252.                 {
  253.                     set_ScreenSize = File.ReadAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
  254.                 }
  255.  
  256.                 textBox1.Text = set_SteamID;
  257.                 textBox2.Text = set_SteamName;
  258.                 textBox3.Text = set_ScreenSize;
  259.             }
  260.             else
  261.             {
  262.                 listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Waiting for login");
  263.                 button15.Enabled = true;
  264.                 listBox2.Items.Add("Waiting for login..");
  265.                 listBox2.Items.Add("Press 'Connect' once you have logged in.");
  266.                 button15.Text = "Connect";
  267.             }
  268.         }
  269.  
  270.         private void tabPage3_Click(object sender, EventArgs e)
  271.         {
  272.  
  273.         }
  274.  
  275.         private void button1_Click(object sender, EventArgs e) // START BOT
  276.         {
  277.             listBox1.Items.Add("[" + DateTime.Now + "] Bot started");
  278.             button2.Enabled = true;
  279.             MessageBox.Show("Started!");
  280.             progressBar1.Value = 100;
  281.         }
  282.  
  283.         private void button2_Click(object sender, EventArgs e) // STOP BOT
  284.         {
  285.             listBox1.Items.Add("[" + DateTime.Now + "] Bot stopped");
  286.             MessageBox.Show("Stopped!");
  287.             progressBar1.Value = 100;
  288.         }
  289.  
  290.         private void button3_Click(object sender, EventArgs e)
  291.         {
  292.             Close();
  293.         }
  294.  
  295.         private void button4_Click(object sender, EventArgs e)
  296.         {
  297.  
  298.         }
  299.  
  300.         private void pictureBox2_Click(object sender, EventArgs e)
  301.         {
  302.  
  303.         }
  304.  
  305.         private void progressBar1_Click(object sender, EventArgs e)
  306.         {
  307.  
  308.         }
  309.  
  310.  
  311.         private void textBox2_TextChanged(object sender, EventArgs e) // Bot Name text entry #1
  312.         {
  313.  
  314.         }
  315.  
  316.         private void textBox1_TextChanged(object sender, EventArgs e) // Bot SteamID64 text entry
  317.         {
  318.  
  319.         }
  320.         private void textBox2_TextChanged_1(object sender, EventArgs e) // Bot Name text entry #2
  321.         {
  322.  
  323.         }
  324.         private void textBox3_TextChanged(object sender, EventArgs e) // Screen Size text entry
  325.         {
  326.  
  327.         }
  328.         private void button5_Click(object sender, EventArgs e) // Save button on settings
  329.         {
  330.             listBox1.Items.Add("[" + DateTime.Now + "] Saving settings..");
  331.             progressBar2.Value = 100;
  332.             label6.Text = "Saving..";
  333.             Update();
  334.             listBox1.Items.Add("[" + DateTime.Now + "] Settings saved");
  335.             if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
  336.             {
  337.                 File.Delete(@"C:\OpticTradeBot\config\settings\SteamID.txt");
  338.             }
  339.             if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
  340.             {
  341.                 File.Delete(@"C:\OpticTradeBot\config\settings\SteamName.txt");
  342.             }
  343.             if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
  344.             {
  345.                 File.Delete(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
  346.             }
  347.             File.AppendAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt", textBox1 + Environment.NewLine);
  348.             File.AppendAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt", textBox2 + Environment.NewLine);
  349.             File.AppendAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt", textBox3 + Environment.NewLine);
  350.             if (File.Exists(@"C:\OpticTradeBot\config\OTBsettingsCompiler.exe"))
  351.             {
  352.                 Process.Start(@"C:\OpticTradeBot\config\OTBsettingsCompiler.exe");
  353.             }
  354.             System.Threading.Thread.Sleep(3000);
  355.             label6.Text = "No Action";
  356.             Update();
  357.             progressBar2.Value = 0;
  358.         }
  359.  
  360.         private void button6_Click(object sender, EventArgs e) // Reset settings button
  361.         {
  362.             listBox1.Items.Add("[" + DateTime.Now + "] Reset settings");
  363.             if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamID.txt"))
  364.             {
  365.                 File.Delete(@"C:\OpticTradeBot\config\settings\SteamID.txt");
  366.             }
  367.             if (File.Exists(@"C:\OpticTradeBot\config\settings\SteamName.txt"))
  368.             {
  369.                 File.Delete(@"C:\OpticTradeBot\config\settings\SteamName.txt");
  370.             }
  371.             if (File.Exists(@"C:\OpticTradeBot\config\settings\ScreenSize.txt"))
  372.             {
  373.                 File.Delete(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
  374.             }
  375.         }
  376.  
  377.         private void button9_Click(object sender, EventArgs e)
  378.         {
  379.  
  380.         }
  381.  
  382.         private void button15_Click(object sender, EventArgs e) // Connect button
  383.         {
  384.             if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  385.             {
  386.                 label7.Text = "Connecting..";
  387.                 listBox2.Items.Clear();
  388.                 listBox2.Items.Add("Waiting for login..");
  389.                 listBox2.Items.Add("Press 'Connect' once you have logged in.");
  390.                 listBox2.Items.Add("");
  391.                 listBox2.Items.Add("Please Wait..");
  392.                 Update();
  393.                 System.Threading.Thread.Sleep(3000);
  394.                 listBox2.Items.Clear();
  395.                 label7.Text = "Idle";
  396.                 Update();
  397.                 listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Logged in (manually)");
  398.                 button15.Enabled = false;
  399.                 button18.Enabled = true;
  400.                 string data_accname = null;
  401.                 string data_accstatus = null;
  402.                 string data_acctype = null;
  403.                 string data_accuid = null;
  404.                 string data_ltdatetime = null;
  405.                 string data_lttradeid = null;
  406.                 string data_ltutrade = null;
  407.                 string data_ltstatus = null;
  408.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
  409.                 {
  410.                     data_accname = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_001.txt"); // accname
  411.                 }
  412.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_002.txt"))
  413.                 {
  414.                     data_accstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_002.txt"); // accstatus
  415.                 }
  416.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
  417.                 {
  418.                     data_acctype = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_003.txt"); // acctype
  419.                 }
  420.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
  421.                 {
  422.                     data_accuid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_01_004.txt"); // accuid
  423.                 }
  424.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_001.txt"))
  425.                 {
  426.                     data_ltdatetime = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_001.txt"); // ltdatetime
  427.                 }
  428.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
  429.                 {
  430.                     data_lttradeid = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_002.txt"); // lttradeid
  431.                 }
  432.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_003.txt"))
  433.                 {
  434.                     data_ltutrade = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_003.txt"); // ltutrade
  435.                 }
  436.                 if (File.Exists(@"C:\OpticTradeBot\config\temp\data_02_004.txt"))
  437.                 {
  438.                     data_ltstatus = File.ReadAllText(@"C:\OpticTradeBot\config\temp\data_02_004.txt"); // ltstatus
  439.                 }
  440.                 if (data_acctype == "9CD84851657327D9" || data_acctype == "444674CEDD4729C6" || data_acctype == "4FC5A327CA42927E")
  441.                 {
  442.                     listBox3.Items.Clear();
  443.                     listBox3.Items.Add("Developer account running");
  444.                     button24.Enabled = true;
  445.                     button25.Enabled = true;
  446.                     button27.Enabled = true;
  447.                     button28.Enabled = true;
  448.                     textBox4.Enabled = true;
  449.                 }
  450.                 else
  451.                 {
  452.                     listBox3.Items.Clear();
  453.                     listBox3.Items.Add("Your account does not have dev permissions.");
  454.                     button24.Enabled = false;
  455.                     button25.Enabled = false;
  456.                     button27.Enabled = false;
  457.                     button28.Enabled = false;
  458.                     textBox4.Enabled = false;
  459.                 }
  460.                 if (data_accuid == "null" || data_accname == "null" || data_acctype == "null")
  461.                 {
  462.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  463.                     {
  464.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  465.                     }
  466.                     MessageBox.Show("There was an error verifiying your account. The program will exit.",
  467.                     "OpticTradeBot",
  468.                     MessageBoxButtons.OK,
  469.                     //MessageBoxIcon.Warning // for Warning  
  470.                     MessageBoxIcon.Error // for Error
  471.                     //MessageBoxIcon.Information  // for Information
  472.                     //MessageBoxIcon.Question // for Question
  473.                     );
  474.                     Close();
  475.                 }
  476.                 listBox2.Items.Clear();
  477.                 listBox2.Items.Add("Account Info");
  478.                 listBox2.Items.Add("");
  479.                 listBox2.Items.Add("Username: " + data_accname);
  480.                 listBox2.Items.Add("Account Status: " + data_accstatus);
  481.                 if (data_acctype == "9CD84851657327D9")
  482.                     listBox2.Items.Add("Account Type: Admin"); // Admin: 9CD84851657327D9
  483.                 else if (data_acctype == "444674CEDD4729C6")
  484.                     listBox2.Items.Add("Account Type: Developer"); // Dev: 444674CEDD4729C6
  485.                 else if (data_acctype == "837D631BC9C74667")
  486.                     listBox2.Items.Add("Account Type: Lite"); // Lite: 837D631BC9C74667
  487.                 else if (data_acctype == "9BB6A981FE2C3A5E")
  488.                     listBox2.Items.Add("Account Type: Pro"); // Pro: 9BB6A981FE2C3A5E
  489.                 else if (data_acctype == "2CF8476266713C68")
  490.                     listBox2.Items.Add("Account Type: Demo"); // Demo: 2CF8476266713C68
  491.                 else if (data_acctype == "F8BE87D9B7A61341")
  492.                     listBox2.Items.Add("Account Type: Premium"); // Premium: F8BE87D9B7A61341
  493.                 else if (data_acctype == "62DCBF6F294E23DF")
  494.                     listBox2.Items.Add("Account Type: Review"); // Review: 62DCBF6F294E23DF
  495.                 else if (data_acctype == "4FC5A327CA42927E")
  496.                     listBox2.Items.Add("Account Type: Admin Bot"); // Bot: 4FC5A327CA42927E
  497.                 else if (data_acctype == "57639D64481A5F28")
  498.                 {
  499.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  500.                     {
  501.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  502.                     }
  503.                     listBox2.Items.Add("Account Type: Banned"); // Banned: 57639D64481A5F28
  504.                     MessageBox.Show("The accout you are trying to access has been banned.",
  505.                     "OpticTradeBot",
  506.                     MessageBoxButtons.OK,
  507.                     //MessageBoxIcon.Warning // for Warning  
  508.                     MessageBoxIcon.Error // for Error
  509.                     //MessageBoxIcon.Information  // for Information
  510.                     //MessageBoxIcon.Question // for Question
  511.                     );
  512.                     Close();
  513.                 }
  514.                 else
  515.                 {
  516.                     if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  517.                     {
  518.                         File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  519.                     }
  520.                     MessageBox.Show("There was an error verifiying your account. The program will exit.",
  521.                     "OpticTradeBot",
  522.                     MessageBoxButtons.OK,
  523.                     //MessageBoxIcon.Warning // for Warning  
  524.                     MessageBoxIcon.Error // for Error
  525.                     //MessageBoxIcon.Information  // for Information
  526.                     //MessageBoxIcon.Question // for Question
  527.                     );
  528.                     Close();
  529.                 }
  530.                 listBox2.Items.Add("User ID: " + data_accuid);
  531.                 listBox2.Items.Add("");
  532.                 listBox2.Items.Add("Latest Trade");
  533.                 listBox2.Items.Add("");
  534.                 listBox2.Items.Add("Date & Time: " + data_ltdatetime);
  535.                 listBox2.Items.Add("TradeID: " + data_lttradeid);
  536.                 listBox2.Items.Add("User Traded: " + data_ltutrade);
  537.                 listBox2.Items.Add("Status: " + data_ltstatus);
  538.                 button1.Enabled = true;
  539.                 button2.Enabled = true;
  540.                 button16.Enabled = true;
  541.                 button4.Enabled = true;
  542.                 button14.Enabled = true;
  543.                 textBox1.Enabled = true;
  544.                 textBox2.Enabled = true;
  545.                 textBox3.Enabled = true;
  546.                 button5.Enabled = true;
  547.                 button6.Enabled = true;
  548.                 button7.Enabled = true;
  549.                 button8.Enabled = true;
  550.                 button10.Enabled = true;
  551.                 button11.Enabled = true;
  552.                 button9.Enabled = true;
  553.                 button19.Enabled = true;
  554.                 button20.Enabled = true;
  555.                 button21.Enabled = true;
  556.                 button22.Enabled = true;
  557.                 checkBox1.Enabled = true;
  558.                 checkBox2.Enabled = true;
  559.                 checkBox3.Enabled = true;
  560.                 checkBox4.Enabled = true;
  561.                 string set_SteamID = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamID.txt");
  562.                 string set_SteamName = File.ReadAllText(@"C:\OpticTradeBot\config\settings\SteamName.txt");
  563.                 string set_ScreenSize = File.ReadAllText(@"C:\OpticTradeBot\config\settings\ScreenSize.txt");
  564.                 textBox1.Text = set_SteamID;
  565.                 textBox2.Text = set_SteamName;
  566.                 textBox3.Text = set_ScreenSize;
  567.             }
  568.             else
  569.             {
  570.                 listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Connection declined, user not logged in (manually)");
  571.                 button18.Enabled = false;
  572.                 button15.Enabled = true;
  573.                 listBox2.Items.Clear();
  574.                 listBox2.Items.Add("Waiting for login..");
  575.                 listBox2.Items.Add("Press 'Connect' once you have logged in.");
  576.                 listBox2.Items.Add("");
  577.                 listBox2.Items.Add("Could not log you in.");
  578.                 button15.Text = "Connect";
  579.             }
  580.         }
  581.  
  582.         private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
  583.         {
  584.  
  585.         }
  586.  
  587.         private void button16_Click(object sender, EventArgs e)
  588.         {
  589.  
  590.         }
  591.  
  592.         private void button14_Click(object sender, EventArgs e)
  593.         {
  594.             if (File.Exists(@"C:\OpticTradeBot\config\OTBautoUpdater.exe"))
  595.             {
  596.                 Process process = new Process();
  597.                 process.StartInfo.FileName = "C:\\OpticTradeBot\\config\\OTBautoUpdater.exe";
  598.                 process.StartInfo.Arguments = "-n";
  599.                 process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
  600.                 process.Start();
  601.                 // Process.Start(@"C:\OpticTradeBot\config\OTBautoUpdater.exe");
  602.                 listBox1.Items.Add("[" + DateTime.Now + "] [UPDATE] Program Updating.. (manually)");
  603.             }
  604.         }
  605.  
  606.         private void groupBox1_Enter(object sender, EventArgs e)
  607.         {
  608.  
  609.         }
  610.  
  611.         private void button18_Click(object sender, EventArgs e) // Disconnect button on login page
  612.         {
  613.             listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Disconnected (manually)");
  614.             button15.Enabled = true;
  615.             if (File.Exists(@"C:\OpticTradeBot\config\botfiles\other\login.bat"))
  616.             {
  617.                 File.Delete(@"C:\OpticTradeBot\config\botfiles\other\login.bat");
  618.             }
  619.             button18.Enabled = false;
  620.             listBox3.Items.Clear();
  621.             listBox3.Items.Add("Not Logged In.");
  622.             listBox2.Items.Clear();
  623.             listBox2.Items.Add("Waiting for login..");
  624.             listBox2.Items.Add("Press 'Connect' once you have logged in.");
  625.             button15.Text = "Connect";
  626.             button1.Enabled = false;
  627.             button2.Enabled = false;
  628.             button16.Enabled = false;
  629.             button4.Enabled = false;
  630.             textBox1.Enabled = false;
  631.             textBox2.Enabled = false;
  632.             textBox3.Enabled = false;
  633.             button5.Enabled = false;
  634.             button6.Enabled = false;
  635.             button7.Enabled = false;
  636.             button8.Enabled = false;
  637.             button10.Enabled = false;
  638.             button11.Enabled = false;
  639.             button9.Enabled = false;
  640.             button19.Enabled = false;
  641.             button20.Enabled = false;
  642.             button21.Enabled = false;
  643.             button22.Enabled = false;
  644.             checkBox1.Enabled = false;
  645.             checkBox2.Enabled = false;
  646.             checkBox3.Enabled = false;
  647.             checkBox4.Enabled = false;
  648.             button24.Enabled = false;
  649.             button25.Enabled = false;
  650.             button27.Enabled = false;
  651.             button28.Enabled = false;
  652.             textBox4.Enabled = false;
  653.             if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_001.txt"))
  654.             {
  655.                 File.Delete(@"C:\OpticTradeBot\config\temp\data_01_001.txt");
  656.             }
  657.             if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_003.txt"))
  658.             {
  659.                 File.Delete(@"C:\OpticTradeBot\config\temp\data_01_003.txt");
  660.             }
  661.             if (File.Exists(@"C:\OpticTradeBot\config\temp\data_01_004.txt"))
  662.             {
  663.                 File.Delete(@"C:\OpticTradeBot\config\temp\data_01_004.txt");
  664.             }
  665.         }
  666.  
  667.         private void button17_Click(object sender, EventArgs e) // Login button on main page
  668.         {
  669.             listBox1.Items.Add("[" + DateTime.Now + "] [LOGIN] Opened login dialog");
  670.             if (File.Exists(@"C:\OpticTradeBot\config\OTBlogin.exe"))
  671.             {
  672.                 Process.Start(@"C:\OpticTradeBot\config\OTBlogin.exe");
  673.             }
  674.             else
  675.             {
  676.                 MessageBox.Show("Coul not start login dialouge. Make sure \\config\\OTBlogin.exe exists and try again.",
  677.                     "OpticTradeBot",
  678.                     MessageBoxButtons.OK,
  679.                     MessageBoxIcon.Error
  680.                     );
  681.             }
  682.         }
  683.  
  684.         private void button12_Click(object sender, EventArgs e) // Log Clear Button
  685.         {
  686.             listBox1.Items.Clear();
  687.         }
  688.  
  689.         private void button13_Click(object sender, EventArgs e) // Log Copy Button
  690.         {
  691.             string s1 = "";
  692.             foreach (object item in listBox1.Items) s1 += item.ToString() + "\r\n";
  693.             if (s1 == "")
  694.                 s1 = null;
  695.             else
  696.                 Clipboard.SetText(s1);
  697.         }
  698.  
  699.         private void listBox1_SelectedIndexChanged(object sender, EventArgs e) // Log Listbox (actual log)
  700.         {
  701.  
  702.         }
  703.  
  704.         private void button7_Click(object sender, EventArgs e) // Load config button settings
  705.         {
  706.  
  707.         }
  708.  
  709.         private void button23_Click(object sender, EventArgs e) // Help Button
  710.         {
  711.  
  712.         }
  713.  
  714.         private void listBox3_SelectedIndexChanged(object sender, EventArgs e)
  715.         {
  716.  
  717.         }
  718.     }
  719. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement