private void ButtonAddAwakeOnClick(object sender, EventArgs e)
        {
            int selectedComboIndex = ComboBoxAwakeType.SelectedIndex;

            if (selectedComboIndex == -1)
            {
                ErrorDisplayer.Error("You cannot add an awake without telling me which awaketype silly!");
                return;
            }

            int newAwakeValue = (int)NumericAwakeValue.Value;

            var newAwakeName = _serverConfig.AwakeTypes[selectedComboIndex].Name;

            int newAwakeGroup = (int)NumericAwakeGroup.Value;

            ListviewAwakes.Items.Add(new ListViewItem(new string[] {
                newAwakeName,
                newAwakeValue.ToString(),
                newAwakeGroup.ToString(),
            }));

            GroupBoxNewAwake.Visible = false;
            ResetAddAwakeControls();

            var newAwake = new Awake()
            {
                Name      = newAwakeName,
                Value     = newAwakeValue,
                TypeIndex = Convert.ToInt16(selectedComboIndex),
            };

            foreach (var preferredAwake in _preferredAwakeItems)
            {
                // Are they in the same group?
                if (newAwakeGroup == preferredAwake.Group)
                {
                    if (preferredAwake.Awake.TypeIndex == newAwake.TypeIndex)
                    {
                        ErrorDisplayer.Info("This type of awake is already added to the list.\n\n" +
                                            "When you add two different, they will interally be converted into one, the same goes for the awake on the item.\n\n" +
                                            "Example: If you add one STR+50 awake into the list, the bot will stop when it gets e.g. STR+23 and STR+30 because it will turn into STR+53 internally.");
                    }
                }
            }

            _preferredAwakeItems.Add(new AwakeItem
            {
                Awake = newAwake,
                Group = newAwakeGroup,
            });
        }
Exemple #2
0
        void RefreshNeuzProcesses()
        {
            var processName = XmlUtils.GetXmlSetting("ProcessName");

            var processes = Process.GetProcessesByName(processName);

            if (processes.Length == 0)
            {
                ErrorDisplayer.Info("I did not find any flyff processes, are you sure you have one opened? " +
                                    "If you do, maybe it has a different name compared to the one in the settings file.");
                return;
            }

            PopulateListviewProcesses(processes);

            Processes.AddRange(processes);
        }
 private void OptimizationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ErrorDisplayer.Info("When using the awakebot, be in an area that isn't laggy.\n\n" +
                         "When setting the \"Item Awake Read Rect\", make sure to make the rectangle big enough to fit a larger awake and multiple awakes.\n\n" +
                         "Important that you don't make the rectangle too big to ensure that no other text/pixels with that same color gets in the picture.");
 }
 private void CreatorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ErrorDisplayer.Info("Created by greyb1t");
 }