Communicating with External Applications...

Posted by Accolades on Tue 16 Jul 2002 02:20 AM — 6 posts, 28,185 views.

#0
Since MUSHclient doesn't have the ability to open multiple windows and specify which data is displayed in each, I am hoping to emulate this with a third party application I want to write.

Basically, the application will be in Visual Basic, and will just display certain command responses in several "windows" that can run alongside MUSHclient (zMud has this ability built in, but I really don't care for that client)

It should be relatively simple, but I don't know where to begin, I've never done any COM programming so I don't know where to turn.

Also, how hard would it be to program the ANSI color coding from MUDs into my VB Program?

If anyone is wondering, this is for the BattleTech MUXes, the effect I'm looking for is kind of like Mav's BTSuite, but I'm not looking for the graphical aspects (or the downloaded map files) I just want to echo text into new windows.

Thanks in advance
- Tim -
Australia Forum Administrator #1

Check out this post Does MUSHclient use DDE? - this describes making a COM object in VB and calling it from MUSHclient.

As for the colouring, use GetLineInfo and GetStyleInfo to get the information about the colouring for a line in the output window.

#2
Hello,

Well, its pretty simple actually. First you need your COM program written of course. Then you need to write a script to communicate with that COM object. an example is btech.vbs (check http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/btsuite/btsuite_v1/MushClient/BTech.vbs?rev=HEAD&content-type=text/vnd.viewcvs-markup).

As for colors, the problem is not to get them or even interpret ansi codes, they are simple, but it is with windows Memo controls(no color). You might need to use a RichEdit control, which will be slow. Matters ? You decide, do extra windows need speed ?

Besides those, I think it should be pretty simple. I hope you dont get much trouble with it.

Regars,
Mav
Amended on Tue 16 Jul 2002 09:53 AM by Mav
#3
Wow, timely and informative replies from the two people who probably know the most about this subject.

Thanks a lot, both of you.

I'm sure you'll be hearing more from me!

- Tim -
#4
I thought you would be hearing more from me! I was hoping it wouldn't be this soon. I was hoping you could both take a stab at this for me.

Everything is working well so far, thanks to the VB6 help files I can even have MUSHclient display my forms and everything, and thanks to you guys I can interact with the MUD thru my application via MUSHclient. My next question is:

What do you think is the best way to capture text from MUSHclient and *NOT* allow it to show up on the output window for the user. I want the text to only be displayed in my application, I was thinking something like GetLineCount to find out how many lines were returned by the MUD, now how to I herd them into my application instead of MUSHclient?

Thanks again for your time.

- Tim -
#5
The way I have choosen to do that was to write a softcode command that sends me the information I need, but prefixed by an identifier. This would turn a line like

This_Line_Is_A_Line_You_Get_From_MUX


into a


MUX::This_Line_Is_A_Line_You_Get_From_MUX


Then you could define a trigger on
MUX::*
to get the line you want. Write a trigger-handler SUB in your VBScript to handle this line, ie, send to your COM Object app. Then of course you can do with that line as you please.

However, despite this was the way I used, later there was a protocol implemented, named HUDINFO, that does the line prefixing and sending formated data, but in hardcode. You could use that protocol instead. Of course, some mux's dont have that protocol (like 3065 for instance), some have(3030/3029-basically every mux that uses cvs source).

Oh, I didnt mention that you can check "Omit From Output" in trigger settings and have that line not displayed. You need to do that in any case if you dont want it to be shown.

I hope that helps.