Ejemplo n.º 1
0
        /// <summary>
        /// Sends a command to the console
        /// </summary>
        /// <param name="text"></param>
        public static void SendCommand(string text)
        {
            //Write the command to the log
            WriteLine(text, logTypes.CMD);

            string[] tokens = text.Split(' ');

            //Sorts by how many tokens
            if (tokens.Length == 1)
            {
                //Hooks the keyboard
                if (text.ToUpper().Equals("HOOK") || text.ToUpper().Equals("REHOOK"))
                {
                    KeyboardHook.StartHook();
                }

                //Unhooks the keyboard
                if (text.ToUpper().Equals("UNHOOK"))
                {
                    KeyboardHook.StopHook();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Triggers when the form is finished loading
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormLoaded(object sender, EventArgs e)
        {
            //Start the timer once the form is loaded
            InitTimer();

            MainTabControl.SelectedTab = RushingTab;

            TabPage firstRushing = CreateTab(RushingTabControl, new RushingUserControl(0), 0);
            Button  button       = FindControl <Button>("AddScript", firstRushing);

            button.Enabled   = false;
            button.BackColor = Color.Gray;

            int lastIndex = 1;

            //If there are more rushing tabs that should be created, create them
            for (int i = 1; i < Data.rushConfigs.Length; i++)
            {
                if (Data.rushConfigs[i] != null)
                {
                    TabPage tp = CreateTab(RushingTabControl, new RushingUserControl(i), i);
                    Button  b  = FindControl <Button>("AddScript", tp);
                    b.Enabled   = false;
                    b.BackColor = Color.Gray;
                    lastIndex++;
                }
            }

            button           = FindControl <Button>("AddScript", FindControl <TabPage>("Script" + lastIndex));
            button.Enabled   = true;
            button.BackColor = Color.White;

            //Create a new blank RUC in order to copy the controls over to the game info tab
            RushingUserControl ruc = new RushingUserControl(-1);

            GameInfoPanel.Controls.Add(ruc.SettingsPanel);

            foreach (CustomCheckBox box in FindControls <CustomCheckBox>("", GameInfoPanel))
            {
                box.AutoCheck = false;
                box.Cursor    = Cursors.Default;
                box.Loaded();
            }

            //Set the current tab as the first one
            RushingTabControl.SelectedTab = firstRushing;
            MainTabControl.SelectedTab    = MainTab;

            //Apply the link to the LinkLabels
            GitHubLink.Links.Add(0, 0, "https://github.com/StarOfDoom/RotMGScripts");
            GitHubLink.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkClicked);

            //Update the version label to include the current version number
            VersionNumberLabel.Text = Info.version;

            //Add event handlers for when you click hotkey buttons
            HotkeyButton0.Click += new EventHandler(HotkeyButtonClick);

            //Set the paint handler for adding images to the background
            DebuggingInfoPanel.Paint += new PaintEventHandler(InfoTabPaint);

            //Set the paint handler for adding images to the title bar
            TitleBarPanel.Paint += new PaintEventHandler(TitleBarPaint);

            //Call event when the text is changed in the process name field
            ProcessName.TextChanged += new EventHandler(ProcessTextChanged);

            //Call event when a key is pressed in the console input to check for an Enter or Arrow key
            ConsoleInput.KeyDown    += new KeyEventHandler(ConsoleInputKeyDown);
            ConsoleSendButton.Click += new EventHandler(ConsoleSendClick);

            //Update the two delays
            SearchDelayInput.ValueChanged += new EventHandler(DelayInputValueChanged);
            UpdateDelayInput.ValueChanged += new EventHandler(DelayInputValueChanged);

            //Add event handlers for checking the auto resize box
            foreach (CheckBox box in FindControls <CheckBox>("", AspectRatioGroup))
            {
                box.MouseClick += new MouseEventHandler(AspectBoxChanged);
            }

            //Lets you drag around the window without a windows title bar
            TitleBarPanel.MouseDown += new MouseEventHandler(TitleBar);
            TitleLabel.MouseDown    += new MouseEventHandler(TitleBar);

            ExitButton.InitializeButton();
            MinimizeButton.InitializeButton();

            KeyboardHook.StartHook();
        }