Exemplo n.º 1
0
        public MainPage()
        {
            Thread.CurrentThread.Name = "UI Thread";
            Bot = new BotClient(App.LanguageXMLFile);
            Bot.ClientChanged               += Bot_ClientChanged;
            Bot.StateChanged                += Bot_StateChanged;
            Bot.ConnectionOpened            += Bot_ConnectionOpened;
            Bot.ConnectionClosed            += Bot_ConnectionClosed;
            Bot.MessageLogged               += Bot_LogMessage;
            Bot.PokemonEvolver.StateChanged += Bot_PokemonEvolverStateChanged;

            Team        = new TeamView(Bot);
            Chat        = new ChatView(Bot);
            Players     = new PlayersView(Bot);
            Inventories = new InventoryView();

            InitializeComponents();

            Task.Run(() => UpdateClients());

            _refreshPlayers      = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;
            _refreshPlayersDelay = CurrentPage == Players ? 200 : 5000;

            LogMessage("Running PROShine by Silv3r. Ported to android by PreciousTrainer.");
            btnLogin.Clicked         += BtnLogin_Clicked;
            btnLoadScript.Clicked    += LoadScript_Clicked;
            AutoEvolveSwitch.Toggled += AutoEvolveSwitch_Toggled;
            btnStopBot.Clicked       += BtnBot_Clicked1;
            btnBot.Clicked           += BtnBot_Clicked;
        }
Exemplo n.º 2
0
        public MainWindow()
        {
#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
#endif
            Thread.CurrentThread.Name = "UI Thread";

            Bot = new BotClient();
            Bot.StateChanged  += Bot_StateChanged;
            Bot.ClientChanged += Bot_ClientChanged;
            Bot.AutoReconnector.StateChanged += Bot_AutoReconnectorStateChanged;
            Bot.StaffAvoider.StateChanged    += Bot_StaffAvoiderStateChanged;
            Bot.PokemonEvolver.StateChanged  += Bot_PokemonEvolverStateChanged;
            Bot.ConnectionOpened             += Bot_ConnectionOpened;
            Bot.ConnectionClosed             += Bot_ConnectionClosed;
            Bot.MessageLogged  += Bot_LogMessage;
            Bot.SliderCreated  += Bot_SliderCreated;
            Bot.SliderRemoved  += Bot_SliderRemoved;
            Bot.TextboxCreated += Bot_TextboxCreated;
            Bot.TextboxRemoved += Bot_TextboxRemoved;

            InitializeComponent();
            AutoReconnectSwitch.IsChecked = Bot.AutoReconnector.IsEnabled;
            AvoidStaffSwitch.IsChecked    = Bot.StaffAvoider.IsEnabled;
            AutoEvolveSwitch.IsChecked    = Bot.PokemonEvolver.IsEnabled;

            App.InitializeVersion();

            Team      = new TeamView(Bot);
            Inventory = new InventoryView();
            Chat      = new ChatView(Bot);
            Players   = new PlayersView(Bot);
            Map       = new MapView(Bot);

            FileLog = new FileLogger();

            _refreshPlayers      = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;

            AddView(Team, TeamContent, TeamButton, true);
            AddView(Inventory, InventoryContent, InventoryButton);
            AddView(Chat, ChatContent, ChatButton);
            AddView(Players, PlayersContent, PlayersButton);
            AddView(Map, MapContent, MapButton);

            SetTitle(null);

            LogMessage("Running " + App.Name + " by " + App.Author + ", version " + App.Version);

            Task.Run(() => UpdateClients());

            OptionSliders.ItemsSource = _sliderOptions = new ObservableCollection <OptionSlider>();
            TextOptions.ItemsSource   = _textOptions = new ObservableCollection <TextOption>();
        }
