Register forum user name Search FAQ

Gammon Forum

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 ➜ General ➜ Sounds in chat sessions

Sounds in chat sessions

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 Sat 26 Apr 2003 04:51 AM (UTC)

Amended on Sat 26 Apr 2003 04:52 AM (UTC) by Nick Gammon

Message
If you want to have sounds play during your chat sessions (eg. to tell you there is a new call, or a new message) you can achieve this by some customising of the chat.xml file, or - perhaps better - make your own "local" plugin that simply plays the sounds.

Since the chat system will call the chat callbacks in all installed plugins you can have one plugin to play the sounds, and another to do the command-line handling, as supplied with MUSHclient.

The sound file names here are examples, you would customise them (and the directory) to suit whatever you wanted to hear.




'
'  Play sound when someone tries to connect
'
Function OnPluginChatAccept (sText)
  Sound "c:\mushclient\sounds\connect.wav"
  OnPluginChatAccept = vbTrue  ' accept it
End Function
 
'
'  Play sound at start and end of file transfer
'
Function OnPluginChatMessage (id, message, sText)
  OnPluginChatMessage = vbTrue  ' process it

  if message = 20 then
     Sound "c:\mushclient\sounds\filestart.wav"
  end if

 if message = 24 then
     Sound "c:\mushclient\sounds\fileend.wav"
  end if
End Function

'
'  Play sound on incoming message
'
Function OnPluginChatDisplay (message, sText)
  OnPluginChatDisplay = vbTrue  ' display it

  if message >= 3 and message <= 6 then
     Sound "c:\mushclient\sounds\chat.wav"
  end if
End Function

'
'  Play sound on user disconnect
'
sub OnPluginChatUserDisconnect (id, name)
  Sound "c:\mushclient\sounds\disconnect.wav"
end sub

- 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,301 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.