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
➜ Lua
➜ MSP_lua.xml issue
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Llarn
(23 posts) Bio
|
Date
| Thu 15 Mar 2018 01:31 AM (UTC) |
Message
| Hi there,
This might be in wrong spot, sorry if that is the case, but am pulling my hair out trying to get msp_lua.xml plug-in to work.
I have set_msp_path correct.
ERROR: Cannot open the specified file playing C:/Mush-z/worlds/6dragons/sounds/sound/player.wav
That is actually where the player files are. But it won't play.
Any idea what I'm doing wrong?
Llarn | Top |
|
Posted by
| Llarn
(23 posts) Bio
|
Date
| Reply #1 on Thu 15 Mar 2018 01:54 AM (UTC) Amended on Thu 15 Mar 2018 03:25 AM (UTC) by Nick Gammon
|
Message
| Well this is the plug-in I got. Problem probably is I'm using really old stuff, cause haven't mudded in many years, than come back and I'm shocked I can't get crap to work. I'd appreciate any help to get it to work though. Really path is exactly dead on and that is the only error I get.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="MSP_Lua"
author="Nick Gammon"
id="7da63d78d9f91bebb5285127"
language="Lua"
purpose="Emulates MSP (MUD Sound Protocol)"
save_state="y"
date_written="2014-08-10 15:43"
requires="4.54"
version="1.0"
>
<description trim="y">
<![CDATA[
Type: "msp:help" to see this help.
See: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=783 for a more complete description.
You will need to get the sound files manually (ie. from the MUD) and install them before using this.
The plugin is configured to look for them in the "sounds" directory of the MUSHclient installation,
but you can change that by typing:
set_msp_path new_path
eg.
set_msp_path d:\muds\mushclient\msp
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="!!SOUND\(([A-Za-z0-9./]+).*\)"
name="sound"
omit_from_output="y"
regexp="y"
script="OnSound"
sequence="100"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
script="On_set_MSP_path"
match="set_msp_path *"
enabled="y"
>
</alias>
<alias
script="OnHelp"
match="msp:help"
enabled="y"
>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
function fSound (filename)
local result = PlaySound (0, GetVariable ("msp_path") .. filename)
if result ~= error_code.eOK then
ColourNote ("red", "", "ERROR: " .. error_desc [result] .. " playing " .. GetVariable ("msp_path") .. filename)
end -- if
return "" -- omit MSP stuff from output
end -- function fSound
-- handle a line with !!SOUND in it
function OnSound (name, line, wildcards, styles)
-- echo existing line with colours, sending !!SOUND part to a function
for _, v in ipairs (styles) do
local text = string.gsub (v.text, "!!SOUND%(([%a%d./]+).-%)", fSound)
ColourTell (RGBColourToName (v.textcolour),
RGBColourToName (v.backcolour),
text)
end -- for each style run
Note ("") -- finish the line
end -- function OnSound
-- change desired sound file path
function On_set_MSP_path (name, line, wildcards)
local path = wildcards [1]
-- ensure trailing backslash
if string.sub (path, -1) ~= "" then
path = path .. "/"
end -- if
SetVariable ("msp_path", path)
print ("MSP sound files will be obtained from " .. path)
end -- function On_set_MSP_path
-- do telnet negotiation
function OnPluginTelnetRequest (type, data)
if type == 90 and data == "WILL" then
return true -- IAC DO MSP
else
return false
end -- if
end -- function OnPluginTelnetRequest
-- show help
function OnHelp ()
print (GetPluginInfo (GetPluginID (), 3))
end -- function OnHelp
-- use supplied path or default
msp_path = GetVariable ("msp_path") or GetInfo (74)
]]>
</script>
</muclient>
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Thu 15 Mar 2018 03:30 AM (UTC) |
Message
| Can you please use a "command" window to prove the files are where you think they are? Navigate to the directory where you put them and type DIR, for example:
C:\Program Files\MUSHclient\sounds>dir
Volume in drive C has no label.
Volume Serial Number is 44D9-94D6
Directory of C:\Program Files\MUSHclient\sounds
11/08/2014 08:39 PM <DIR> .
11/08/2014 08:39 PM <DIR> ..
27/07/2009 04:44 PM 136,192 backstab1.wav
24/05/2010 08:22 AM 140,364 Cartoon Timpani.wav
28/02/2006 11:00 PM 171,100 tada.wav
C:\Program Files\MUSHclient\sounds>
Then copy the results and paste them here. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Llarn
(23 posts) Bio
|
Date
| Reply #3 on Thu 15 Mar 2018 10:55 AM (UTC) |
Message
| Unfortunately, the forums won't let me do any attachments on forums. Guess I don't have permission?
I was going to screen shot it for you.
/Mush-z/worlds/6dragons/sounds/sound | Top |
|
Posted by
| Llarn
(23 posts) Bio
|
Date
| Reply #4 on Thu 15 Mar 2018 09:00 PM (UTC) |
Message
| Nick,
Figured it out.
I was using playaswindows wine software for linux. It was showing me as C:/ for running mush, however set_msp_path would not be fooled it still demanded home/Mush-z/sound
Thanks for the great software!
Llarn | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #5 on Fri 16 Mar 2018 03:25 AM (UTC) |
Message
| I don't let anyone attach files to the forum, except for administrators. That keeps out spam, porn, and other crap.
Glad you figured it out. It usually works quite well under Linux. |
- 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.
17,099 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top