IPTSCRAE SCRIPTING LESSON TEN
There are a few commands that don't fit into the other categories. They are covered in this final lesson for completeness.
Raisin' a Ruckus
There is a command that makes noise. Use it creatively and it can add a great deal to your Palace experience. However, remember that excessive use of sound commands can be annoying.
This command causes the WAV file <filename> to be played. Only you hear a SOUND command. Note that if you execute a SOUND command while another one is playing, the second sound is not heard. Thus, when playing multiple sounds, you'll need to use ALARMEXEC or some other method to delay the next command until it will be heard. Also, since only you hear it, you hear it with no delay. If you used this version:
you would hear it only after it comes back to you like it does to everyone else. Normally, this won't be of any significance, but you'll notice it if there is very much lag, or if you have al long script which would create temporary lag.
This command causes the system beep sound to be heard on the user's computer. On Tandika's computer, (PC, Win95, SoundBlaster card,) this sounds like a bell. Foxy has tried it on his system, and has not heard anything. (Our guess is that the system setup is to blame somewhere).
Does Anybody REALLY Know What Time It Is?
With a little effort, clocks and calendars can be included in your Palace. These functions are the keys.
This function returns the number of seconds that have passed since January 1, 1970 (Pacific Standard Time). Translating this number to a Julian date is left as an exercise for the reader. Note that this is true ONLY for PC's! For Macs, you need to "convert" the time. Here is a piece of code to do so:
Using this, the variable "mytime" will always equal the PC version, whether the user is PC or Mac.
This is similar to DATETIME. However, the number you get is in hundredths of a second, and it starts over after about 1,000,000 ticks. (10,000 seconds, or 166 minutes 40 seconds - about 2.75 hours.) It would be handy in routines where hundredth of a second accuracy is desired.
This command allows you to "dim the lights" in the room, decreasing the luminance of all visible graphics and props. Avatars will remain fully lit. The natural state of a room is 100% lit. By specifying an integer <number> lower than 100 and higher than 0, you can set the lighting to any desired percentage. Note that if <number> equals 100 or 0 (zero), the room will be made 100% lit again.
In conjunction with the ROOMID command, this is used to instantly transport you to another room.
A few commands that will manipulate the stack directly are:
This command duplicates the top element on the stack.
This command pops the top element off the stack and discards it.
This command swaps the top two elements on the stack.
It is possible to send a user directly to a web page, an ftp site or even another Palace. It is handy to do this yourself, directly from the command line. I've used it many times to send email immediately or to look at a web page someone has referred to in conversation.
These two commands are synonymous. Either one will work, although I've only seen NETGOTO actually being used. They start up your browser, and load it to the specified web address. This uses the standard URL addressing system. So any of the following would be valid prefixes for your string:
Finally, there are a couple of things that truly did not fit anywhere else. They are:
Kills the user specified by the user id. However, this works only when you have kill authorization, and almost all Palaces restrict that to wizards only. Just remember that if you are in a palace where that is allowed, or if you have wizard status, this command would kill the person you are whispering to:
However, there are usually quicker ways to do it, so I've never personally used this command "for real".
This function, which is discussed during class time for Lesson 3, puts a random integer on the stack, from 0 to <number> minus 1.
The homework assignment is very simple. Use your creativity and knowledge to make at least three routines that use these commands in some sort of useful fashion. At class time, demonstrate and explain how you used the commands.
Consider teaching others what you have learned. One of the best learning reinforcements is to teach. There are new people just learning about Palace and Iptscrae every day. More and more teachers are needed. By sharing with others, you improve Palace life for everyone.
There is a school of thought that says, "Knowledge is Power". Although it is possible to achieve instant infamy by writing clever, annoying scripts it is short-lived. Power "over" will gain you animosity, dislike, and even get you banned from various Palaces. On the other hand emPOWERing others, by sharing what you have learned, and writing scripts that are enjoyed by all will bring you lasting fame and glory. (And work!) Wise use of your knowledge is the best way to obtain favor in the eyes of people looking for help, and is indeed a good way to obtain the "power" that "snerts" can only dream about.