ExecuteCommand() public static method

public static ExecuteCommand ( string command, ParseMemoryResults parseMemoryResults = null ) : bool
command string
parseMemoryResults ParseMemoryResults
return bool
Example #1
0
 private void creatureName_Click(object sender, EventArgs e)
 {
     if (imageObject != null)
     {
         CommandManager.ExecuteCommand(imageObject.GetCommand());
     }
 }
Example #2
0
        private void saveSummaryImageButton_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.AddExtension = true;
            dialog.DefaultExt   = "png";
            dialog.Title        = "Save Damage Image";
            if (File.Exists("summary_screenshot.png"))
            {
                int i = 1;
                while (File.Exists("summary_screenshot (" + i.ToString() + ").png"))
                {
                    i++;
                }
                dialog.FileName = "summary_screenshot (" + i.ToString() + ").png";
            }
            else
            {
                dialog.FileName = "summary_screenshot.png";
            }
            DialogResult result = dialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                CommandManager.ExecuteCommand("summary" + Constants.CommandSymbol + "screenshot" + Constants.CommandSymbol + dialog.FileName.Replace("\\\\", "/").Replace("\\", "/"));
            }
        }
Example #3
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0xC)
            {
                // This messages is send by AutoHotkey to execute a command
                string command = Marshal.PtrToStringUni(m.LParam);
                if (command != null)
                {
                    if (CommandManager.ExecuteCommand(command))
                    {
                        return; //if the passed along string is a command, we have executed it successfully
                    }
                }
            }
            if (m.Msg == 0x317)
            {
                // We intercept this message because this message signifies the AutoHotkey state (suspended or not)

                int wParam = m.WParam.ToInt32();
                if (wParam == 32)
                {
                    // 32 signifies we have entered suspended mode, so we warn the user with a popup
                    AutoHotkeyManager.ShowSuspendedWindow();
                }
                else if (wParam == 33)
                {
                    // 33 signifies we are not suspended, destroy the suspended window (if it exists)
                    AutoHotkeyManager.CloseSuspendedWindow();
                }
            }
            base.WndProc(ref m);
        }
Example #4
0
        private void guideButton_Click(object sender, EventArgs e)
        {
            this.ReturnFocusToTibia();
            string name = (sender as Control).Name;

            CommandManager.ExecuteCommand("direction" + Constants.CommandSymbol + hunting_place.name.ToLower());
        }
Example #5
0
 private void routeButton_Click(object sender, EventArgs e)
 {
     if (task.bossposition != null)
     {
         CommandManager.ExecuteCommand(String.Format("route{0}{1},{2},{3}{0}{4}", Constants.CommandSymbol, task.bossposition.x, task.bossposition.y, task.bossposition.z, task.GetBoss() == null ? "" : task.GetBoss().title));
     }
 }
Example #6
0
        protected void openCreatureMenu(object sender, EventArgs e)
        {
            this.ReturnFocusToTibia();
            string name = (sender as Control).Name;

            CommandManager.ExecuteCommand("creature" + Constants.CommandSymbol + name.ToLower());
        }
Example #7
0
        private void openQuest(object sender, EventArgs e)
        {
            this.ReturnFocusToTibia();
            string name = (sender as Control).Name;

            CommandManager.ExecuteCommand("quest" + Constants.CommandSymbol + name.ToLower());
        }
Example #8
0
 private void commandTextBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == '\r')
     {
         CommandManager.ExecuteCommand((sender as TextBox).Text);
         e.Handled = true;
     }
 }
Example #9
0
        private void resetButton_Click(object sender, MouseEventArgs e)
        {
            Hunt h = MainForm.mainForm.getSelectedHunt();

            if (h != null)
            {
                CommandManager.ExecuteCommand("reset" + Constants.CommandSymbol + h.name);
            }
        }
Example #10
0
        private void UpdateDiscardRatio(object sender, EventArgs e)
        {
            string itemName = (sender as Control).Name;
            Item   item     = StorageManager.getItem(itemName);
            double ratio    = item.GetMaxValue() / item.capacity;

            CommandManager.ExecuteCommand("setdiscardgoldratio" + Constants.CommandSymbol + Math.Floor(ratio));
            UpdateDiscardDisplay();
        }
Example #11
0
        private void UpdateConvertRatio(object sender, EventArgs e)
        {
            string itemName = (sender as Control).Name;
            Item   item     = StorageManager.getItem(itemName);
            double ratio    = item.GetMaxValue() / item.capacity;

            CommandManager.ExecuteCommand("setconvertgoldratio" + Constants.CommandSymbol + (item.stackable ? "1-" : "0-") + Math.Ceiling(ratio + 0.01));
            UpdateConvertDisplay();
        }
