private void start_stop_Button(object sender, RoutedEventArgs e)
        {
            FrameworkElement ownerGui = ((FrameworkElement)sender);
            Smurf            obj      = ownerGui.DataContext as Smurf;
            int index = App.smurfList.IndexOf(obj);

            if (User.multiSmurf || index == 0)
            {
                if (obj.thread == null)
                {
                    obj.button = ((Button)sender);
                    obj.start();
                    ((Button)sender).Content = "Stop";
                }
                else
                {
                    obj.button = ((Button)sender);
                    obj.stop();
                    ((Button)sender).Content = "Start";
                }
            }
            else
            {
                MessageBox.Show("You can only start the first smurf you added, to run multiple smurfs you can upgrade your account.");
                Account toUpgrade = new Account();
                toUpgrade.Show();
            }
        }
        private void log_Button(object sender, RoutedEventArgs e)
        {
            FrameworkElement ownerGui = ((FrameworkElement)sender);
            Smurf            obj      = ownerGui.DataContext as Smurf;

            LogWindow logger = new LogWindow(obj);

            logger.Show();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (maxLevels.SelectedValue != null && rgCombo.SelectedValue != null)
            {
                LoLLauncher.Region regi = (LoLLauncher.Region)System.Enum.Parse(typeof(LoLLauncher.Region), rgCombo.SelectedValue.ToString());
                if (username.Text.Length > 0 && password.Text.Length > 0)
                {
                    bool smurfFound = App.smurfList.Any(smurf => (smurf.username == username.Text && smurf.region == regi));
                    if (!smurfFound)
                    {
                        Smurf newSmurf = new Smurf();
                        newSmurf.username = username.Text;
                        newSmurf.password = password.Text;
                        newSmurf.region   = regi;

                        if (maxLevels.SelectedValue.ToString() == "Unlimited")
                        {
                            newSmurf.maxLevel = 31;
                        }
                        else
                        {
                            newSmurf.maxLevel = Int32.Parse(maxLevels.SelectedValue.ToString());
                        }
                        App.smurfList.Add(newSmurf);
                        Settings.update();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("This smurf already exists");
                    }
                }
                else
                {
                    MessageBox.Show("Please fill all inputs");
                }
            }
            else
            {
                MessageBox.Show("Please fill all inputs");
            }
        }
示例#4
0
        public RiotBot(string username, string password, int accmaxlevel, string reg, string path, QueueTypes QueueType, string cMask, Smurf own)
        {
            ipath       = path;
            Accountname = username;
            Password    = password;
            clientMask  = cMask;
            AccMaxLevel = Convert.ToInt32(accmaxlevel);
            queueType   = QueueType;
            region      = reg;
            Owner       = own;

            this.updateStatus("Trying to login...", Accountname);

            connection.OnError            += new LoLConnection.OnErrorHandler(this.connection_OnError);
            connection.OnLogin            += new LoLConnection.OnLoginHandler(this.connection_OnLogin);
            connection.OnLoginQueueUpdate += new LoLConnection.OnLoginQueueUpdateHandler(this.connection_OnLoginQueueUpdate);
            connection.OnMessageReceived  += new LoLConnection.OnMessageReceivedHandler(this.connection_OnMessageReceived);

            init(region, username, password);
        }
示例#5
0
 public LogWindow(Smurf smurf)
 {
     InitializeComponent();
     slogname.Content     = smurf.username + " Logs";
     LogsView.ItemsSource = smurf.Status;
 }