Okay, let me elaborate on what I'm doing...
This is my plugin.
Quote:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, September 12, 2003, 12:23 AM -->
<!-- MuClient version 3.24 -->
<!-- Plugin "msp" generated by Plugin Wizard -->
<muclient>
<plugin
name="MM_MSP_Emulation"
author="Nick Gammon with alterations by ****** for use with MateriaMagica IEN"
id="74c06c730af9e17ac98dc126"
language="VBscript"
purpose="Emulates MSP (MUD Sound Protocol) on MateriaMagica"
save_state="y"
date_written="2003-09-11 12:12:11"
requires="3.24"
version="1.0"
>
<description trim="y">
<![CDATA[
Type: "msp:help" to see this help.
See:
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 C:\Program Files\MUSHclient\msp,
but you can change that by typing:
set_msp_path new_path
eg.
set_msp_path C:\Program Files\MUSHclient\msp
This does require sound to be enabled, so type:
set sound on
Also, this requires you to manually set a few things.
Set MXP/Pueblo on, follow these steps:
1.) Press Ctrl+Alt+U, or use Game -> Configure -> MXP / Pueblo
2.) Set "Use MXP/Pueblo to "On Command"
3.) Uncheck all other options.
Now we need to add something to the scripting interface.
1.) Press Shift+Ctrl+6 or use Game -> Configure -> Scripting
2.) Press the MXP button
3.) In the Opening Tag box, insert "OnMXPStartTag", without the quotes.
And finally, you need to specify either .wav files, or .mp3 files,
type:
set_msp_type (file type)
eg.
set_msp_type wav
or
set_msp_type mp3
Any questions, feel free to contact ******* in game.
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.vbs"/>
<!-- Aliases -->
<aliases>
<alias
script="On_set_MSP_path"
match="set_msp_path *"
enabled="y"
>
</alias>
<alias
script="On_set_MSP_type"
match="set_msp_type *"
enabled="y"
>
</alias>
</aliases>
<!-- Variables -->
<variables>
<variable name="msp_path">C:\Program Files\MUSHclient\msp</variable>
</variables>
<!-- Script -->
<script>
<![CDATA[
'
' Script to emulate MSP on MateriaMagica.
'
Sub On_set_MSP_type (strName, strLine, arrWildCards)
dim sType
sType = arrWildCards (1)
'
' ensure either "wav" or "mp3" was specified
'
Select Case sType
Case "wav"
world.setvariable "msp_type", sType
world.note "MSP will now use the .wav extension"
Case "mp3"
world.setvariable "msp_type", sType
world.note "MSP will now use the .mp3 extension"
Case Else
World.Note "You must specify either 'wav' or 'mp3' for sound file extension."
End Select
End Sub
sub On_set_MSP_path (strName, strLine, aryWildcards)
dim sPath
sPath = aryWildcards (1)
'
' ensure trailing backslash
'
if right (sPath, 1) <> "\" then
sPath = sPath & "\"
end if
world.setvariable "msp_path", sPath
world.note "MSP sound files will be obtained from " & _
sPath
end sub
Function OnMXPStartTag (name, args, mylist)
dim i
dim fn
dim arg
'
' only process sound tags
'
if name <> "sound" then
exit function
end if
'
' find the sound file name
'
if not IsEmpty (mylist) then
for i = lbound (mylist) to ubound (mylist)
arg = split (mylist (i), "=")
if arg (0) = "fname" then
fn = arg (1)
end if
next
End If
'
' play sound
'
if fn <> "" then
fn = Replace (fn, "*", world.getvariable ("msp_type"))
world.Sound msp_Path & fn
end if
' suppress sound tags (handle them ourselves)
OnMXPStartTag = 1
end function
]]>
</script>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="msp:help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
World.Note World.GetPluginInfo (World.GetPluginID, 3)
End Sub
]]>
</script>
</muclient>
I'm trying to make a portable plugin for sounds with my mud. The only things that are hanging me up are the (on_mxp_open_tag="OnMXPStartTag" ), since I can't think of a way to automate that refrence to be installed into the world file (found under " <world " in the .mcl file, and the plugin doesn't work because theres no connection between "OnMXPStartTag" and the plugin. The script itself works fine if I add all the aliases and stuff to the regular world alias/trigger/script, but not as an independent standalone plugin.
I thought about adding a OnMXPStartTag sub and refrencing it to the plugin, but that kind of negates the portablility and automatic installation. Again, I'm shooting for ease of use and portablility, since this is going to be availible for download from the mud's web page. Is there an easy way to point OnMXPStartTag to the plugin?
|