Example #12
0
        private void showLootButton_Click(object sender, EventArgs e)
        {
            Hunt h = getSelectedHunt();

            if (h != null)
            {
                CommandManager.ExecuteCommand("loot" + Constants.CommandSymbol + h.name);
            }
        }
Example #13
0
        private void applyDiscardRatioButton_Click(object sender, EventArgs e)
        {
            double ratio;

            if (double.TryParse(customDiscardRatioBox.Text, NumberStyles.Any, CultureInfo.InvariantCulture, out ratio))
            {
                CommandManager.ExecuteCommand("setdiscardgoldratio" + Constants.CommandSymbol + Math.Floor(ratio));
                UpdateDiscardDisplay();
            }
        }
Example #14
0
        public static void Back()
        {
            if (command_stack.Count <= 1)
            {
                return;
            }
            command_stack.Pop(); // remove the current command
            string command = command_stack.Pop().command;

            CommandManager.ExecuteCommand(command);
        }
Example #15
0
 void openCreatureDrops(object sender, EventArgs e)
 {
     if (creatures.Keys.Count == 1)
     {
         CommandManager.ExecuteCommand("creature" + Constants.CommandSymbol + (sender as Control).Name);
     }
     else
     {
         CommandManager.ExecuteCommand(String.Format("loot{0}{1}{0}{2}{0}{3}", Constants.CommandSymbol, huntName, (sender as Control).Name, rawName));
     }
 }
Example #16
0
 public static void OpenCommand(string command, int type)
 {
     if (type == 0)
     {
         CommandManager.ExecuteCommand(command);
     }
     else if (type == 1)
     {
         MainForm.OpenUrl(command);
     }
 }
Example #17
0
 private void UtilityBox_Click(object sender, EventArgs e)
 {
     if (npcList == null)
     {
         Utility utility = city.utilities[int.Parse((sender as Control).Name)];
         mapBox.mapCoordinate = new Coordinate(utility.location);
         mapBox.UpdateMap();
     }
     else
     {
         NPC npc = npcList[int.Parse((sender as Control).Name)] as NPC;
         CommandManager.ExecuteCommand("npc" + Constants.CommandSymbol + npc.name);
     }
 }
Example #18
0
        private void OpenItemWindow(object sender, MouseEventArgs e, List <ItemRegion>[] lootRegions)
        {
            Point mousePoint = new Point(e.X, e.Y);
            int   index      = 0;

            int.TryParse((sender as Control).Name, out index);
            if (index > lootRegions.Length && lootRegions[index] == null)
            {
                return;
            }
            List <ItemRegion> regions = lootRegions[index];

            foreach (ItemRegion reg in regions)
            {
                if (reg.region.Contains(mousePoint))
                {
                    CommandManager.ExecuteCommand(reg.item.GetCommand());
                    return;
                }
            }
        }
Example #19
0
 private void closeHudButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("closehud@" + Constants.HudTypes[hudTypeList.SelectedIndex]);
 }
Example #20
0
 private void refreshButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("hud@portrait");
 }
Example #21
0
 private void huntButton_Click(object sender, EventArgs e)
 {
     this.ReturnFocusToTibia();
     CommandManager.ExecuteCommand("hunt" + Constants.CommandSymbol + (sender as Control).Name);
 }
Example #22
0
 void openItemBox(object sender, EventArgs e)
 {
     this.ReturnFocusToTibia();
     CommandManager.ExecuteCommand("item" + Constants.CommandSymbol + (sender as Control).Name);
 }
Example #23
0
 private void taskGroupLabel_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("task" + Constants.CommandSymbol + task.groupname);
 }
Example #24
0
 private void bossPictureBox_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("creature" + Constants.CommandSymbol + task.GetBoss().GetName());
 }
Example #25
0
        private void testNotificationDisplayButton_Click(object sender, EventArgs e)
        {
            string command = Constants.NotificationTestCommands[notificationTypeList.SelectedIndex];

            CommandManager.ExecuteCommand(command);
        }
Example #26
0
 private void clearNotificationDisplayButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("close@");
 }
Example #27
0
 private void MissionButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand((sender as Control).Name);
 }
Example #28
0
 private void cityLabel_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("city" + Constants.CommandSymbol + this.hunting_place.city);
 }
Example #29
0
 private void routeButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand(String.Format("route{0}{1},{2},{3}{0}{4}", Constants.CommandSymbol, mapBox.beginCoordinate.x, mapBox.beginCoordinate.y, mapBox.beginCoordinate.z, hunting_place.GetName()));
 }
Example #30
0
 private void closeAllHudsButton_Click(object sender, EventArgs e)
 {
     CommandManager.ExecuteCommand("closehud@");
 }