Howto make a simple sound-command?

Posted by Mazarin on Fri 13 Aug 2010 12:51 AM — 5 posts, 22,042 views.

#0
A simple question: how do I get a sound to pley?

At the mom. I got a trigger that makes use the mudcommand "page" with a line "Send ("page Mazarin Time = On") - which sends a beep to my character (= Mazarin). However I could use a direct command (like "PlaySound "beep.waw" or whatever). I just don't know howto accieve this.

Any help?

Thank you.

//Mazarin
Australia Forum Administrator #1
Template:function=PlaySound
PlaySound

The documentation for the PlaySound script function is available online. It is also in the MUSHclient help file.



Template:scripting
Scripting tutorial

There is extensive information about scripting in MUSHclient at http://mushclient.com/scripting. This includes screen shots and examples.

#2
I have placed (pasted) the line

"PlaySound (1, "c:\sound\boeing.wav", false, 0, 0)"

as mentioned in the example in among my trigs as mentioned in the example that was referred to. This however gives only a short beep and not the chime-type sound it should. When I replace this line with the command

"Send ("page Mazarin Questtime")"

then I get the correct sound. - I have of course placed a file with the name "boeing.wav" in the directory c:\sound (there is no other file in the directory).

The result is the same independantly of whether I have a full path specified or not.


What might be wrong?


// Mazarin
Australia Forum Administrator #3
If this is Lua, try putting "check" around the call to see what is going wrong. Also, in Lua backslashes need to be doubled. And if this is send-to-script they have to be doubled again.

It might be easier to use forward slashes. So:


check ( PlaySound (1, "c:/sound/boeing.wav", false, 0, 0) )

#4
With forward slashes it works just great. Thanks!!

//Mazarin