Exemplo n.º 3
0
        public MainWindow()
        {
#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
#endif
            Thread.CurrentThread.Name = "UI Thread";

            Bot = new BotClient();
            Bot.StateChanged  += Bot_StateChanged;
            Bot.ClientChanged += Bot_ClientChanged;
            Bot.AutoReconnector.StateChanged += Bot_AutoReconnectorStateChanged;
            Bot.StaffAvoider.StateChanged    += Bot_StaffAvoiderStateChanged;
            Bot.PokemonEvolver.StateChanged  += Bot_PokemonEvolverStateChanged;
            Bot.ConnectionOpened             += Bot_ConnectionOpened;
            Bot.ConnectionClosed             += Bot_ConnectionClosed;
            Bot.MessageLogged += Bot_LogMessage;

            InitializeComponent();
            AutoReconnectSwitch.IsChecked = Bot.AutoReconnector.IsEnabled;
            AvoidStaffSwitch.IsChecked    = Bot.StaffAvoider.IsEnabled;
            AutoEvolveSwitch.IsChecked    = Bot.PokemonEvolver.IsEnabled;

            App.InitializeVersion();

            Team      = new TeamView(Bot);
            Inventory = new InventoryView();
            Chat      = new ChatView(Bot);
            Players   = new PlayersView(Bot);

            _refreshPlayers      = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;

            TeamContent.Content      = Team;
            InventoryContent.Content = Inventory;
            ChatContent.Content      = Chat;
            PlayersContent.Content   = Players;

            TeamContent.Visibility      = Visibility.Visible;
            InventoryContent.Visibility = Visibility.Collapsed;
            ChatContent.Visibility      = Visibility.Collapsed;
            PlayersContent.Visibility   = Visibility.Collapsed;
            TeamButton.IsChecked        = true;

            SetTitle(null);

            LogMessage("Running " + App.Name + " by " + App.Author + ", version " + App.Version);

            Task.Run(() => UpdateClients());
        }
Exemplo n.º 4
0
        public MainWindow()
        {
#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
#endif
            Thread.CurrentThread.Name = "UI Thread";

            Bot = new BotClient();
            Bot.StateChanged  += Bot_StateChanged;
            Bot.ClientChanged += Bot_ClientChanged;
            Bot.AutoReconnector.StateChanged += Bot_AutoReconnectorStateChanged;
            Bot.StaffAvoider.StateChanged    += Bot_StaffAvoiderStateChanged;
            Bot.PokemonEvolver.StateChanged  += Bot_PokemonEvolverStateChanged;
            Bot.ConnectionOpened             += Bot_ConnectionOpened;
            Bot.ConnectionClosed             += Bot_ConnectionClosed;
            Bot.MessageLogged += Bot_LogMessage;

            foreach (var slider in Bot.Options)
            {
                slider.EnabledStateChanged += Bot_OptionStateChanged;
                slider.NameChanged         += Bot_OptionNameChanged;
                slider.DescriptionChanged  += Bot_OptionDescriptionChanged;
            }

            InitializeComponent();
            AutoReconnectSwitch.IsChecked = Bot.AutoReconnector.IsEnabled;
            AvoidStaffSwitch.IsChecked    = Bot.StaffAvoider.IsEnabled;
            AutoEvolveSwitch.IsChecked    = Bot.PokemonEvolver.IsEnabled;

            App.InitializeVersion();

            Team      = new TeamView(Bot);
            Inventory = new InventoryView();
            Chat      = new ChatView(Bot);
            Players   = new PlayersView(Bot);
            Map       = new MapView(Bot);

            FileLog = new FileLogger();

            _refreshPlayers      = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;

            AddView(Team, TeamContent, TeamButton, true);
            AddView(Inventory, InventoryContent, InventoryButton);
            AddView(Chat, ChatContent, ChatButton);
            AddView(Players, PlayersContent, PlayersButton);
            AddView(Map, MapContent, MapButton);

            SetTitle(null);

            LogMessage("Running " + App.Name + " by " + App.Author + ", version " + App.Version);

            Task.Run(() => UpdateClients());

            _options[0] = ScriptOption1;
            _options[1] = ScriptOption2;
            _options[2] = ScriptOption3;
            _options[3] = ScriptOption4;
            _options[4] = ScriptOption5;

            foreach (var option in _options)
            {
                option.Visibility = Visibility.Collapsed;
            }
        }
