Knowledgebase
Storm Palace Hosting > Storm Hosting Help Desk > Knowledgebase

Ask a question:


General Sounds

Solution Scripts Music Images WWW Tweaks/How to's Server & Programs Voice Sound PChat Security Contact Us Us

Hover mouse on each icon for information

SoundStuff

If you are using a midi, include the .mid extention as both clients will download and play that. Macs NEED the extention so the right player will know to play that sound. SOUND and MIDIPLAY are local commands while SAY works for the whole room. If you want more extensive discussions on the different clients and how they behave, read the midi webpage. Im just going to touch on how to either play sounds or download them.

ON SELECT { "soundname.mid" SOUND } ;will d/l and play on both systems
ON SELECT { "soundname" SOUND } ;no extention for a wav

ON SELECT { "soundname.mid" MIDIPLAY } ;will play on both systems but not d/l

ON SELECT { ")soundname.mid" SAY } ;will play on both systems but not d/l
ON SELECT { ")soundname" SAY } ;no extention for a wav

"soundname.mid" SOUND ; this downloads the sound to the user if they do not have it and plays it if they do.
{ "soundname.mid" MIDIPLAY } 240 ALARMEXEC ;this plays the midi for the user approx 4 secs after they enter the room but will cause the mac client to queue it twice.

{ ";#soundname.mid#" SAY "soundname.mid" MIDIPLAY }

The #....# tells the Mac plugin to start a midi and ignore any further requests to play a midi. This prevents replays when other people enter the room. Remember that this will not download for a mac nor a pc. You have to use the SOUND command in an ON SELECT door so the mac user will be ready for it.

{ 10 "mymidi" MIDILOOP } 240 ALARMEXEC ;this will begin playing the midi 10 times in succession starting appox 4 secs after the user enters the room

;Will download it and everybody in room hears it
ON SELECT { "soundname.mid" SOUND ")soundname.mid" SAY } ;if you use this script, you are going to cause macs to play it twice. Remember that they send sounds (other than wavs) to an external player. Its the same as someone doing this to a PC user...
ON SELECT {
{ "soundname.mid" SOUND } 10 ALARMEXEC
{ "soundname.mid" SOUND } 3600 ALARMEXEC }
That will cause the same sound to play again after the first is finished (if its finished in one minute, but you get the idea)

