Advertisement
Guest User

Untitled

a guest
Jun 14th, 2015
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 66.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.Windows.Forms;
  9. using PlayerIOClient;
  10. using System.Text.RegularExpressions;
  11. using System.Threading;
  12. using System.Threading.Tasks;
  13.  
  14. namespace Mightiness
  15. {
  16.     public partial class Form1 : Form
  17.     {
  18.         List<Connection> ConnectionList = new List<Connection>();
  19.         List<Client> ClaList = new List<Client>();
  20.         Dictionary<int, string> Players = new Dictionary<int, string>();
  21.         string[] Usernames = new string[] { "sc0pefurth3r@gmail.com", "sharpner67@yahoo.com", "lazyme@yahoo.com", "ham@yahoo.com", "team@yahoo.com", "plasma@yahoo.com", "jose67@yahoo.com", "tartop@yahoo.com", "star45@yahoo.com", "ray8@yahoo.com", "horsey@yahoo.com", "heray@yahoo.com", "yasin@yahoo.com", "hey124@gmail.com", "hey125@gmail.com", "hey112@gmail.com", "nis2@gmail.com", "fry3@gmail.com", "fredre@gmail.com", "pythonpython@gmail.com", "boilingbunny@gmail.com" };
  22.         string[] Passwords = new string[] { "ExploitMe", "sharpner1234", "lazychair", "hamandcheese", "myteam", "plasma54", "jose67", "tart", "start", "road", "horsy34", "herayme", "yasona", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "123456789", "kaka", "godis", "hastighet", "kaka", "123456789", "123456789", "123456789", "bajskorv", "negerhand" };
  23.         string[] Task = new string[200];
  24.         bool Busy = false;
  25.         int BlockID = 12;
  26.         int x = 1;
  27.         string WorldKey;
  28.         int[,] mapdata;
  29.         int w, h;
  30.         static uint loc4;
  31.         static uint loc5;
  32.         bool inited = false;
  33.         public Form1()
  34.         {
  35.             InitializeComponent();
  36.         }
  37.         private void Form1_Load(object sender, EventArgs e)
  38.         {
  39.             richtxt("[Mightiness BOT]~ Welcome, please connect all bots to the lobby", Color.DarkBlue);
  40.             for (int i = 0; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  41.             {
  42.                 ConnectionList.Add(null);
  43.                 Task[i] = "READY";
  44.             }
  45.         }
  46.         private void Connect2Lobby_Click(object sender, EventArgs e)
  47.         {
  48.             Connect2EE();
  49.         }
  50.         private void Connect2EE()
  51.         {
  52.             PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", Usernames[x], Passwords[x], LoginSuccess, LoginFail);
  53.         }
  54.         private string detectRoom(string room)
  55.         {
  56.             if (room.StartsWith("http://") || room.StartsWith("www."))
  57.             {
  58.                 Match m0 = Regex.Match(room, @"/games/(PW|BW)+[A-f0-9_-]{3,13}", RegexOptions.IgnoreCase);
  59.                 if (m0.Success)
  60.                 {
  61.                     return Convert.ToString(m0).Substring(7);
  62.                 }
  63.                 else
  64.                 {
  65.                     Match m00 = Regex.Match(room, @"/games/OW+[A-z0-9]{1,4}-.*", RegexOptions.IgnoreCase);
  66.                     if (m00.Success)
  67.                     {
  68.                         return Convert.ToString(m00).Substring(7).Replace("-", " ");
  69.                     }
  70.                 }
  71.                 return null;
  72.             }
  73.             else
  74.             {
  75.                 Match m1 = Regex.Match(room, "(PW|BW)+[A-f0-9_-]{3,13}", RegexOptions.IgnoreCase);
  76.                 if (m1.Success)
  77.                 {
  78.                     return room;
  79.                 }
  80.                 else
  81.                 {
  82.                     Match m2 = Regex.Match(room, "OW+[A-z0-9]{1,4}-.*", RegexOptions.IgnoreCase);
  83.                     if (m2.Success)
  84.                     {
  85.                         return Convert.ToString(room).Replace("-", " ");
  86.                     }
  87.                 }
  88.                 return null;
  89.             }
  90.         }
  91.         private string derot(string arg1)
  92.         {
  93.             int num = 0;
  94.             string str = "";
  95.             for (int i = 0; i < arg1.Length; i++)
  96.             {
  97.                 num = arg1[i];
  98.                 if ((num >= 0x61) && (num <= 0x7a))
  99.                 {
  100.                     if (num > 0x6d) num -= 13;
  101.                     else num += 13;
  102.                 }
  103.                 else if ((num >= 0x41) && (num <= 90))
  104.                 {
  105.                     if (num > 0x4d) num -= 13;
  106.                     else num += 13;
  107.                 }
  108.                 str = str + ((char)num);
  109.             }
  110.             return str;
  111.         }
  112.         private void LoginFail(PlayerIOClient.PlayerIOError error)
  113.         {
  114.             richtxt("[Mightiness BOT]~ Login Failed [" + Usernames[x] + ", " + Passwords[x] + "]: " + error.ToString(), Color.DarkRed);
  115.             x++;
  116.             if (x < Math.Min(Usernames.Length, Passwords.Length))
  117.             {
  118.                 Connect2EE();
  119.             }
  120.             else
  121.             {
  122.                 x = 0;
  123.                 Connect2EE();
  124.             }
  125.         }
  126.         private void LoginSuccess(PlayerIOClient.Client cla)
  127.         {
  128.             switch (x)
  129.             {
  130.                 case 0:
  131.                     ClaList.Insert(0, cla);
  132.                     richtxt("[Mightiness BOT]~ Sc0pefurth3r joined the lobby [MAJOR BOT]", Color.DarkGreen);
  133.                     richtxt("[Mightiness BOT]~ All bots joined the lobby, please fill in a room ID", Color.DarkGreen);
  134.                     this.Invoke(new Action(() =>
  135.                         {
  136.                     WorldID.Enabled = true;
  137.                     Connect.Enabled = true;
  138.                         }));
  139.                     break;
  140.                 default:
  141.                     richtxt("[Mightiness BOT]~ " + x + "th (" + Usernames[x] + ") bot joined the lobby [PRIVATE BOT]", Color.Green);
  142.                     ClaList.Add(cla);            
  143.                     x++;
  144.                     if (x < Math.Min(Usernames.Length, Passwords.Length))
  145.                     {
  146.                         Connect2EE();
  147.                     }
  148.                     else
  149.                     {
  150.                         x = 0;
  151.                         Connect2EE();
  152.                     }
  153.                     break;
  154.             }
  155.         }
  156.         delegate void Richtxt(string text, Color richtxtColor);
  157.         private void richtxt(string text, Color richtxtColor)
  158.         {
  159.  
  160.             if (this.richTextBox1.InvokeRequired)
  161.             {
  162.                 Richtxt a = new Richtxt(richtxt);
  163.                 this.Invoke(a, new object[] { text, richtxtColor });
  164.             }
  165.             else
  166.             {
  167.                 this.richTextBox1.SelectionColor = richtxtColor;
  168.                 this.richTextBox1.AppendText(text + Environment.NewLine);
  169.             }
  170.  
  171.         }
  172.         private void Connect_Click(object sender, EventArgs e)
  173.         {
  174.             this.Invoke(new Action(() =>
  175.                 {
  176.                     this.Size = new Size(600, 596);
  177.                     Connect2Lobby.Visible = false;
  178.                     label1.Visible = false;
  179.                     label2.Visible = false;
  180.                     WorldID.Visible = false;
  181.                     Connect.Visible = false;
  182.  
  183.                     label3.Visible = true;
  184.                     OnlinePlayerList.Visible = true;
  185.                     AdminName.Visible = true;
  186.                     AddAdmin.Visible = true;
  187.                     RemoveAdmin.Visible = true;
  188.                     OnlineAdminList.Visible = true;
  189.                     AddSelectedPlayer.Visible = true;
  190.                     RemoveSelectedPlayer.Visible = true;
  191.                     SelectedPlayerList.Visible = true;
  192.                     Disconnect.Visible = true;
  193.                     groupBox1.Visible = true;
  194.                     groupBox2.Visible = true;
  195.                     groupBox3.Visible = true;
  196.                     label9.Visible = true;
  197.                 }));
  198.             ConnectMAJOR();
  199.         }
  200.         private void ConnectMAJOR()
  201.         {
  202.             try
  203.             {
  204.                 var Room = detectRoom(WorldID.Text);
  205.                 ConnectionList[0] = ClaList[0].Multiplayer.JoinRoom(Room, new Dictionary<string, string>());
  206.                 ConnectionList[0].Send("init");
  207.                 ConnectionList[0].Send("init2");
  208.                 ConnectionList[0].OnMessage += delegate(object sender, PlayerIOClient.Message m)
  209.                 {
  210.                     switch (m.Type)
  211.                     {
  212.                         case "init":
  213.                             WorldKey = derot(m.GetString(5));
  214.                             this.Invoke(new Action(() => label3.Text = "Players in " + m.GetString(1) + ":"));
  215.                             //richtxt("[Mightiness BOT]~ " + m.GetString(9) + " connected to room ID: " + m.GetString(1), Color.Green);
  216.                             ConnectionList[0].Send("say", "[Mightiness BOT]~ Connected to " + m.GetString(1));
  217.                             mapdata = new int[m.GetInt(12) + 1, m.GetInt(13) + 1];
  218.                             try
  219.                             {
  220.                                 loc4 = 18;
  221.                                 loc5 = m.Count;
  222.                                 byte[] bt1 = m.GetByteArray(loc4 + 2);
  223.                                 byte[] bt2 = m.GetByteArray(loc4 + 3);
  224.                                 int btl1 = bt1.Length;
  225.                                 int bid = m.GetInt(loc4);
  226.                                 while (loc4 < loc5)
  227.                                 {
  228.                                     if (m[loc4].ToString() == "we")
  229.                                     {
  230.                                         break;
  231.                                     }
  232.                                     else
  233.                                     {
  234.                                         bid = m.GetInt(loc4);
  235.                                         bt1 = m.GetByteArray(loc4 + 2);
  236.                                         bt2 = m.GetByteArray(loc4 + 3);
  237.                                         btl1 = bt1.Length;
  238.                                         for (int n = 0; n < btl1; n += 2)
  239.                                         {
  240.                                             try
  241.                                             {
  242.                                                 int x = m.GetByteArray(loc4 + 2)[n] << 8 | m.GetByteArray(loc4 + 2)[n + 1];
  243.                                                 int y = m.GetByteArray(loc4 + 3)[n] << 8 | m.GetByteArray(loc4 + 3)[n + 1];
  244.                                                 if (m.GetInt(loc4 + 1) == 0)
  245.                                                 {
  246.                                                     mapdata[x, y] = bid;
  247.                                                 }
  248.                                             }
  249.                                             catch (Exception ee)
  250.                                             {
  251.                                                 //n = btl1;
  252.                                             }
  253.                                         }
  254.                                         if (bid == 43 || bid == 77 || bid == 83 || bid == 1000 || bid == 165 || bid == 361 || bid >= 374 && bid <= 380 || bid == 385) { loc4 += 5; }
  255.                                         else if (bid == 242 || bid == 381) { loc4 += 7; }
  256.                                         else { loc4 += 4; }
  257.                                     }
  258.                                 }
  259.                             }
  260.                             catch { }
  261.                             inited = true;
  262.                             break;
  263.                         case "add":
  264.                             Players[m.GetInt(0)] = m.GetString(1);
  265.                             this.Invoke(new Action(() => OnlinePlayerList.Items.Add(Players[m.GetInt(0)].ToUpper())));
  266.                             this.Invoke(new Action(() => OnlinePlayerList.Refresh()));
  267.                             break;
  268.                         case "left":
  269.                             if(Players.ContainsKey(m.GetInt(0)))
  270.                             {
  271.                                 this.Invoke(new Action(() => OnlinePlayerList.Items.Remove(Players[m.GetInt(0)].ToUpper())));
  272.                                 this.Invoke(new Action(() => OnlinePlayerList.Refresh()));
  273.                                 Players.Remove(m.GetInt(0));
  274.                             }
  275.                             break;
  276.                         case "info":
  277.                             richtxt("[Mightiness BOT]~ INFO: " + m.GetString(1), Color.DarkOrange);
  278.                             break;
  279.                         case "say":
  280.                             try
  281.                             {
  282.                                 string Player = Players[m.GetInt(0)].ToUpper();
  283.                                 string Message = m.GetString(1);
  284.                                 if (Message.StartsWith("*"))
  285.                                 {
  286.                                     if (OnlineAdminList.Items.Contains(Player))
  287.                                     {
  288.                                         ConnectionList[0].Send("say", "[Mightiness BOT]~ " + Player + " you are an admin");
  289.                                     }
  290.                                     else
  291.                                     {
  292.                                         ConnectionList[0].Send("say", "[Mightiness BOT]~ " + Player + " you are not an admin");
  293.                                     }
  294.                                 }
  295.                             }
  296.                             catch { }
  297.                             break;
  298.                         case "b":
  299.                             if (inited == true && FlyBox.Checked == false)
  300.                             {
  301.                                 int x = m.GetInt(1);
  302.                                 int y = m.GetInt(2);
  303.                                 int @int = m.GetInt(3);
  304.                                 mapdata[x, y] = @int;
  305.                             }
  306.                             try
  307.                             {
  308.                                 if (Reset.Checked == true && SelectedPlayerList.Items.Contains(Players[m.GetInt(4)].ToUpper()) == true)
  309.                                 {
  310.                                     ConnectionList[0].Send(WorldKey, m.GetInt(0), m.GetInt(1), m.GetInt(2), mapdata[m.GetInt(1), m.GetInt(2)]);
  311.                                 }
  312.                                 else if (FlyBox.Checked == true && m.GetInt(3) == 4 && Players[m.GetInt(4)].ToUpper() == Astronaut.Text)
  313.                                 {
  314.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2), 4);
  315.                                     System.Threading.Thread.Sleep(10);
  316.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) - 1, 4);
  317.                                     System.Threading.Thread.Sleep(10);
  318.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 1, m.GetInt(2), 4);
  319.                                     System.Threading.Thread.Sleep(10);
  320.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) + 1, 4);
  321.                                     System.Threading.Thread.Sleep(10);
  322.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 1, m.GetInt(2), 4);
  323.                                     System.Threading.Thread.Sleep(10);
  324.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) - 2, 14);
  325.                                     System.Threading.Thread.Sleep(10);
  326.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 1, m.GetInt(2) - 1, 14);
  327.                                     System.Threading.Thread.Sleep(10);
  328.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 2, m.GetInt(2), 14);
  329.                                     System.Threading.Thread.Sleep(10);
  330.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 1, m.GetInt(2) + 1, 14);
  331.                                     System.Threading.Thread.Sleep(10);
  332.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) + 2, 14);
  333.                                     System.Threading.Thread.Sleep(10);
  334.  
  335.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 1, m.GetInt(2) + 1, 14);
  336.                                     System.Threading.Thread.Sleep(10);
  337.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 2, m.GetInt(2), 14);
  338.                                     System.Threading.Thread.Sleep(10);
  339.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 1, m.GetInt(2) - 1, 14);
  340.                                     System.Threading.Thread.Sleep(10);
  341.                                    
  342.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) - 3, 3);
  343.                                     System.Threading.Thread.Sleep(10);
  344.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 1, m.GetInt(2) - 2, 3);
  345.                                     System.Threading.Thread.Sleep(10);
  346.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 2, m.GetInt(2) - 1, 3);
  347.                                     System.Threading.Thread.Sleep(10);
  348.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 3, m.GetInt(2), 3);
  349.                                     System.Threading.Thread.Sleep(10);
  350.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 2, m.GetInt(2) + 1, 3);
  351.                                     System.Threading.Thread.Sleep(10);
  352.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) + 1, m.GetInt(2) + 2, 3);
  353.                                     System.Threading.Thread.Sleep(10);
  354.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1), m.GetInt(2) + 3, 1);
  355.                                     System.Threading.Thread.Sleep(10);
  356.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 1, m.GetInt(2) + 2, 1);
  357.                                     System.Threading.Thread.Sleep(10);
  358.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 2, m.GetInt(2) + 1, 1);
  359.                                     System.Threading.Thread.Sleep(10);
  360.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 3, m.GetInt(2), 1);
  361.                                     System.Threading.Thread.Sleep(10);
  362.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 2, m.GetInt(2) - 1, 1);
  363.                                     System.Threading.Thread.Sleep(10);
  364.                                     ConnectionList[0].Send(WorldKey, 0, m.GetInt(1) - 1, m.GetInt(2) - 2, 1);
  365.                                 }
  366.                             }
  367.                             catch(Exception ex) { MessageBox.Show(ex.ToString()); }
  368.                             break;
  369.                     }
  370.                 };
  371.                 ConnectionList[0].OnDisconnect += delegate(object sender, string error)
  372.                 {
  373.                     ConnectionList[0].Send("say", "[Mightiness BOT]~ Disconnected");
  374.                     richtxt("[Mightiness BOT]~ Sc0pefurth3r disconnected [MAJOR BOT]", Color.DarkRed);
  375.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  376.                     {
  377.                         if (Task[i] != "READY")
  378.                         {
  379.                             ConnectionList[i].Disconnect();
  380.                             Task[i] = "READY";
  381.                             richtxt("[Mightiness BOT]~ " + i + "th bot disconnected [PRIVATE BOT]", Color.Red);
  382.                         }
  383.                     }
  384.                     this.Invoke(new Action(() =>
  385.                     {
  386.                         this.Size = new Size(600, 223);
  387.                         Connect2Lobby.Visible = true;
  388.                         label1.Visible = true;
  389.                         label2.Visible = true;
  390.                         WorldID.Visible = true;
  391.                         WorldID.Text = "";
  392.                         Connect.Visible = true;
  393.  
  394.                         label3.Visible = false;
  395.                         OnlinePlayerList.Visible = false;
  396.                         AdminName.Visible = false;
  397.                         AddAdmin.Visible = false;
  398.                         RemoveAdmin.Visible = false;
  399.                         OnlineAdminList.Visible = false;
  400.                         AddSelectedPlayer.Visible = false;
  401.                         RemoveSelectedPlayer.Visible = false;
  402.                         SelectedPlayerList.Visible = false;
  403.                         Disconnect.Visible = false;
  404.                         groupBox1.Visible = false;
  405.                         groupBox2.Visible = false;
  406.                         groupBox3.Visible = false;
  407.                         label9.Visible = false;
  408.                     }));
  409.                     x = 1;
  410.                     inited = false;
  411.                     ClaList.Clear();
  412.                     ConnectionList.Clear();
  413.                     richtxt(Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine + Environment.NewLine, Color.Black);
  414.                     richtxt("[Mightiness BOT]~ Welcome, please connect all bots to the lobby", Color.DarkBlue);
  415.                     for (int i = 0; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  416.                     {
  417.                         ConnectionList.Add(null);
  418.                     }
  419.                 };
  420.             }
  421.             catch (Exception ex) { MessageBox.Show(ex.ToString()); }
  422.         }
  423.         private void ConnectPRIVATE(int i)
  424.         {
  425.             try
  426.             {
  427.                 var Room = detectRoom(WorldID.Text);
  428.                 ConnectionList[i] = ClaList[i].Multiplayer.JoinRoom(Room, new Dictionary<string, string>());
  429.                 ConnectionList[i].Send("init");
  430.                 ConnectionList[i].Send("init2");
  431.                 ConnectionList[i].OnMessage += delegate(object sender, PlayerIOClient.Message m)
  432.                 {
  433.                     switch (m.Type)
  434.                     {
  435.                         case "m":
  436.                             if (Task[i].Contains("TakeDown") == true)
  437.                             {
  438.                                 try
  439.                                 {
  440.                                     if (Task[i].Contains(SelectedPlayerList.Items.IndexOf(Players[m.GetInt(0)].ToUpper()).ToString()) && Busy == false)
  441.                                     {
  442.                                         Busy = true;
  443.                                         int cordX = (int)Math.Round(m.GetDouble(1) / 16);
  444.                                         int cordY = (int)Math.Round(m.GetDouble(2) / 16);
  445.                                         int speedX = (int)m.GetDouble(3);
  446.                                         int speedY = (int)m.GetDouble(4);
  447.                                         int modifierX = m.GetInt(5);
  448.                                         int modifierY = m.GetInt(6);
  449.                                         int Horizontal = m.GetInt(7);
  450.                                         int Vertical = m.GetInt(8);
  451.                                         bool Levitation = m.GetBoolean(11);
  452.                                         richtxt("[CORD(" + cordX + ", " + cordY + "), SPEED(" + speedX + ", " + speedY + "), MODIFIER(" + modifierX + ", " + modifierY + ")] Horizontal: " + Horizontal + " - Vertical: " + Vertical + " - Levitation: " + Levitation, Color.Black);
  453.                                         if ((int)m.GetDouble(4) < 0 && m.GetBoolean(11) == true)
  454.                                         {
  455.                                             if (m.GetInt(7) == -1)
  456.                                                 cordX -= 5;
  457.                                             if (m.GetInt(7) == 1)
  458.                                                 cordX += 5;
  459.                                             for (int y = cordY - 4; y <= 198; y++)
  460.                                             {
  461.                                                 if (mapdata[cordX, y] != BlockID)
  462.                                                 {
  463.                                                     ConnectionList[i].Send(WorldKey, 0, cordX, y, BlockID);
  464.                                                     System.Threading.Thread.Sleep(10);
  465.                                                 }
  466.                                             }
  467.                                         }
  468.                                         else if ((int)m.GetDouble(4) == 0 && m.GetInt(5) == 0 && m.GetInt(6) == 2 && m.GetInt(7) == 0 && m.GetInt(8) == 0 && m.GetBoolean(11) == false)
  469.                                         {
  470.                                             for (int y = cordY; y <= 198; y++)
  471.                                             {
  472.                                                 if (mapdata[cordX, y] != BlockID)
  473.                                                 {
  474.                                                     ConnectionList[i].Send(WorldKey, 0, cordX, y, BlockID);
  475.                                                     System.Threading.Thread.Sleep(10);
  476.                                                 }
  477.                                             }
  478.                                         }
  479.                                         Busy = false;
  480.                                     }
  481.                                 }
  482.                                 catch (Exception ex) { MessageBox.Show(ex.ToString());  }
  483.                             }
  484.                             else if (Task[i].Contains("Shuttle") == true && Players[m.GetInt(0)].ToUpper() == Astronaut.Text)
  485.                             {
  486.                                 int cordX = (int)Math.Round(m.GetDouble(1) / 16);
  487.                                 int cordY = (int)Math.Round(m.GetDouble(2) / 16);
  488.                                 cordY -= 1;
  489.                                 if (Task[i].Split('_')[1] == "0")
  490.                                 {
  491.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  492.                                     {
  493.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY + 1, 2);                                        
  494.                                         System.Threading.Thread.Sleep(10);
  495.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY -3, 14);                                        
  496.                                         System.Threading.Thread.Sleep(10);
  497.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY - 2, 14);                                        
  498.                                         System.Threading.Thread.Sleep(10);
  499.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY - 1, 4);                                        
  500.                                         System.Threading.Thread.Sleep(10);
  501.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY, 4);                                        
  502.                                         System.Threading.Thread.Sleep(10);
  503.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY + 1, 14);
  504.                                         System.Threading.Thread.Sleep(10);
  505.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY - 2, 4);                                                                            
  506.                                     }
  507.                                 }
  508.                                 else if (Task[i].Split('_')[1] == "1")
  509.                                 {
  510.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  511.                                     {
  512.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY - 1, 4);
  513.                                         System.Threading.Thread.Sleep(10);
  514.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY - 1, 4);
  515.                                         System.Threading.Thread.Sleep(10);
  516.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY - 2, 14);
  517.                                         System.Threading.Thread.Sleep(10);
  518.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY - 2, 14);
  519.                                         System.Threading.Thread.Sleep(10);
  520.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 2, cordY - 1, 14);
  521.                                     }
  522.                                 }
  523.                                 else if (Task[i].Split('_')[1] == "2")
  524.                                 {
  525.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  526.                                     {
  527.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 2, cordY - 1, 14);
  528.                                         System.Threading.Thread.Sleep(10);
  529.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY, 14);
  530.                                         System.Threading.Thread.Sleep(10);
  531.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY, 14);
  532.                                         System.Threading.Thread.Sleep(10);
  533.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY - 4, 3);
  534.                                         System.Threading.Thread.Sleep(10);
  535.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY - 3, 3);
  536.                                         System.Threading.Thread.Sleep(10);
  537.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 2, cordY - 2, 3);
  538.                                     }
  539.                                 }
  540.                                 else if (Task[i].Split('_')[1] == "3")
  541.                                 {
  542.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  543.                                     {
  544.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 3, cordY - 1, 3);
  545.                                         System.Threading.Thread.Sleep(10);
  546.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 2, cordY, 3);
  547.                                         System.Threading.Thread.Sleep(10);
  548.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY + 1, 3);
  549.                                         System.Threading.Thread.Sleep(10);
  550.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 2, cordY + 1, mapdata[cordX + 2, cordY + 1]);
  551.                                         System.Threading.Thread.Sleep(10);
  552.                                         ConnectionList[i].Send(WorldKey, 0, cordX + 1, cordY + 2, mapdata[cordX + 1, cordY + 2]);
  553.                                         System.Threading.Thread.Sleep(10);
  554.                                         ConnectionList[i].Send(WorldKey, 0, cordX, cordY + 2, 1);
  555.                                     }
  556.                                 }
  557.                                 else if (Task[i].Split('_')[1] == "4")
  558.                                 {
  559.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  560.                                     {
  561.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY + 2, mapdata[cordX - 1, cordY + 2]);
  562.                                         System.Threading.Thread.Sleep(10);
  563.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY + 1, 1);
  564.                                         System.Threading.Thread.Sleep(10);
  565.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 2, cordY + 1, mapdata[cordX - 2, cordY + 1]);
  566.                                         System.Threading.Thread.Sleep(10);
  567.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 2, cordY, 1);
  568.                                         System.Threading.Thread.Sleep(10);
  569.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 3, cordY - 1, 1);
  570.                                         System.Threading.Thread.Sleep(10);
  571.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 2, cordY - 2, 1);
  572.                                         System.Threading.Thread.Sleep(10);
  573.                                         ConnectionList[i].Send(WorldKey, 0, cordX - 1, cordY - 3, 1);
  574.                                     }
  575.                                 }
  576.                                 else if (Task[i].Split('_')[1] == "5")
  577.                                 {
  578.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  579.                                     {
  580.  
  581.                                     }
  582.                                 }
  583.                                 else if (Task[i].Split('_')[1] == "6")
  584.                                 {
  585.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  586.                                     {
  587.  
  588.                                     }
  589.                                 }
  590.                                 else if (Task[i].Split('_')[1] == "7")
  591.                                 {
  592.                                     if (m.GetInt(6) == -1 && m.GetInt(8) == -1)
  593.                                     {
  594.                                     }
  595.                                 }
  596.                             }
  597.                             break;
  598.                         case "b":
  599.                             try
  600.                             {
  601.                                 if (Task[i] == "GoDown0")
  602.                                 {
  603.                                     int BlockID = 12;
  604.                                     this.Invoke(new Action(() =>
  605.                                     {
  606.                                         BlockID = Convert.ToInt32(comboBox1.Text.Split(' ')[1]);
  607.                                     }));
  608.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  609.                                     {
  610.                                         int x = m.GetInt(1);
  611.                                         for (int y = m.GetInt(2); y <= 198; y++)
  612.                                         {
  613.                                             if (mapdata[x, y] != 0)
  614.                                             {
  615.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 0);
  616.                                                 System.Threading.Thread.Sleep(10);
  617.                                             }
  618.                                         }
  619.                                     }
  620.                                 }
  621.                                 else if (Task[i] == "GoDown1")
  622.                                 {
  623.                                     int BlockID = 12;
  624.                                     this.Invoke(new Action(() =>
  625.                                     {
  626.                                         BlockID = Convert.ToInt32(comboBox1.Text.Split(' ')[1]);
  627.                                     }));
  628.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  629.                                     {
  630.                                         int x = m.GetInt(1);
  631.                                         for (int y = 198; y > m.GetInt(2); y--)
  632.                                         {
  633.                                             if (mapdata[x, y] != 0)
  634.                                             {
  635.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 0);
  636.                                                 System.Threading.Thread.Sleep(10);
  637.                                             }
  638.                                         }
  639.                                     }
  640.                                 }
  641.                                 if (Task[i] == "GoUpDel0")
  642.                                 {
  643.                                     int BlockID = 12;
  644.                                     this.Invoke(new Action(() =>
  645.                                     {
  646.                                         BlockID = Convert.ToInt32(comboBox2.Text.Split(' ')[1]);
  647.                                     }));
  648.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  649.                                     {
  650.                                         int x = m.GetInt(1);
  651.                                         for (int y = 5; y < m.GetInt(2); y++)
  652.                                         {
  653.                                             if (mapdata[x, y] != 0)
  654.                                             {
  655.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 0);
  656.                                                 System.Threading.Thread.Sleep(10);
  657.                                             }
  658.                                         }
  659.                                     }
  660.                                 }
  661.                                 else if (Task[i] == "GoUpDel1")
  662.                                 {
  663.                                     int BlockID = 12;
  664.                                     this.Invoke(new Action(() =>
  665.                                     {
  666.                                         BlockID = Convert.ToInt32(comboBox2.Text.Split(' ')[1]);
  667.                                     }));
  668.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  669.                                     {
  670.                                         int x = m.GetInt(1);
  671.                                         for (int y = m.GetInt(2) - 1; y >= 5; y--)
  672.                                         {
  673.                                             if (mapdata[x, y] != 0)
  674.                                             {
  675.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 0);
  676.                                                 System.Threading.Thread.Sleep(10);
  677.                                             }
  678.                                         }
  679.                                     }
  680.                                 }
  681.                                 if (Task[i] == "GoUp0")
  682.                                 {
  683.                                     int BlockID = 12;
  684.                                     this.Invoke(new Action(() =>
  685.                                     {
  686.                                         BlockID = Convert.ToInt32(comboBox3.Text.Split(' ')[1]);
  687.                                     }));
  688.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  689.                                     {
  690.                                         int x = m.GetInt(1);
  691.                                         for (int y = 5; y < m.GetInt(2); y++)
  692.                                         {
  693.                                             if (mapdata[x, y] != 2)
  694.                                             {
  695.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 2);
  696.                                                 System.Threading.Thread.Sleep(10);
  697.                                             }
  698.                                         }
  699.                                     }
  700.                                 }
  701.                                 else if (Task[i] == "GoUp1")
  702.                                 {
  703.                                     int BlockID = 12;
  704.                                     this.Invoke(new Action(() =>
  705.                                     {
  706.                                         BlockID = Convert.ToInt32(comboBox3.Text.Split(' ')[1]);
  707.                                     }));
  708.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  709.                                     {
  710.                                         int x = m.GetInt(1);
  711.                                         for (int y = m.GetInt(2) - 2; y >= 5; y--)
  712.                                         {
  713.                                             if (mapdata[x, y] != 2)
  714.                                             {
  715.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 2);
  716.                                                 System.Threading.Thread.Sleep(10);
  717.                                             }
  718.                                         }
  719.                                     }
  720.                                 }
  721.                                 if (Task[i] == "GoLeft0")
  722.                                 {
  723.                                     int BlockID = 12;
  724.                                     this.Invoke(new Action(() =>
  725.                                     {
  726.                                         BlockID = Convert.ToInt32(comboBox4.Text.Split(' ')[1]);
  727.                                     }));
  728.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  729.                                     {
  730.                                         int y = m.GetInt(2);
  731.                                         for (int x = 2; x < m.GetInt(1); x++)
  732.                                         {
  733.                                             if (mapdata[x, y] != 1)
  734.                                             {
  735.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 1);
  736.                                                 System.Threading.Thread.Sleep(10);
  737.                                             }
  738.                                         }
  739.                                     }
  740.                                 }
  741.                                 else if (Task[i] == "GoLeft1")
  742.                                 {
  743.                                     int BlockID = 12;
  744.                                     this.Invoke(new Action(() =>
  745.                                     {
  746.                                         BlockID = Convert.ToInt32(comboBox4.Text.Split(' ')[1]);
  747.                                     }));
  748.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  749.                                     {
  750.                                         int y = m.GetInt(2);
  751.                                         for (int x = m.GetInt(1) - 1; x >= 2; x--)
  752.                                         {
  753.                                             if (mapdata[x, y] != 1)
  754.                                             {
  755.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 1);
  756.                                                 System.Threading.Thread.Sleep(10);
  757.                                             }
  758.                                         }
  759.                                     }
  760.                                 }
  761.                                 if (Task[i] == "GoRight0")
  762.                                 {
  763.                                     int BlockID = 12;
  764.                                     this.Invoke(new Action(() =>
  765.                                     {
  766.                                         BlockID = Convert.ToInt32(comboBox5.Text.Split(' ')[1]);
  767.                                     }));
  768.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  769.                                     {
  770.                                         int y = m.GetInt(2);
  771.                                         for (int x = 197; x > m.GetInt(1); x--)
  772.                                         {
  773.                                             if (mapdata[x, y] != 3)
  774.                                             {
  775.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 3);
  776.                                                 System.Threading.Thread.Sleep(10);
  777.                                             }
  778.                                         }
  779.                                     }
  780.                                 }
  781.                                 else if (Task[i] == "GoRight1")
  782.                                 {
  783.                                     int BlockID = 12;
  784.                                     this.Invoke(new Action(() =>
  785.                                     {
  786.                                         BlockID = Convert.ToInt32(comboBox5.Text.Split(' ')[1]);
  787.                                     }));
  788.                                     if (OnlineAdminList.Items.Contains(Players[m.GetInt(4)].ToUpper()) && m.GetInt(3) == BlockID)
  789.                                     {
  790.                                         int y = m.GetInt(2);
  791.                                         for (int x = m.GetInt(1) + 1; x <= 197; x++)
  792.                                         {
  793.                                             if (mapdata[x, y] != 3)
  794.                                             {
  795.                                                 ConnectionList[i].Send(WorldKey, 0, x, y, 3);
  796.                                                 System.Threading.Thread.Sleep(10);
  797.                                             }
  798.                                         }
  799.                                     }
  800.                                 }
  801.                             }
  802.                             catch { }
  803.                             break;                      
  804.                     }
  805.                 };
  806.             }
  807.             catch (Exception ex) { MessageBox.Show(ex.ToString()); }
  808.         }
  809.         private void Disconnect_Click(object sender, EventArgs e)
  810.         {
  811.             ConnectionList[0].Disconnect();
  812.         }
  813.         private void AddAdmin_Click(object sender, EventArgs e)
  814.         {
  815.             if (AdminName.Text != "" && AdminName.Text.ToUpper() != "ADD ADMIN MANUALLY")
  816.             {
  817.                 OnlineAdminList.Items.Add(AdminName.Text);
  818.                 AdminName.Text = "Add admin manually";
  819.             }
  820.             else if (OnlinePlayerList.SelectedIndex != -1 && (AdminName.Text == "" || AdminName.Text.ToUpper() == "ADD ADMIN MANUALLY"))
  821.             {
  822.                 OnlineAdminList.Items.Add(OnlinePlayerList.SelectedItem.ToString());
  823.             }
  824.             else
  825.             {
  826.                 MessageBox.Show("Make sure an item is selected and the Admin field is not empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  827.             }
  828.         }
  829.         private void RemoveAdmin_Click(object sender, EventArgs e)
  830.         {
  831.             if (OnlineAdminList.SelectedIndex != -1)
  832.                 OnlineAdminList.Items.Remove(OnlineAdminList.SelectedItem.ToString());
  833.         }
  834.         private void GoDown_CheckedChanged(object sender, EventArgs e)
  835.         {
  836.             if (GoDown.Checked)
  837.             {
  838.                 Thread Thread1, Thread2;
  839.                 Thread1 = new Thread((() =>
  840.                     {
  841.                         for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  842.                         {
  843.                             if (Task[i] == "READY")
  844.                             {
  845.                                 Task[i] = "GoDown0";
  846.                                 ConnectPRIVATE(i);
  847.                                 x = i;
  848.                                 break;
  849.                             }
  850.                         }
  851.                     }));
  852.                 Thread1.IsBackground = true;
  853.                 Thread1.Start();
  854.                 Thread2 = new Thread((() =>
  855.                 {
  856.                     for (int i = x+1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  857.                     {
  858.                         if (Task[i] == "READY")
  859.                         {
  860.                             Task[i] = "GoDown1";
  861.                             ConnectPRIVATE(i);
  862.                             break;
  863.                         }
  864.                     }
  865.                 }));
  866.                 Thread2.IsBackground = true;
  867.                 Thread2.Start();
  868.             }
  869.             else
  870.             {
  871.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  872.                 {
  873.                     if (Task[i] == "GoDown0" || Task[i] == "GoDown1")
  874.                     {
  875.                         ConnectionList[i].Disconnect();
  876.                         Task[i] = "READY";
  877.                     }
  878.                 }
  879.             }
  880.         }
  881.         private void GoUpDel_CheckedChanged(object sender, EventArgs e)
  882.         {
  883.             if (GoUpDel.Checked)
  884.             {
  885.                 Thread Thread1, Thread2;
  886.                 Thread1 = new Thread((() =>
  887.                 {
  888.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  889.                     {
  890.                         if (Task[i] == "READY")
  891.                         {
  892.                             Task[i] = "GoUpDel0";
  893.                             ConnectPRIVATE(i);
  894.                             x = i;
  895.                             break;
  896.                         }
  897.                     }
  898.                 }));
  899.                 Thread1.IsBackground = true;
  900.                 Thread1.Start();
  901.                 Thread2 = new Thread((() =>
  902.                 {
  903.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  904.                     {
  905.                         if (Task[i] == "READY")
  906.                         {
  907.                             Task[i] = "GoUpDel1";
  908.                             ConnectPRIVATE(i);
  909.                             break;
  910.                         }
  911.                     }
  912.                 }));
  913.                 Thread2.IsBackground = true;
  914.                 Thread2.Start();
  915.             }
  916.             else
  917.             {
  918.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  919.                 {
  920.                     if (Task[i] == "GoUpDel0" || Task[i] == "GoUpDel1")
  921.                     {
  922.                         ConnectionList[i].Disconnect();
  923.                         Task[i] = "READY";
  924.                     }
  925.                 }
  926.             }
  927.         }
  928.         private void GoUp_CheckedChanged(object sender, EventArgs e)
  929.         {
  930.             if (GoUp.Checked)
  931.             {
  932.                 Thread Thread1, Thread2;
  933.                 Thread1 = new Thread((() =>
  934.                 {
  935.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  936.                     {
  937.                         if (Task[i] == "READY")
  938.                         {
  939.                             Task[i] = "GoUp0";
  940.                             ConnectPRIVATE(i);
  941.                             x = i;
  942.                             break;
  943.                         }
  944.                     }
  945.                 }));
  946.                 Thread1.IsBackground = true;
  947.                 Thread1.Start();
  948.                 Thread2 = new Thread((() =>
  949.                 {
  950.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  951.                     {
  952.                         if (Task[i] == "READY")
  953.                         {
  954.                             Task[i] = "GoUp1";
  955.                             ConnectPRIVATE(i);
  956.                             break;
  957.                         }
  958.                     }
  959.                 }));
  960.                 Thread2.IsBackground = true;
  961.                 Thread2.Start();
  962.             }
  963.             else
  964.             {
  965.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  966.                 {
  967.                     if (Task[i] == "GoUp0" || Task[i] == "GoUp1")
  968.                     {
  969.                         ConnectionList[i].Disconnect();
  970.                         Task[i] = "READY";
  971.                     }
  972.                 }
  973.             }
  974.         }
  975.         private void GoLeft_CheckedChanged(object sender, EventArgs e)
  976.         {
  977.             if (GoLeft.Checked)
  978.             {
  979.                 Thread Thread1, Thread2;
  980.                 Thread1 = new Thread((() =>
  981.                 {
  982.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  983.                     {
  984.                         if (Task[i] == "READY")
  985.                         {
  986.                             Task[i] = "GoLeft0";
  987.                             ConnectPRIVATE(i);
  988.                             x = i;
  989.                             break;
  990.                         }
  991.                     }
  992.                 }));
  993.                 Thread1.IsBackground = true;
  994.                 Thread1.Start();
  995.                 Thread2 = new Thread((() =>
  996.                 {
  997.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  998.                     {
  999.                         if (Task[i] == "READY")
  1000.                         {
  1001.                             Task[i] = "GoLeft1";
  1002.                             ConnectPRIVATE(i);
  1003.                             break;
  1004.                         }
  1005.                     }
  1006.                 }));
  1007.                 Thread2.IsBackground = true;
  1008.                 Thread2.Start();
  1009.             }
  1010.             else
  1011.             {
  1012.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1013.                 {
  1014.                     if (Task[i] == "GoLeft0" || Task[i] == "GoLeft1")
  1015.                     {
  1016.                         ConnectionList[i].Disconnect();
  1017.                         Task[i] = "READY";
  1018.                     }
  1019.                 }
  1020.             }
  1021.         }
  1022.         private void GoRight_CheckedChanged(object sender, EventArgs e)
  1023.         {
  1024.             if (GoRight.Checked)
  1025.             {
  1026.                 Thread Thread1, Thread2;
  1027.                 Thread1 = new Thread((() =>
  1028.                 {
  1029.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1030.                     {
  1031.                         if (Task[i] == "READY")
  1032.                         {
  1033.                             Task[i] = "GoRight0";
  1034.                             ConnectPRIVATE(i);
  1035.                             x = i;
  1036.                             break;
  1037.                         }
  1038.                     }
  1039.                 }));
  1040.                 Thread1.IsBackground = true;
  1041.                 Thread1.Start();
  1042.                 Thread2 = new Thread((() =>
  1043.                 {
  1044.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1045.                     {
  1046.                         if (Task[i] == "READY")
  1047.                         {
  1048.                             Task[i] = "GoRight1";
  1049.                             ConnectPRIVATE(i);
  1050.                             break;
  1051.                         }
  1052.                     }
  1053.                 }));
  1054.                 Thread2.IsBackground = true;
  1055.                 Thread2.Start();
  1056.             }
  1057.             else
  1058.             {
  1059.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1060.                 {
  1061.                     if (Task[i] == "GoRight0" || Task[i] == "GoRight1")
  1062.                     {
  1063.                         ConnectionList[i].Disconnect();
  1064.                         Task[i] = "READY";
  1065.                     }
  1066.                 }
  1067.             }
  1068.         }
  1069.         private void AddSelectedPlayer_Click(object sender, EventArgs e)
  1070.         {
  1071.             if (AdminName.Text != "" && AdminName.Text.ToUpper() != "ADD ADMIN MANUALLY")
  1072.             {
  1073.                 OnlineAdminList.Items.Add(AdminName.Text);
  1074.                 AdminName.Text = "Add admin manually";
  1075.             }
  1076.             else if (OnlinePlayerList.SelectedIndex != -1 && (AdminName.Text == "" || AdminName.Text.ToUpper() == "ADD ADMIN MANUALLY"))
  1077.             {
  1078.                 SelectedPlayerList.Items.Add(OnlinePlayerList.SelectedItem.ToString());
  1079.             }
  1080.             else
  1081.             {
  1082.                 MessageBox.Show("Make sure an item is selected and the Admin/SelectedPlayer field is not empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
  1083.             }
  1084.         }
  1085.         private void RemoveSelectedPlayer_Click(object sender, EventArgs e)
  1086.         {
  1087.             if (SelectedPlayerList.SelectedIndex != -1)
  1088.                 SelectedPlayerList.Items.Remove(SelectedPlayerList.SelectedItem.ToString());
  1089.         }
  1090.         private void TakeDown_CheckedChanged(object sender, EventArgs e)
  1091.         {
  1092.             if (TakeDown.Checked)
  1093.             {
  1094.                 Thread Thread1, Thread2, Thread3, Thread4, Thread5, Thread6;
  1095.                 Thread1 = new Thread((() =>
  1096.                 {
  1097.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1098.                     {
  1099.                         if (Task[i] == "READY")
  1100.                         {
  1101.                             Task[i] = "TakeDown0";
  1102.                             ConnectPRIVATE(i);
  1103.                             x = i;
  1104.                             break;
  1105.                         }
  1106.                     }
  1107.                 }));
  1108.                 Thread1.IsBackground = true;
  1109.                 Thread1.Start();
  1110.                 Thread2 = new Thread((() =>
  1111.                 {
  1112.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1113.                     {
  1114.                         if (Task[i] == "READY")
  1115.                         {
  1116.                             Task[i] = "TakeDown1";
  1117.                             ConnectPRIVATE(i);
  1118.                             x = i;
  1119.                             break;
  1120.                         }
  1121.                     }
  1122.                 }));
  1123.                 Thread2.IsBackground = true;
  1124.                 Thread2.Start();
  1125.  
  1126.                 Thread3 = new Thread((() =>
  1127.                 {
  1128.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1129.                     {
  1130.                         if (Task[i] == "READY")
  1131.                         {
  1132.                             Task[i] = "TakeDown2";
  1133.                             ConnectPRIVATE(i);
  1134.                             x = i;
  1135.                             break;
  1136.                         }
  1137.                     }
  1138.                 }));
  1139.                 Thread3.IsBackground = true;
  1140.                 Thread3.Start();
  1141.                 Thread4 = new Thread((() =>
  1142.                 {
  1143.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1144.                     {
  1145.                         if (Task[i] == "READY")
  1146.                         {
  1147.                             Task[i] = "TakeDown3";
  1148.                             ConnectPRIVATE(i);
  1149.                             x = i;
  1150.                             break;
  1151.                         }
  1152.                     }
  1153.                 }));
  1154.                 Thread4.IsBackground = true;
  1155.                 Thread4.Start();
  1156.  
  1157.                 Thread5 = new Thread((() =>
  1158.                 {
  1159.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1160.                     {
  1161.                         if (Task[i] == "READY")
  1162.                         {
  1163.                             Task[i] = "TakeDown4";
  1164.                             ConnectPRIVATE(i);
  1165.                             x = i;
  1166.                             break;
  1167.                         }
  1168.                     }
  1169.                 }));
  1170.                 Thread5.IsBackground = true;
  1171.                 Thread5.Start();
  1172.                 Thread6 = new Thread((() =>
  1173.                 {
  1174.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1175.                     {
  1176.                         if (Task[i] == "READY")
  1177.                         {
  1178.                             Task[i] = "TakeDown5";
  1179.                             ConnectPRIVATE(i);
  1180.                             break;
  1181.                         }
  1182.                     }
  1183.                 }));
  1184.                 Thread6.IsBackground = true;
  1185.                 Thread6.Start();
  1186.             }
  1187.             else
  1188.             {
  1189.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1190.                 {
  1191.                     if (Task[i].Contains("TakeDown"))
  1192.                     {
  1193.                         ConnectionList[i].Disconnect();
  1194.                         Task[i] = "READY";
  1195.                     }
  1196.                 }
  1197.             }
  1198.         }
  1199.         private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
  1200.         {
  1201.             BlockID = Convert.ToInt32(comboBox6.Text.Split(' ')[1]);
  1202.         }
  1203.         private void FlyBox_CheckedChanged(object sender, EventArgs e)
  1204.         {
  1205.             if (FlyBox.Checked)
  1206.             {
  1207.                 Thread Thread1, Thread2, Thread3, Thread4, Thread5, Thread6, Thread7, Thread8;
  1208.                 Thread1 = new Thread((() =>
  1209.                 {
  1210.                     for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1211.                     {
  1212.                         if (Task[i] == "READY")
  1213.                         {
  1214.                             Task[i] = "Shuttle_0";
  1215.                             ConnectPRIVATE(i);
  1216.                             x = i;
  1217.                             break;
  1218.                         }
  1219.                     }
  1220.                 }));
  1221.                 Thread1.IsBackground = true;
  1222.                 Thread1.Start();
  1223.                 Thread2 = new Thread((() =>
  1224.                 {
  1225.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1226.                     {
  1227.                         if (Task[i] == "READY")
  1228.                         {
  1229.                             Task[i] = "Shuttle_1";
  1230.                             ConnectPRIVATE(i);
  1231.                             x = i;
  1232.                             break;
  1233.                         }
  1234.                     }
  1235.                 }));
  1236.                 Thread2.IsBackground = true;
  1237.                 Thread2.Start();
  1238.  
  1239.                 Thread3 = new Thread((() =>
  1240.                 {
  1241.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1242.                     {
  1243.                         if (Task[i] == "READY")
  1244.                         {
  1245.                             Task[i] = "Shuttle_2";
  1246.                             ConnectPRIVATE(i);
  1247.                             x = i;
  1248.                             break;
  1249.                         }
  1250.                     }
  1251.                 }));
  1252.                 Thread3.IsBackground = true;
  1253.                 Thread3.Start();
  1254.                 Thread4 = new Thread((() =>
  1255.                 {
  1256.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1257.                     {
  1258.                         if (Task[i] == "READY")
  1259.                         {
  1260.                             Task[i] = "Shuttle_3";
  1261.                             ConnectPRIVATE(i);
  1262.                             x = i;
  1263.                             break;
  1264.                         }
  1265.                     }
  1266.                 }));
  1267.                 Thread4.IsBackground = true;
  1268.                 Thread4.Start();
  1269.  
  1270.                 Thread5 = new Thread((() =>
  1271.                 {
  1272.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1273.                     {
  1274.                         if (Task[i] == "READY")
  1275.                         {
  1276.                             Task[i] = "Shuttle_4";
  1277.                             ConnectPRIVATE(i);
  1278.                             x = i;
  1279.                             break;
  1280.                         }
  1281.                     }
  1282.                 }));
  1283.                 Thread5.IsBackground = true;
  1284.                 Thread5.Start();
  1285.                 Thread6 = new Thread((() =>
  1286.                 {
  1287.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1288.                     {
  1289.                         if (Task[i] == "READY")
  1290.                         {
  1291.                             Task[i] = "Shuttle_5";
  1292.                             ConnectPRIVATE(i);
  1293.                             x = i;
  1294.                             break;
  1295.                         }
  1296.                     }
  1297.                 }));
  1298.                 Thread6.IsBackground = true;
  1299.                 Thread6.Start();
  1300.                 Thread7 = new Thread((() =>
  1301.                 {
  1302.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1303.                     {
  1304.                         if (Task[i] == "READY")
  1305.                         {
  1306.                             Task[i] = "Shuttle_6";
  1307.                             ConnectPRIVATE(i);
  1308.                             x = i;
  1309.                             break;
  1310.                         }
  1311.                     }
  1312.                 }));
  1313.                 Thread7.IsBackground = true;
  1314.                 Thread7.Start();
  1315.                 Thread8 = new Thread((() =>
  1316.                 {
  1317.                     for (int i = x + 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1318.                     {
  1319.                         if (Task[i] == "READY")
  1320.                         {
  1321.                             Task[i] = "Shuttle_7";
  1322.                             ConnectPRIVATE(i);
  1323.                             break;
  1324.                         }
  1325.                     }
  1326.                 }));
  1327.                 Thread8.IsBackground = true;
  1328.                 Thread8.Start();
  1329.             }
  1330.             else
  1331.             {
  1332.                 for (int i = 1; i < Math.Min(Usernames.Length, Passwords.Length); i++)
  1333.                 {
  1334.                     if (Task[i].Contains("TakeDown"))
  1335.                     {
  1336.                         ConnectionList[i].Disconnect();
  1337.                         Task[i] = "READY";
  1338.                     }
  1339.                 }
  1340.             }
  1341.         }
  1342.         private void OnlinePlayerList_SelectedIndexChanged(object sender, EventArgs e)
  1343.         {
  1344.             Astronaut.Text = OnlinePlayerList.SelectedItem.ToString();
  1345.         }
  1346.     }
  1347. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement