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 ➜ VBscript ➜ Syntax?

Syntax?

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


Posted by Madrox   (40 posts)  Bio
Date Sat 16 Sep 2006 01:24 AM (UTC)
Message
Hi, I was wondering what the proper syntax for "printing" a variable is.

Something like:

You have <var> use <var> to heal
I have all the captures, and a script to figure cures. But Just don't know syntax
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 16 Sep 2006 02:04 AM (UTC)
Message
http://www.gammon.com.au/scripts/doc.php?function=Note

- Nick Gammon

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

Posted by Madrox   (40 posts)  Bio
Date Reply #2 on Sat 16 Sep 2006 02:49 AM (UTC)
Message
Aye, I know about world note, but I mean how do I include variables. If I do world.note ("You are afflicted with @affliction heal it with @heal") wont it print just that?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 16 Sep 2006 04:34 AM (UTC)

Amended on Sat 16 Sep 2006 04:35 AM (UTC) by Nick Gammon

Message
If they are MUSHclient variables (not VBscript variables), and you have "expand variables" checked, and that is in a "send to script", then it will work as you have written it (except for the brackets).

However if you are in a script file, then you need to get the variable separately, like this:


Note "You are afflicted with " & GetVariable ("affliction") & " heal it with " & GetVariable ("heal")


That was for MUSHclient variables (which are stored in the world file). If they are VBscript variables then it is a bit simpler:


Note "You are afflicted with " & affliction & " heal it with " & heal

- 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.


18,381 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.