;This will stop a midi playing if they say ms (PC only)
ON OUTCHAT {
{ MIDISTOP } CHATSTR "ms" == IF

;This will stop it if they click a spot (PC only)
ON SELECT { MIDISTOP }

;This script will allow the download and the playing of the sound without having to leave the room
ON ENTER {
clickCt GLOBAL
0 clickCt = }
ON SELECT {
clickCt GLOBAL
clickCT ++
{ "soundname.mid" SOUND
"@29 367 To play the sound after it downloads, just click" LOCALMSG } 1 clickCT == IF
{ ")soundname.mid" SAY
"@29 367 To play the sound again, just click once more" LOCALMSG 0 clickCt = } 2 clickCT == IF }

;This will download and turn off and on at the users choice
ON ENTER {
"soundname.mid"SOUND
clickCt GLOBAL
0 clickCt = }
ON SELECT {
clickCt GLOBAL
clickCT ++
{ "soundname.mid" MIDIPLAY
"@29,367 To stop the music, just click again" LOCALMSG } 1 clickCT == IF
{ MIDISTOP
"@29,367 To start the music again, just click once more" LOCALMSG 0 clickCt = } 2 clickCT == IF }

;Will loop a wav or midi
ON ENTER { soundname GLOBAL loop GLOBAL
0 ME SETSPOTSTATELOCAL
;To change the name of the midi/wave that is played, change the
;midi/wave name on the next line.Change won't take effect until you leave and
re-enter the room.
"Ocean" soundname =
1 loop =
300 ME SETALARM
}
ON ALARM { soundname GLOBAL loop GLOBAL
{ soundname SOUND soundname MIDIPLAY } loop 1 == IF
350 ME SETALARM
}
ON SELECT { loop GLOBAL soundname GLOBAL
{ 1 ME SETSPOTSTATELOCAL 0 loop =
"Looping " soundname & " Stopped" & LOCALMSG
MIDISTOP EXIT } ME GETSPOTSTATE ITOA "0" == IF
{ 0 ME SETSPOTSTATELOCAL 1 loop =
"Looping " soundname & " Started" & LOCALMSG
EXIT } ME GETSPOTSTATE ITOA "1" == IF
}

;If you want to loop a wav 3 times
ON SELECT {
{ "wav1" SOUND }
{ "wav2" SOUND } 500 ALARMEXEC
{ "wav3" SOUND } 1000 ALARMEXEC }

;To run this script, you need to have someone with a wizard's badge on say ;pl0 to ;plwhatever is your highest number. ;Note that this won't d/l the midis to people that don't have it, you'll need to provide for that separately.
ON INCHAT {
{ [ "midiname0" "midiname1" "midiname2" "midiname3" "etc..." ]
"$1" GREPSUB ATOI GET MIDIPLAY
} WHOCHAT WHONAME "^[*]" GREPSTR CHATSTR "^;pl([0-9]+)$" GREPSTR AND IF }

What if you want the user to download sounds for a later room, but you dont want them to lag out and come back to that download room and hear the sound before you are ready? Maybe a surprise birthday midi. Heres how to do this. First you need to create a wav file that is a couple of seconds long, but has no sound. You can get this at Scriptbarn also (hotcity.com:9998) What we are doing is making the user listen to silence, while the real sound or sounds are BEHIND that sound so they wont be heard in this room.

ON ENTER {
"silent.wav" SOUND
"realsound1.wav" SOUND
"realsound2.wav" SOUND }

;a script to continuously play a wav file, with on/off options. Note that when "off" is selected, the wav wont stop until it finishes playing the current loop it is in.
ON ENTER { snd GLOBAL 1 snd =
"Say Off to turn sound off, On to turn it on" STATUSMSG
1 ME SETALARM }
ON ALARM { snd GLOBAL
{ "wavname" SOUND ;name of your sound in the quote marks
1000 ME SETALARM ;adjust the 1000 value, take length of wav in seconds and
multiply by 60
} snd IF }
ON OUTCHAT { snd GLOBAL
{ "" CHATSTR = 1 snd = 1 ME SETALARM } snd NOT CHATSTR "On" == AND IF
{ "" CHATSTR = 0 snd = } snd CHATSTR "Off" == AND IF }

;This will download if they dont have it or play if they do random sounds. Put in as many as you like.
ON SELECT {
[ "soundname1.mid" "soundname2.mid" "soundname3.mid" ]
DUP LENGTH RANDOM GET SOUND
}

;This will play when they click and if they click again before the song is over, it stops (PC ONLY). If they click again, a ;new song starts. It does not download them if they dont have them. You will have to make a separate spot for that.
ON SELECT {
{ [ ")openarms.mid"
")freebird.mid"
")faithfully.mid"
] 0 1 SETSPOTSTATELOCAL DUP LENGTH RANDOM GET SAY
} ME GETSPOTSTATE 0 == IF
{ MIDISTOP } ME GETSPOTSTATE 1 == IF
{ 0 ME SETSPOTSTATELOCAL }
{ ME GETSPOTSTATE 1 + ME SETSPOTSTATELOCAL
} ME GETSPOTSTATE 1 == IFELSE
}

;This script is provided by Foxy. It will download when they first click and play when they click again after downloading. It will also stop one and start another with the one click.

ON ENTER { track GLOBAL 0 track = }
ON SELECT { track GLOBAL
[ "midiname1" "midiname2" "midiname3" "etc" ] midis =
MIDISTOP midis track GET SOUND
track 1 + midis LENGTH % track =
}

These last two scripts were provided by Andy to help us against the sound crash bug and popwigger.

;Anything over 50 characters long wont let them say it.
;both the ENTER and OUTCHAT sections go at entry points, and the OUTCHAT section goes elsewhere.

ON ENTER {
soundlength GLOBAL {
{
{ "I might be using the sound crash" SUSRMSG "" CHATSTR = EXIT
} CHATSTR "^(..................................................)(.*)" GREPSTR CHATSTR "^[)](.*)$" GREPSTR AND IF
} CHATSTR " " GREPSTR NOT IF
} soundlength DEF
}
ON OUTCHAT { soundlength GLOBAL soundlength EXEC }

;Put all of this at your gate to engage the globals and then in each room you want this to work, put this part:

ON OUTCHAT { soundlength GLOBAL soundlength EXEC }

;This is for the program that allows them to say )pop over and over until they crash you and/or your pserver.
ON OUTCHAT {
{ "" CHATSTR = "`page I may be abusing sounds." SAY
} CHATSTR "^[)]pop [)]pop(.*)$" GREPSTR IF
}
ON INCHAT {
{ "`page Possible sound abuse in this room." SAY
"`mute " WHOCHAT WHONAME & SAY
} CHATSTR "^[)]pop [)]pop(.*)$" GREPSTR IF
}

 
Was this article helpful? yes / no
Article details
Article ID: 295
Category: Sounds
Date added: 10-05-2011 23:48:32
Views: 3177
Rating (Votes): Article not rated yet (0)

 
<< Go back

Powered by Help Desk Software HESK™