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
➜ Spell Bot issue
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Chylde
(1 post) Bio
|
| Date
| Thu 10 Mar 2005 11:43 PM (UTC) Amended on Thu 10 Mar 2005 11:49 PM (UTC) by Chylde
|
| Message
| I have been trying to get some vbscript code to work, and being a newbie at vbscript am unsure why. I remember some VB6, but I havent kept my skills up to date, as it was for a class in college a few years back.
What I am trying to do, is if somebody in a group asks for a spell, I will cast that spell on them. I have no problem with doing that, but I wanted to expand the trigger and check to see if I am sleeping, and if I am, cause me to wake up and cast the spell.
The code I currently have is this:
Pattern to fire:
* tells the group, 'sanc*
Commands
if sleep = true then
wake
cast sancuary %1
gt $1 Sanctified
else
cast sancuary %1
gt $1 Sanctified
endif
I know the code is crude and simple, and possibly just wrong, but any help would be much appreciated.
| | Top |
|
| Posted by
| Flannel
USA (1,230 posts) Bio
|
| Date
| Reply #1 on Fri 11 Mar 2005 05:18 AM (UTC) |
| Message
| End if is two words.
You'll use %1 for all three, not $1.
And, since this is end the scripting environment, you'll need to use send to send things to the mud (VBScript doesn't know what to do with 'wake' for instance).
So that will be:
if sleep = true then
send "wake"
send "cast sancuary %1"
send "gt $1 Sanctified"
else
send "cast sancuary %1"
send "gt %1 Sanctified"
end if
True however, well, it depends on what youre using. If youre setting a variable (sleep) to "true" then that will work (except you'll need to use getvariable("sleep") instead of just sleep) however they 'true' keyword is "VBTrue", which you might as well use any non-zero integer (VBTrue technically is -1 though, false is 0) most of us use 1 and 0 though (1 still evaluates to true since its non zero).
And of course, this is inside the trigger's "send" box (with 'send to' set to script).
For VBScript syntax, I suggest you download the VBScript docs (Mushclient forum > Script Functions > Script Engines you can Download > Help files (third one down))
It's helpful since you can look up the exact syntax of whatever (as well as get a list of all the commands grouped alphabetically as well as by topic).
As for the mushclient commands, scroll back up to the top of the page and click the Alphabetic list of script functions. Peruse over them to get a feel for what MC has to offer script wise. And then read the help file (the new one, or the online one) about triggers/aliases/etc (the big topics, since they also delve into how triggers work with scripts and such). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | | 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.
10,548 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top