EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (https://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   OnPress and unknown commands (https://www.eq2interface.com/forums/showthread.php?t=12488)

Mayve 03-05-2009 05:42 AM

OnPress and unknown commands
 
Hello, I am wondering if OnPress can be used with unknown commands?

Specifically, I would like to achieve the result of typing "/act end" only through OnPress.

When I try it, it doesn't work. I even made a txt file with just "act end" and tried OnPress="do_file_commands (txt file)" and that didn't work as well. I added a line to the txt file to make it write "test" in chat and tried it again and get the word test displayed but not the "Unknown command: act end" that is usually displayed by typing "/act end" or pressing the macro on my hotbar that types it for me.

Any solutions or ideas how to get this to work or is not possible since it's not a real command?

gm9 03-05-2009 05:55 AM

It's not possible, unrecognized scripted commands do not produce any error messages. Best you can do is put it to the chat input line via beginchatinput and then press Enter yourself.

Mayve 03-05-2009 06:15 AM

Quote:

Originally Posted by gm9 (Post 81245)
It's not possible, unrecognized scripted commands do not produce any error messages. Best you can do is put it to the chat input line via beginchatinput and then press Enter yourself.

Meh, that sucks. A horrible kink in an otherwise perfect ACT window lol.


EDIT:
Tried the beginchatinput method and it adds a space. I get "/act end " which ACT doesn't recognize so I end up having to hit Backspace and Enter. I'll have to decide if I like that or not over the alternative of going back to automatic encounter ending which has it's own kinks.

gm9 03-05-2009 06:28 AM

Yeah the space can't be helped either. Maybe just ask Aditu whether ACT can't be changed to recognize commands in chat, maybe via a plugin.

EQAditu 03-05-2009 03:13 PM

It would be simple for a plugin to initiate an ACT command. You would just need to handle this event to figure out if it has the chat text you want and then call this method to initiate the command. Since you're already forced into having a plugin... you could probably expand the UI to do more complicated things to ACT through the plugin.

EQAditu 03-05-2009 04:07 PM

Here, I made the plugin in less than three minutes... just so you can see how easy it is.

Code:

using System;
using System.Collections.Generic;
using System.Text;
using Advanced_Combat_Tracker;

namespace ACT_Plugin
{
        public class ParseForActEnd : IActPluginV1
        {
                public void InitPlugin(System.Windows.Forms.TabPage pluginScreenSpace, System.Windows.Forms.Label pluginStatusText)
                {
                        ActGlobals.oFormActMain.OnLogLineRead += oFormActMain_OnLogLineRead;
                }

                void oFormActMain_OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
                {
                        if(logInfo.logLine.Contains("act end"))
                                ActGlobals.oFormActMain.ActCommands("end");
                }
                public void DeInitPlugin()
                {
                        ActGlobals.oFormActMain.OnLogLineRead -= oFormActMain_OnLogLineRead;
                }
        }
}

Most of the typing was actually done by Visual Studio Express and Intellisense auto-completing.

gm9 03-05-2009 04:33 PM

Quote:

Originally Posted by EQAditu (Post 81262)
Most of the typing was actually done by Visual Studio Express and Intellisense auto-completing.

lol, best comment ever. :D (but yeah, the autocompletion is really very useful)

lordebon 03-05-2009 05:22 PM

Awesome. I've been thinking about a better way to end combat in act for a bit, but getting it to understand the end command from a script was the hurdle. Basically what I'm thinking of is when the CombatIcon in the player window is hidden it ends act. Now I'll have to see if I can put it together when I have time this weekend.

EQAditu 03-05-2009 07:04 PM

You're quite right. That would be a superior way of ending combat in some cases. More accurate than the timer method which is the most accurate when considering multi-encounter battles. If you're chain pulling, even a second of non-combat would split the encounters well enough. If there's no non-combat in-between encounters, why split the encounter to begin with. Which is the problem with EQ2 message ending.

Since the combat icon has its own DynamicData you could create a custom window to do it. The only inelegance is that you would have to have the user create a custom chat channel... or I suppose you could do something like I have and find an EQ2 command that accepts a parameter and echoes invalid parameters into the log file.

gm9 03-05-2009 07:32 PM

You could simply script the creation of the chat channel, if you add the user name to the channel name you are just about certain to create a unique channel.


All times are GMT -5. The time now is 07:42 AM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI