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
➜ Change to way you call world functions
|
Change to way you call world functions
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Wed 13 Nov 2002 03:07 AM (UTC) |
| Message
| A few versions back (version 3.27) the way the scripting engine works was changed in a subtle way.
The change is that it assumes "world" in front of things if it can. What this means in practice is that these two examples are the same:
sub mytrigger (a, b, c)
world.note "trigger called"
world.colournote "white", "red", "Beware!"
world.send "go north"
end sub
New method ...
sub mytrigger (a, b, c)
note "trigger called"
colournote "white", "red", "Beware!"
send "go north"
end sub
Notice how the second example is shorter and a bit easier to read. This also works in Jscript and Perlscript.
Thus you can use the shorter version in your scripts providing you are sure they will run in 3.27 onwards (set as the "required version" in your plugin header).
|
- 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.
5,103 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top