Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Calling Mush via VB

Calling Mush via VB

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Kerrigan   (5 posts)  Bio
Date Tue 11 Mar 2003 12:23 PM (UTC)
Message
hi there,

maybe it's an old problem, but i havn't found anything which helps me right now in this forum.

i'm using right now VB 6.0 for handling the more complexiv
thing which are send from the MUD to MUSH. therefore i'm still using a scipt-file in MUSH, wherein there is a definition and function like:

Dim VBApp

Sub InitVB()
set VBApp = createobject("VBApp.clsMush")
VBApp.InitWorld (world)
End Sub

like you can see i'm creating an object in this script.
this object is a class in the ActiveX-EXE "VBApp". and
then i'm calling a method which gives the actual world
to my VBApplication. after that i can handle everything
i want in VB.

now, i would like to use VB 6.0 to connect to a MUD via MUSH, that means i would like to start my VBApp and connect to a MUD, which i can select, therefore i have witten some code in VB which handles alle my chars, passwords, world properties like ip, port etc. in a databse.

i thought this can be done, if i create a new instance of the world in VB like:

Dim gWorld As World
Set gWorld = New World

But in this case vb opens the wholy mush-client and tries to load a new world-file. could i instead do something like (within VB ??):
- start mush (backgraound)
- open a new world, set all properties via VB according data from my databse like world-name, ip, port etc.
- connecting to the world
etc.

sorry for my english, it isn't really good, but i hope you understand what i mean.

thx in advance
Kerrigan
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #1 on Tue 11 Mar 2003 02:51 PM (UTC)
Message
I can't really help you with your problem per se, but if you're referring to MUSHclient, it's better to use the whole word--'MUSH' actually refers to a game similar to a MUD.
Top

Posted by Shadowfyr   USA  (1,792 posts)  Bio
Date Reply #2 on Tue 11 Mar 2003 06:23 PM (UTC)
Message
Umm. I am not sure what the problem you are having is... However, I assume that one possibility is that you are trying to make the VB program connect itself to an open version of Mushclient directly. I don't think that would work, since the internal ID used by the OS to keep track of that copy isn't available to your VB program. It is probably possible, but would require that you get the Mushclient GUID from the registry and ... well I am not sure of the exact steps, but simply opening a new world is 100% certain to cause a new instance to load, instead of the existing one. This is because Mushclient is designed to allow mutliple instances and most programs that do tend to act exactly the same way. You litterally have to:

1. Check if and existing instance is loaded.
2. Request the ID for it from the OS.
3. Execute your call to create a new world using that ID??

I am not 100% certain that the existing ActiveX calls it supports actually allow this. I believe you need to be linked to Mushclient 'through' an already open world file, but it may be possible to talk direct to the client as well. I just don't know enough to do more than guess.

As an alternative... Create a world with a World.Open script (in the script settings page) and have that generate an instance of 'your' VB program. That way the version of mushclient you started will have already passed the correct ID to your program and creating a new world from in it then won't open a new copy of Mushclient.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 12 Mar 2003 05:31 AM (UTC)
Message
There are two ways of making MUSHclient talk to an external program.
  1. Start MUSHclient and have it call your program
  2. Start your program and have it call MUSHclient

The first way will work, the second one won't.

Take a look at Does MUSHclient use DDE? - it has an example of using VBscript to call an external program (written in VB).


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kerrigan   (5 posts)  Bio
Date Reply #4 on Wed 12 Mar 2003 09:33 AM (UTC)
Message
thx for your answers, it seems to me like nick said,
i think it won't work the way i want it to.

i'm using the same mechanism like in the example to
call VB through MushClient via Script and that is
working fine.

thx again
Kerrigan
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


23,729 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.