Exemplo n.º 5
0
        public MainWindow()
        {
#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
#endif
            Thread.CurrentThread.Name = "UI Thread";

            Bot = new BotClient();
            Bot.StateChanged  += Bot_StateChanged;
            Bot.ClientChanged += Bot_ClientChanged;
            Bot.AutoReconnector.StateChanged += Bot_AutoReconnectorStateChanged;
            Bot.StaffAvoider.StateChanged    += Bot_StaffAvoiderStateChanged;
            Bot.PokemonEvolver.StateChanged  += Bot_PokemonEvolverStateChanged;
            Bot.ConnectionOpened             += Bot_ConnectionOpened;
            Bot.ConnectionClosed             += Bot_ConnectionClosed;
            Bot.MessageLogged  += Bot_LogMessage;
            Bot.SliderCreated  += Bot_SliderCreated;
            Bot.SliderRemoved  += Bot_SliderRemoved;
            Bot.TextboxCreated += Bot_TextboxCreated;
            Bot.TextboxRemoved += Bot_TextboxRemoved;

            InitializeComponent();

            AutoEvolveSwitch.IsChecked    = Bot.Settings.AutoEvolve;
            AvoidStaffSwitch.IsChecked    = Bot.Settings.AvoidStaff;
            AutoReconnectSwitch.IsChecked = Bot.Settings.AutoReconnect;

            Bot.PokemonEvolver.IsEnabled  = Bot.Settings.AutoEvolve;
            Bot.StaffAvoider.IsEnabled    = Bot.Settings.AvoidStaff;
            Bot.AutoReconnector.IsEnabled = Bot.Settings.AutoReconnect;

            if (!string.IsNullOrEmpty(Bot.Settings.LastScript))
            {
                string fileName = Path.GetFileName(Bot.Settings.LastScript);
                MenuReloadScript.Header     = "Reload " + fileName;
                MenuReloadScript.IsEnabled  = true;
                MenuExploreScript.Header    = "Explore " + fileName;
                MenuExploreScript.IsEnabled = true;
            }

            App.InitializeVersion();

            Team      = new TeamView(Bot);
            Inventory = new InventoryView();
            Chat      = new ChatView(Bot);
            Players   = new PlayersView(Bot);
            Map       = new MapView(Bot);
            Battle    = new BattleView(Bot, this);

            FileLog = new FileLogger();

            _refreshPlayers      = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;

            AddView(Team, TeamContent, TeamButton, true);
            AddView(Inventory, InventoryContent, InventoryButton);
            AddView(Chat, ChatContent, ChatButton);
            AddView(Players, PlayersContent, PlayersButton);
            AddView(Map, MapContent, MapButton);
            AddView(Battle, BattleContent, BattleButton);

            SetTitle(null);

            LogMessage("Running " + App.Name + " by " + App.Author + ", version " + App.Version);
            if (App.IsBeta)
            {
                LogMessage("This is a BETA version. Bugs, crashes and bans might occur.");
                LogMessage("Report any problem on the forums and join the Discord chat for the latest information.");
            }

            Task.Run(() => UpdateClients());

            OptionSliders.ItemsSource = _sliderOptions = new ObservableCollection <OptionSlider>();
            TextOptions.ItemsSource   = _textOptions = new ObservableCollection <TextOption>();
        }
Exemplo n.º 6
-1
        public MainWindow()
        {
            #if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
            #endif
            Thread.CurrentThread.Name = "UI Thread";

            Bot = new BotClient();
            Bot.StateChanged += Bot_StateChanged;
            Bot.ClientChanged += Bot_ClientChanged;
            Bot.AutoReconnector.StateChanged += Bot_AutoReconnectorStateChanged;
            Bot.StaffAvoider.StateChanged += Bot_StaffAvoiderStateChanged;
            Bot.PokemonEvolver.StateChanged += Bot_PokemonEvolverStateChanged;
            Bot.ConnectionOpened += Bot_ConnectionOpened;
            Bot.ConnectionClosed += Bot_ConnectionClosed;
            Bot.MessageLogged += Bot_LogMessage;

            InitializeComponent();
            AutoReconnectSwitch.IsChecked = Bot.AutoReconnector.IsEnabled;
            AvoidStaffSwitch.IsChecked = Bot.StaffAvoider.IsEnabled;
            AutoEvolveSwitch.IsChecked = Bot.PokemonEvolver.IsEnabled;

            App.InitializeVersion();

            Team = new TeamView(Bot);
            Inventory = new InventoryView();
            Chat = new ChatView(Bot);
            Players = new PlayersView(Bot);

            _refreshPlayers = DateTime.UtcNow;
            _refreshPlayersDelay = 5000;

            TeamContent.Content = Team;
            InventoryContent.Content = Inventory;
            ChatContent.Content = Chat;
            PlayersContent.Content = Players;

            TeamContent.Visibility = Visibility.Visible;
            InventoryContent.Visibility = Visibility.Collapsed;
            ChatContent.Visibility = Visibility.Collapsed;
            PlayersContent.Visibility = Visibility.Collapsed;
            TeamButton.IsChecked = true;

            SetTitle(null);

            LogMessage("Running " + App.Name + " by " + App.Author + ", version " + App.Version);

            Task.Run(() => UpdateClients());
        }