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
➜ VBscript
➜ Browsers and mushclient
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Ishnaf
Australia (17 posts) Bio
|
| Date
| Fri 27 Sep 2002 04:47 PM (UTC) |
| Message
| Is it possible to use forms and vbscript to send 'stuff' (such as speedwalk directions) to mushclient. My basic plan is to create a page where you click a button to walk to an area, and then a browser comes up with mob list / eq / etc.
I figured a form integrated with VBScript could do this.... But im guessing active x controls would have to be integrated to the page.... Is this possible?
Thanks,
Ishnaf |
egads! | | Top |
|
| Posted by
| Shadowfyr
USA (1,792 posts) Bio
|
| Date
| Reply #1 on Fri 27 Sep 2002 11:11 PM (UTC) |
| Message
| Not without some workaround. In general controls can only be displayed if specifically supported or the client is a 'document container'. Mushclient neither supports controls nor provides such contianer support.
However, there is nothing to stop you from creating a VB Basic or similar program that provides these features. You just have to provide the 'form' or 'window' to display them, since mushclient has no support for such things or the direct display of object in its own window. I have been fiddling with a couple ideas, but short of using HTML and the core of Infernal Exploder, there are no simple solutions. And I don't really consider IE a valid solution.
Eventually, if I figure it out, I plan to allow the user to create a blank form, then either add object indiviually or through a form description a bit like used in the compiler IDEs. However, this will limit the types of things you can display, even assuming I manage to get it to work.
But short of creating such an external window in an ActiveX program and using it to do these things.. your out of luck for now. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Fri 27 Sep 2002 11:47 PM (UTC) |
| Message
| You can do it from a VB program, but right now it is a bit inelegant, to say the least. Here is an example of what I am playing with ...
Private Sub Command1_Click()
Dim world As world
Dim otherworld As world
Set world = CreateObject("MUSHclient.world")
Set otherworld = world.GetWorld("nickmud")
otherworld.Note "Hi there"
Set world = Nothing
Set otherworld = Nothing
End Sub
You need to add the mushclient.tlb file to the "References" menu item, and then it will recognise the World object type.
However the problem with this is that to instantiate the first world object (CreateObject("MUSHclient.world")) the standard MUSHclient dialog appears "Preload world defaults from an existing world?" and then the configuration dialog for you to enter the world name and IP address. This isn't very smooth.
However if you get past that point, and you have *another* world called "nickmud" (in my example) then the otherworld.note works.
What I need to do is change MUSHclient so that you can do a "getworld" or "getworldlist" without needing an existing world, thus avoiding the Catch-22 situation.
Stay tuned, I'll see what I can do. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sat 28 Sep 2002 04:07 AM (UTC) Amended on Sat 28 Sep 2002 04:08 AM (UTC) by Nick Gammon
|
| Message
| OK, this works pretty well. :)
The fundamental problem as I see it is if you try to start your external app first, and then call MUSHclient, you don't have a "world" object to use, and thus you can't do world.anything.
However, if you start MUSHclient, then call the external app, it all works fine.
This is pretty similar to an earlier post (subject 405) however this one actually shows a form that you can click to do nice things ...
- Copy the stuff between the lines below and save into the file names in bold (excluding the file name itself, of course).
- Start Visual Basic
- Open project mc_example_project.vbp (as saved to disk in step 1).
- Go to the File menu and choose "Make mc_example_project.exe"
The above steps have created a ActiveX file that can be called from MUSHclient.
mc_example_project.vbp
Type=OleExe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#E:\WINNT\System32\StdOle2.Tlb#OLE Automation
Reference=*\G{11DFC5E7-AD6F-11D0-8EAE-00A0247B3BFD}#1.0#0#c:\mushclient\MUSHclient.tlb#MUSHclient
Class=mc_example_class; mc_example_class.cls
Form=Form1.frm
Module=Module1; Module1.bas
Startup="(None)"
ExeName32="mc_example_project.exe"
Command32=""
Name="mc_example_project"
HelpContextID="0"
CompatibleMode="1"
CompatibleEXE32="mc_example_project.exe"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Gammon Software Solutions"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0
Form1.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5145
ClientLeft = 60
ClientTop = 345
ClientWidth = 6270
LinkTopic = "Form1"
ScaleHeight = 5145
ScaleWidth = 6270
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command3
Caption = "Send It"
Height = 495
Left = 4200
TabIndex = 5
Top = 4440
Width = 1215
End
Begin VB.TextBox DataToSend
Height = 375
Left = 1440
TabIndex = 4
Text = "Command"
Top = 4440
Width = 2295
End
Begin VB.CommandButton Command2
Caption = "Get World List"
Height = 495
Left = 240
TabIndex = 2
Top = 3480
Width = 2055
End
Begin VB.ListBox List1
Height = 2010
Left = 240
TabIndex = 1
Top = 1200
Width = 4095
End
Begin VB.CommandButton Command1
Caption = "test button"
Height = 615
Left = 360
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label Label1
Caption = "Send:"
Height = 255
Left = 360
TabIndex = 3
Top = 4440
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
If gWorld Is Nothing Then Exit Sub
gWorld.Note "test button clicked"
End Sub
Private Sub Command2_Click()
Dim worldlist, item
worldlist = gWorld.GetWorldList
For Each item In worldlist
List1.AddItem item
Next
End Sub
Private Sub Command3_Click()
Dim thedata
thedata = DataToSend.Text
gWorld.Send thedata
End Sub
mc_example_project.vbw
mc_example_class = 39, 31, 557, 468, C
Form1 = 154, 154, 672, 591, C, 86, 40, 604, 477, C
Module1 = 176, 176, 694, 613, C
mc_example_class.cls
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "mc_example_class"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Sub Initialise_me(theworld As World)
'
' save pointer to the calling world
'
Set gWorld = theworld
'
' debug - message to world
'
gWorld.Note "MC Example initialised"
Form1.Show ' show our first form
End Sub
Module1.bas
Attribute VB_Name = "Module1"
'
' Global pointer to the world that initialised us
'
Public gWorld As World
Finally, to test it out in MUSHclient, open a Immediate window, enter the following and hit Run ...
dim x
set x = createobject ("mc_example_project.mc_example_class")
if x is nothing then msgbox "oh no"
x.Initialise_me (World)
set test = nothing
This should show the Form from the Visual Basic project, you can then click on the buttons to send a command to the world, get a list of open worlds, and so on.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Ishnaf
Australia (17 posts) Bio
|
| Date
| Reply #4 on Sun 29 Sep 2002 12:52 PM (UTC) Amended on Sun 29 Sep 2002 03:51 PM (UTC) by Ishnaf
|
| Message
| ok, I've got Mushclient and VB and a Database talking together :P. Im making a little speedwalk project atm... I'll keep everyone posted as it should be useful because it combines a few VB subjects together.
Just editing this with new problems: I'm trying to create a 'search' to allow the user to search for an area through the VB Form. Any ideas? I'd like to be able to match part of the name of the area and i'm not quite sure how to do this in VB... Any ideas? |
egads! | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Mon 30 Sep 2002 09:15 PM (UTC) |
| Message
| | Use "instr" which searches for one string inside another. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
20,527 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top