[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Does MUSHclient use DDE?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Does MUSHclient use DDE?

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1  2 

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #15 on Fri 13 Jun 2003 03:49 PM (UTC)  quote  ]
Message
Seems like you can use the .tlb in a script afterall. I am talking about 'script components' here (.wsc file) not regular scripts. I initially tried to <reference> the .tlb by registering it with Windows, but although the reference was excepted when I installed the component, it refused to link during runtime. But when I saw 'Mushclient.World' at the bottom of the last VB window you posted, I suddenly had an idea... I tried it another way - I added a TypeLib parameter to the Mushclient.World key in the registry and hooked it to the .tlb's key I created earlier, then I used the <object> tag to add Mushclient.World to the component in hopes that Windows will recognize the reference to the .tlb in the registry. Which it finally did and I actually got to communicate with Mushclient from a script component instantiated from a completely different process than the one Mushclient's script runs in. Hooray! The only problem now is that when I try to do world.anything in the script component, Mushclient attempts to create a new world. I am hoping to find a way around that also though, will see what can be done.

Here's what I actually did:

1. Mushclient script .Run's a standalone script (.wsf)
2. .wsf creates an instance of a .wsc component
3. .wsc component uses callbacks to talk to Mushclient (to grab the timer's parameters and send a command to it when the timer fires).

The reason for using a separate script is to gain access to the Wscript object and avoid hanging Mushclient when I use Wscript.Sleep.
[Go to top] top

Posted by Shadowfyr   USA  (1,776 posts)  [Biography] bio
Date Reply #16 on Fri 13 Jun 2003 06:16 PM (UTC)  quote  ]
Message
Most likely reason for your problem is that your scripting object has no clue what 'world' it is trying to talk to. The '(theworld AS WORLD)' in Nick's example is a handle. Like the handles created for a window, such a handle will have a number in it that uniquely identifies the world in Mushclient. However since this number depends on any number of factors, including the order in which worlds where opened, etc. you can't hard code it into a program. This means that you need to do something like:

1. Create a wsf instance and pass it the 'world' handle.
2. Have the wsf create an instance of the .wsc.
3. Pass the world handle again to the new object so it knows what world it needs to talk to.

Looks like you hae either missed the last one or are doing it wrong and Mushclient is 'fixing' the problem by spawning a brand new world each time you execute a command. However, unless you specific gave it a value, the handle you are passing is likely EMPTY and I doubt Mushclient is setting it for you.

One 'possible' fix, assuming I am right, would be to do:

dim whandle as WORLD
whandle = whandle.getworld

however, this would only work for 'new' worlds, not existing ones. Actually I am not sure it would work at all, so... lol But I am sure that your .wsc has no clue 'which' world it is supposed to talk to and that is causing the problem.

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
[Go to top] top

Posted by Nick Gammon   Australia  (19,607 posts)  [Biography] bio   Forum Administrator
Date Reply #17 on Fri 13 Jun 2003 09:07 PM (UTC)  quote  ]
Message
I think this was mentioned a while back.

If you try to CreateObject ("mushclient.world") or something similar, then MUSHclient tries to create a new world (as asked). The safer thing, which it sounds like you are doing is to get MUSHclient to create your script object, not your script object to create MUSHclient.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


6,942 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]