Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        th = GetComponent <TranslationHandler>();
        th.Init();

        for (int i = 0; i < listTrCubes.Count; i++)
        {
            TranslationHandler.Translation t = new TranslationHandler.Translation(listTrCubes[i].name, fSpeed);
            t.AddKeyPose(new Vector3(0, 2, 0), Quaternion.identity);
            t.AddKeyPose(new Vector3(0, 1.05f, 0), listTrCubes[i].rotation, listTrCubes[i]);
            th.listTranslation.Add(t);
        }

        TranslationHandler.Translation t1 = new TranslationHandler.Translation("test", fSpeed);
        t1.AddKeyPose(new Vector3(-.5f, 2, 0), Quaternion.identity);
        for (int i = 0; i < listTrCubes.Count; i++)
        {
            t1.AddKeyPose(new Vector3(0, 1.05f, 0), listTrCubes[i].rotation, listTrCubes[i]);
        }
        t1.AddKeyPose(new Vector3(.5f, 2, 0), Quaternion.identity);
        th.listTranslation.Add(t1);

        th.SetCurrent("test");
        //Debug.Log(th.GetTranslationByName("test").listKeyPoses.Count);
    }
Esempio n. 2
0
        private void GUI_Load(object sender, EventArgs e)
        {
            // Create missing Files
            Directory.CreateDirectory(Program.path);
            Directory.CreateDirectory(Program.path_translation);

            // Load Languages Files always UP2Date
            try
            {
                ExtendedWebClient client       = new ExtendedWebClient();
                string            translations = client.DownloadString("http://pokemon-go.ar1i.xyz/lang/get.php");
                string[]          transArray   = translations.Replace("\r", string.Empty).Split('\n');
                for (int ijik = 0; ijik < transArray.Count(); ijik++)
                {
                    client.DownloadFile("http://pokemon-go.ar1i.xyz/lang/" + transArray[ijik], Program.path_translation + "\\" + transArray[ijik]);
                }
            }
            catch (Exception)
            {
                List <string> b = new List <string>();
                b.Add("de.json");
                b.Add("france.json");
                b.Add("italian.json");
                b.Add("ptBR.json");
                b.Add("ru.json");
                b.Add("spain.json");
                b.Add("tr.json");

                foreach (var l in b)
                {
                    Extract("PokemonGo.RocketAPI.Console", Program.path_translation, "Lang", l);
                }
            }

            TranslationHandler.Init();

            // Version Infoooo
            groupBox9.Text = "Your Version: " + Assembly.GetExecutingAssembly().GetName().Version + " | Newest: " + Program.getNewestVersion();
            if (Program.getNewestVersion() > Assembly.GetExecutingAssembly().GetName().Version)
            {
                DialogResult dialogResult = MessageBox.Show("There is an Update on Github. do you want to open it ?", "Newest Version: " + Program.getNewestVersion(), MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Process.Start("https://github.com/Ar1i/PokemonGo-Bot");
                }
                else if (dialogResult == DialogResult.No)
                {
                    //nothing
                }
            }

            comboBox1.DisplayMember = "Text";
            var types = new[] {
                new { Text = "Google" },
                new { Text = "Pokemon Trainer Club" },
            };

            comboBox1.DataSource = types;

            //textBox1.Hide();
            //label2.Hide();
            //textBox2.Hide();
            //label3.Hide();

            var pokeIDS   = new Dictionary <string, int>();
            var evolveIDS = new Dictionary <string, int>();
            int i         = 1;
            int ev        = 1;

            foreach (PokemonId pokemon in Enum.GetValues(typeof(PokemonId)))
            {
                if (pokemon.ToString() != "Missingno")
                {
                    pokeIDS[pokemon.ToString()] = i;
                    gerEng[StringUtils.getPokemonNameGer(pokemon)] = pokemon.ToString();
                    if (checkBox8.Checked)
                    {
                        checkedListBox1.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                        checkedListBox2.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                        if (!(evolveBlacklist.Contains(i)))
                        {
                            checkedListBox3.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                            evolveIDS[pokemon.ToString()] = ev;
                            ev++;
                        }
                    }
                    else
                    {
                        checkedListBox1.Items.Add(pokemon.ToString());
                        checkedListBox2.Items.Add(pokemon.ToString());
                        if (!(evolveBlacklist.Contains(i)))
                        {
                            checkedListBox3.Items.Add(pokemon.ToString());
                            evolveIDS[pokemon.ToString()] = ev;
                            ev++;
                        }
                    }
                    i++;
                }
            }

            if (File.Exists(Program.account))
            {
                string[] lines = File.ReadAllLines(@Program.account);
                i = 1;
                int tb = 1;
                foreach (string line in lines)
                {
                    switch (i)
                    {
                    case 1:
                        if (line == "Google")
                        {
                            comboBox1.SelectedIndex = 0;
                        }
                        else
                        {
                            comboBox1.SelectedIndex = 1;
                        }
                        break;

                    case 9:
                        checkBox1.Checked = bool.Parse(line);
                        break;

                    case 10:
                        checkBox2.Checked = bool.Parse(line);
                        break;

                    case 12:
                        checkBox3.Checked = bool.Parse(line);
                        break;

                    case 14:
                        textBox18.Text = line;
                        break;

                    case 15:
                        textBox19.Text = line;
                        break;

                    case 16:
                        textBox20.Text = line;
                        break;

                    case 17:
                        //if (line == "1")
                        //{
                        //    Globals.navigation_option = 1;
                        //    checkBox8.Checked = true;
                        //    checkBox7.Checked = false;
                        //} else
                        //{
                        //    Globals.navigation_option = 2;
                        //    checkBox7.Checked = true;
                        //    checkBox8.Checked = false;
                        //}
                        break;

                    case 18:
                        checkBox7.Checked = bool.Parse(line);
                        break;

                    case 19:
                        checkBox8.Checked = bool.Parse(line);
                        break;

                    case 20:
                        checkBox9.Checked = bool.Parse(line);
                        break;

                    case 21:
                        textBox24.Text = line;
                        break;

                    case 22:
                        checkBox10.Checked = bool.Parse(line);
                        break;

                    case 23:
                        checkBox11.Checked = bool.Parse(line);
                        break;

                    case 24:
                        checkBox12.Checked = bool.Parse(line);
                        break;

                    case 25:
                        chkAutoIncubate.Checked = bool.Parse(line);
                        chkAutoIncubate_CheckedChanged(null, EventArgs.Empty);
                        break;

                    case 26:
                        chkUseBasicIncubators.Checked = bool.Parse(line);
                        break;

                    default:
                        TextBox temp = (TextBox)Controls.Find("textBox" + tb, true).FirstOrDefault();
                        temp.Text = line;
                        tb++;
                        break;
                    }
                    i++;
                }
            }
            else
            {
                textBox3.Text  = "40,764883";
                textBox4.Text  = "-73,972967";
                textBox5.Text  = "10";
                textBox6.Text  = "50";
                textBox7.Text  = "5000";
                textBox8.Text  = "3";
                textBox9.Text  = "999";
                textBox20.Text = "5000";
            }

            if (File.Exists(Program.items))
            {
                string[] lines = File.ReadAllLines(@Program.items);
                i = 10;
                foreach (string line in lines)
                {
                    if (i == 18)
                    {
                        i = 22;
                    }
                    else if (i == 23)
                    {
                        i = 21;
                    }
                    else if (i == 22)
                    {
                        i = 23;
                    }
                    TextBox temp = (TextBox)Controls.Find("textBox" + i, true).FirstOrDefault();
                    temp.Text = line;
                    i++;
                }
            }
            else
            {
                textBox10.Text = "20";
                textBox11.Text = "50";
                textBox12.Text = "100";
                textBox13.Text = "20";
                textBox14.Text = "0";
                textBox15.Text = "0";
                textBox16.Text = "50";
                textBox17.Text = "75";
                textBox22.Text = "200";
                textBox21.Text = "100";
                textBox23.Text = "20";
                textBox24.Text = "90";
            }

            if (File.Exists(Program.keep))
            {
                string[] lines = File.ReadAllLines(@Program.keep);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox1.SetItemChecked(pokeIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox1.SetItemChecked(pokeIDS[line] - 1, true);
                        }
                    }
                }
            }

            if (File.Exists(Program.ignore))
            {
                string[] lines = File.ReadAllLines(@Program.ignore);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox2.SetItemChecked(pokeIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox2.SetItemChecked(pokeIDS[line] - 1, true);
                        }
                    }
                }
            }

            if (File.Exists(Program.lastcords))
            {
                try
                {
                    var    latlngFromFile = File.ReadAllText(Program.lastcords);
                    var    latlng = latlngFromFile.Split(':');
                    double latitude, longitude;
                    double.TryParse(latlng[0], out latitude);
                    double.TryParse(latlng[1], out longitude);
                    Globals.latitute  = latitude;
                    Globals.longitude = longitude;
                }
                catch
                {
                }
            }

            if (File.Exists(Program.evolve))
            {
                string[] lines = File.ReadAllLines(@Program.evolve);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox3.SetItemChecked(evolveIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox3.SetItemChecked(evolveIDS[line] - 1, true);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        private void GUI_Load(object sender, EventArgs e)
        {
            MessageBox.Show("Use at your own risk, Niantic is banning these days!");
            MessageBox.Show("Use the Bot only for 8 hours and turn off in afterwards for at least 2 hours + Spin per day not more than ~500-700 PokeStops and dont Catch more than ~500 Pokemon per day!!");
            _clientSettings = new Settings();
            // Create missing Files
            Directory.CreateDirectory(Program.path);
            Directory.CreateDirectory(Program.path_translation);
            Directory.CreateDirectory(devicePath);

            if (!File.Exists(deviceinfo))
            {
                var f = File.Create(deviceinfo);
                f.Close();
                File.WriteAllLines(deviceinfo, new string[] { "galaxy6", " " });
            }
            else
            {
                // Try to read the device name
                string[] arrLine = File.ReadAllLines(deviceinfo);
                try
                {
                    if (arrLine[0] != null)
                    {
                        comboBox2.Text = arrLine[0];
                    }
                } catch (Exception) {
                }
            }

            List <string> b = new List <string>();

            b.Add("de.json");
            b.Add("france.json");
            b.Add("italian.json");
            b.Add("ptBR.json");
            b.Add("ru.json");
            b.Add("spain.json");
            b.Add("tr.json");
            b.Add("th.json");

            foreach (var l in b)
            {
                Extract("PokemonGo.RocketAPI.Console", Program.path_translation, "Lang", l);
            }

            TranslationHandler.Init();

            // Version Infoooo
            groupBox9.Text = "Your Version: " + Assembly.GetExecutingAssembly().GetName().Version + " | Newest: " + Program.getNewestVersion();
            if (Program.getNewestVersion() > Assembly.GetExecutingAssembly().GetName().Version)
            {
                DialogResult dialogResult = MessageBox.Show("There is an Update on Pokecrot. do you want to redownload it ?", "Newest Version: " + Program.getNewestVersion(), MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    Process.Start("https://pokecrot.com/");
                }
                else if (dialogResult == DialogResult.No)
                {
                    //nothing
                }
            }

            comboBox1.DisplayMember = "Text";
            var types = new[] {
                new { Text = "Google" },
                new { Text = "Pokemon Trainer Club" },
            };

            comboBox1.DataSource = types;

            //textBox1.Hide();
            //label2.Hide();
            //textBox2.Hide();
            //label3.Hide();

            var pokeIDS   = new Dictionary <string, int>();
            var evolveIDS = new Dictionary <string, int>();
            int i         = 1;
            int ev        = 1;

            foreach (PokemonId pokemon in Enum.GetValues(typeof(PokemonId)))
            {
                if (pokemon.ToString() != "Missingno")
                {
                    pokeIDS[pokemon.ToString()] = i;
                    gerEng[StringUtils.getPokemonNameGer(pokemon)] = pokemon.ToString();
                    if (checkBox8.Checked)
                    {
                        checkedListBox1.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                        checkedListBox2.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                        if (!(evolveBlacklist.Contains(i)))
                        {
                            checkedListBox3.Items.Add(StringUtils.getPokemonNameGer(pokemon));
                            evolveIDS[pokemon.ToString()] = ev;
                            ev++;
                        }
                    }
                    else
                    {
                        checkedListBox1.Items.Add(pokemon.ToString());
                        checkedListBox2.Items.Add(pokemon.ToString());
                        if (!(evolveBlacklist.Contains(i)))
                        {
                            checkedListBox3.Items.Add(pokemon.ToString());
                            evolveIDS[pokemon.ToString()] = ev;
                            ev++;
                        }
                    }
                    i++;
                }
            }

            if (File.Exists(Program.account))
            {
                string[] lines = File.ReadAllLines(@Program.account);
                i = 1;
                int tb = 1;
                foreach (string line in lines)
                {
                    switch (i)
                    {
                    case 1:
                        if (line == "Google")
                        {
                            comboBox1.SelectedIndex = 0;
                        }
                        else
                        {
                            comboBox1.SelectedIndex = 1;
                        }
                        break;

                    case 9:
                        checkBox1.Checked = bool.Parse(line);
                        break;

                    case 10:
                        checkBox2.Checked = bool.Parse(line);
                        break;

                    case 12:
                        checkBox3.Checked = bool.Parse(line);
                        break;

                    case 14:
                        textBox18.Text = line;
                        break;

                    case 15:
                        textBox19.Text = line;
                        break;

                    case 16:
                        textBox20.Text = line;
                        break;

                    case 17:
                        //if (line == "1")
                        //{
                        //    Globals.navigation_option = 1;
                        //    checkBox8.Checked = true;
                        //    checkBox7.Checked = false;
                        //} else
                        //{
                        //    Globals.navigation_option = 2;
                        //    checkBox7.Checked = true;
                        //    checkBox8.Checked = false;
                        //}
                        break;

                    case 18:
                        checkBox7.Checked = bool.Parse(line);
                        break;

                    case 19:
                        checkBox8.Checked = bool.Parse(line);
                        break;

                    case 20:
                        checkBox9.Checked = bool.Parse(line);
                        break;

                    case 21:
                        textBox24.Text = line;
                        break;

                    case 22:
                        checkBox10.Checked = bool.Parse(line);
                        break;

                    case 23:
                        checkBox11.Checked = bool.Parse(line);
                        break;

                    case 24:
                        checkBox12.Checked = bool.Parse(line);
                        break;

                    case 25:
                        chkAutoIncubate.Checked = bool.Parse(line);
                        chkAutoIncubate_CheckedChanged(null, EventArgs.Empty);
                        break;

                    case 26:
                        chkUseBasicIncubators.Checked = bool.Parse(line);
                        break;

                    case 27:
                        checkBox15.Checked = bool.Parse(line);
                        break;

                    case 28:
                        //langSelected = line;
                        break;

                    case 29:
                        checkBox16.Checked = bool.Parse(line);
                        break;

                    case 30:
                        textBox26.Text = line;
                        break;

                    case 31:
                        checkBox17.Checked = bool.Parse(line);
                        break;

                    default:
                        TextBox temp = (TextBox)Controls.Find("textBox" + tb, true).FirstOrDefault();
                        temp.Text = line;
                        tb++;
                        break;
                    }
                    i++;
                }
            }
            else
            {
                textBox3.Text  = "40,764883";
                textBox4.Text  = "-73,972967";
                textBox5.Text  = "10";
                textBox6.Text  = "5";
                textBox7.Text  = "5000";
                textBox8.Text  = "3";
                textBox9.Text  = "999";
                textBox20.Text = "5000";
            }

            if (File.Exists(Program.items))
            {
                string[] lines = File.ReadAllLines(@Program.items);
                i = 10;
                foreach (string line in lines)
                {
                    if (i == 18)
                    {
                        i = 22;
                    }
                    else if (i == 23)
                    {
                        i = 21;
                    }
                    else if (i == 22)
                    {
                        i = 23;
                    }
                    TextBox temp = (TextBox)Controls.Find("textBox" + i, true).FirstOrDefault();
                    temp.Text = line;
                    i++;
                }
            }
            else
            {
                textBox10.Text = "20";
                textBox11.Text = "50";
                textBox12.Text = "100";
                textBox13.Text = "20";
                textBox14.Text = "0";
                textBox15.Text = "0";
                textBox16.Text = "50";
                textBox17.Text = "75";
                textBox22.Text = "200";
                textBox21.Text = "100";
                textBox23.Text = "20";
                textBox24.Text = "90";
            }

            if (File.Exists(Program.keep))
            {
                string[] lines = File.ReadAllLines(@Program.keep);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox1.SetItemChecked(pokeIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox1.SetItemChecked(pokeIDS[line] - 1, true);
                        }
                    }
                }
            }

            if (File.Exists(Program.ignore))
            {
                string[] lines = File.ReadAllLines(@Program.ignore);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox2.SetItemChecked(pokeIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox2.SetItemChecked(pokeIDS[line] - 1, true);
                        }
                    }
                }
            }

            if (File.Exists(Program.lastcords))
            {
                try
                {
                    var    latlngFromFile = File.ReadAllText(Program.lastcords);
                    var    latlng = latlngFromFile.Split(':');
                    double latitude, longitude;
                    double.TryParse(latlng[0], out latitude);
                    double.TryParse(latlng[1], out longitude);
                    Globals.latitute  = latitude;
                    Globals.longitude = longitude;
                }
                catch
                {
                }
            }

            if (File.Exists(Program.evolve))
            {
                string[] lines = File.ReadAllLines(@Program.evolve);
                foreach (string line in lines)
                {
                    if (line != string.Empty)
                    {
                        if (checkBox8.Checked)
                        {
                            checkedListBox3.SetItemChecked(evolveIDS[gerEng[line]] - 1, true);
                        }
                        else
                        {
                            checkedListBox3.SetItemChecked(evolveIDS[line] - 1, true);
                        }
                    }
                }
            }
            // Load Proxy Settings
            if (_clientSettings.UseProxyHost != string.Empty)
            {
                prxyIP.Text = _clientSettings.UseProxyHost;
            }

            if (_clientSettings.UseProxyPort != 0)
            {
                prxyPort.Text = "" + _clientSettings.UseProxyPort;
            }

            if (_clientSettings.UseProxyUsername != string.Empty)
            {
                prxyUser.Text = _clientSettings.UseProxyUsername;
            }

            if (_clientSettings.UseProxyPassword != string.Empty)
            {
                prxyPass.Text = "" + _clientSettings.UseProxyPassword;
            }

            if (prxyIP.Text != "HTTPS Proxy IP")
            {
                _clientSettings.UseProxyVerified = true;
            }
            else
            {
                _clientSettings.UseProxyVerified = false;
            }

            if (prxyUser.Text != "Proxy Username")
            {
                _clientSettings.UseProxyAuthentication = true;
            }
            else
            {
                _clientSettings.UseProxyAuthentication = false;
            }

            // Placeholder event add
            prxyIP.GotFocus   += new EventHandler(prxy_GotFocus);
            prxyPort.GotFocus += new EventHandler(prxy_GotFocus);
            prxyUser.GotFocus += new EventHandler(prxy_GotFocus);
            prxyPass.GotFocus += new EventHandler(prxy_GotFocus);
        }