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.
 Entire forum ➜ MUSHclient ➜ VBscript ➜ VB6 AddTrigger(Ex) Question/Problem

VB6 AddTrigger(Ex) Question/Problem

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


Posted by Onoitsu2   USA  (248 posts)  Bio
Date Tue 31 Jan 2006 07:35 AM (UTC)
Message
I am having a problem sending the following from within a VB Application made with VB6. I got the main concepts for mushclient from the super hp bar, which I as far have perfected for my own use on Aardwolf (aardmud.org), such as the theworld.XXX i have declared as public in a module, and I get the syntax popup to aid in the commands.

I get the following error message from the code following:
"Object variable or With block variable not set"


Dim TriggerName, TriggerMatch, ResponseText, SoundFileName, ScriptName As String
Dim Flags As Long
Dim Colour, Wildcard, SendTo, Sequence As Integer
TriggerName = "HB_Trigger"
TriggerMatch = "^\<(\d+)\/(\d+)hp (\d+)\/(\d+)mn (\d+)\/(\d+)mv (\d+)tnl Gold: (\d+)(\w?\w?(.*?))?\>"
ResponseText = ""
Flags = eEnabled + eTriggerRegularExpression
Colour = -1 'No Colour Change
Wildcard = 0 'Do Not Copy Any Wildcard To Clipboard
SoundFileName = "-1"
ScriptName = "-1"
SendTo = 0 'Send To World = 0, Sent To Command = 1, Send To Script = 12
Sequence = 100

result = theworld.AddTriggerEx("TriggerName", "TriggerMatch", "ResponseText", Flags, Colour, Wildcard, "SoundFileName", "ScriptName", SendTo, Sequence)
theworld.Note "test"


In the super bar however I have a wimpy option added, that sends whatever wimpy command is to the mud when HP is less than or equal to the wimpy value.

Do I have to call MY program from inside a plugin, and pass the callingworld option like I see in the super bar?

OR

Can I get the "callingworld" from the mushclient program from some function, or built in COM command ?

Any advice on this topic would be great.

Thanks in advance,
Onoitsu2
Top

Posted by Nick Gammon   Australia  (23,121 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 31 Jan 2006 09:28 AM (UTC)

Amended on Tue 31 Jan 2006 09:29 AM (UTC) by Nick Gammon

Message
Quote:

result = theworld.AddTriggerEx("TriggerName", "TriggerMatch", "ResponseText", Flags, Colour, Wildcard, "SoundFileName", "ScriptName", SendTo, Sequence)


Your first problem is you are quoting what appear to be variable names. It should read:


result = theworld.AddTriggerEx(TriggerName, TriggerMatch, ResponseText, Flags, Colour, Wildcard, SoundFileName, ScriptName, SendTo, Sequence)


Second, I wouldn't have:


ScriptName = "-1"


There won't be a script function called "-1". Just leave it empty if you don't want to call a script. Ditto for sound file name.

As for what calls what, where does all this start? In MUSHclient, calling a script, or are you trying to call MUSHclient from a VB application?

- Nick Gammon

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

Posted by Onoitsu2   USA  (248 posts)  Bio
Date Reply #2 on Tue 31 Jan 2006 10:06 AM (UTC)
Message
I have tried with and without the quotes, with and without the -1 in the script field.

This is to be in a VB6 App, so I can run it independently from mushclient, and control mushclient, so there is no plugin installing needed, as lots of people on my mud do not know how to install a plugin ...

Thanks,
Onoitsu2
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.


11,465 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.