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
➜ MXP and Pueblo
➜ MXP Sound problems.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #15 on Mon 22 Sep 2003 06:38 AM (UTC) |
| Message
| You don't insert it, you just do it. That is, replace this:
Function OnMXPStartTag (name, args, mylist)
dim i
dim fn
dim arg
' ---- blah blah
End Function
with this:
Function OnPluginMXPopenTag (args)
dim i
dim fn
dim arg
' ---- blah blah
End Function
However the function will need to be rejigged slightly because all the information is in the single argument, as I described earlier. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #16 on Mon 22 Sep 2003 06:53 AM (UTC) |
| Message
| | I don't need to put OnPluginMXPopenTag in the MXP script routines under the scripting configuration page? | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #17 on Mon 22 Sep 2003 06:58 AM (UTC) |
| Message
| Apparently, I don't. This is awesome. Now to fiddle with the script. So far, I have this:
Function OnPluginMXPopenTag (strArgs)
Dim fn
Dim mylist
Dim arrType
dim i
dim arg
mylist = Cstr(strArgs)
arrType = Split(mylist, ",", -1, 1)
if arrType(0) <> "sound" then
exit function
end if
mylist = arrType (1)
arg = split (mylist, "=", -1)
fn = arg (1)
fn = Replace(fn, "' v", "")
fn = Replace(fn, "'", "")
msp_path = world.GetVariable ("msp_path")
msp_type = world.GetVariable ("msp_type")
if fn <> "" then
fn = Replace (fn, "*", world.getvariable ("msp_type"))
world.Sound msp_path & fn
end if
OnPluginMXPopenTag = 1
End Function
It's pretty sloppy, but its 3 am here :P
I'd like to get rid of some variables. The first split is to get rid of the 'sound' precurser, the second split is to isolate the filename, but I kept getting something along the lines of:
..So, I had to do two replaces to get rid of the "'" and the "' v". I'm not sure of a better way to do that.
So, if you have a better suggestion, feel free. I'll be burning the midnight oil over here. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #18 on Mon 22 Sep 2003 08:01 AM (UTC) |
| Message
| Yes, you don't need anything in the scripting configuration window.
Now for the other problem. The arguments are:
FName="mm_door_open.*" V=100 L=1 P=50 T="misc"
So, the first split could be on a space, to get the individual arguments (eg. filename, V , L, P , T)
Then, after splitting that one you have "FName="mm_door_open.*"" which you can then split at the "=". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #19 on Sat 27 Sep 2003 05:52 AM (UTC) Amended on Sat 27 Sep 2003 06:18 AM (UTC) by Johnathan Allen
|
| Message
| Anything for plugins (or regular scripts) for mxp definitions?
From the MXP Debug screen:
I 20002: ( 3623) Got Definition: !en MaxHp 3495
I 20002: ( 3623) Got Definition: !en MaxSp 1992
I 20002: ( 3623) Got Definition: !en MaxSt 2138
What I'm trying to do is adapt the super health bar plugin to my mud, but again, things are being done differently. I'm trying to extract the variables and entities from my prompt, but its kinda funky:
.[6z...[1;34m<Mo 1b 5b 36 7a 0a 0d 1b 5b 31 3b 33 34 6d 3c 4d 6f
unt:.[0m .[0m249 75 6e 74 3a 1b 5b 30 6d 20 1b 5b 30 6d 32 34 39
3.[1;34mst>.[0m. 33 1b 5b 31 3b 33 34 6d 73 74 3e 1b 5b 30 6d 0a
..[1;37m[SAFE].[ 0d 1b 5b 31 3b 33 37 6d 5b 53 41 46 45 5d 1b 5b
0m.[1;34m<.[0 30 6d 1b 5b 31 3b 33 34 6d 26 6c 74 3b 1b 5b 30
m<V Hp>3495</V>< 6d 3c 56 20 48 70 3e 33 34 39 35 3c 2f 56 3e 3c
!EN MaxHp 3495>. 21 45 4e 20 4d 61 78 48 70 20 33 34 39 35 3e 1b
[1;34mhp .[0m<V 5b 31 3b 33 34 6d 68 70 20 1b 5b 30 6d 3c 56 20
Sp>1992</V><!EN 53 70 3e 31 39 39 32 3c 2f 56 3e 3c 21 45 4e 20
MaxSp 1992>.[1;3 4d 61 78 53 70 20 31 39 39 32 3e 1b 5b 31 3b 33
4msp .[0m<V St>2 34 6d 73 70 20 1b 5b 30 6d 3c 56 20 53 74 3e 32
138</V><!EN MaxS 31 33 38 3c 2f 56 3e 3c 21 45 4e 20 4d 61 78 53
t 2138>.[1;34mst 74 20 32 31 33 38 3e 1b 5b 31 3b 33 34 6d 73 74
>.[0m .[3z.[7 26 67 74 3b 1b 5b 30 6d 20 1b 5b 33 7a 1b 5b 37
z 7a
And, it doesn't seem OnMXPvariable doesn't seem to be picking up the MaxHp/Sp/St and OnMXPEndTag isn't catching stuff between the 'V''s.
Sorry to be a pain Nick. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #20 on Tue 30 Sep 2003 06:18 AM (UTC) |
| Message
| I tested it with the main script MXP closing tag, and it seemed to pick up the stuff between the Vs.
As for the !EN tags, you could detect them in the OnPluginMXPerror routine, as the !EN definition will be passed to that as an information message. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #21 on Tue 30 Sep 2003 03:49 PM (UTC) |
| Message
| | I'm using the standard OnMXPEndTag sub that you published, and I'm getting nothing. | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #22 on Sun 09 Nov 2003 10:50 AM (UTC) |
| Message
| I've got the !EN tags working okay, I used the OnMXPError function and split down the arguments to isolate the Hp/Sp/St and set them to variables (for testing purposes), but I still can't read the stuff between the <V> tags. Using the MXP start tag and end tag routines, I get nothing. As for debug, I get:
A 20000: ( 4994) MXP element: <V Hp>
E 1023: ( 4994) Unknown MXP element: <v>
A 20000: ( 4994) MXP element: </V>
W 5005: ( 4994) Closing MXP tag </v> does not have corresponding opening tag
That sort of signifies to me that its reading the start and end tags, but doing nothing with them. I'm guessing because the text actually resides between the opening and closing tags, and neither routine is designed to handle this. The mxp start tag is for arguments residing within the first tag, and mxp end tag is looking for a "<V Hp>" and a "</V Hp>", which isn't being used. I suppose I could do this with two sets of triggers, one for the !EN definitions, and another one just to read the prompt off the screen, but that introduces about a round of 'lag' between updates (i.e. the meter displays the last rounds statistics instead of the current one). I really don't know how to grab all the info I need in one fell swoop.
| | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #23 on Mon 10 Nov 2003 08:26 AM (UTC) |
| Message
| I'm still puzzled... Basically its sending this for a prompt:
<<V Hp>3595</V><!EN MaxHp 3595>hp <V Sp>1961</V><!EN MaxSp 1961>sp <V St>2138</V><!EN MaxSt 2138>st>
But I'm still getting nothing with either mxp subroutine.
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #24 on Tue 11 Nov 2003 09:37 PM (UTC) |
| Message
| | Well, *why* is the server sending <V> tags if they aren't defined? Isn't that a server problem? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Johnathan Allen
(49 posts) Bio
|
| Date
| Reply #25 on Thu 27 Nov 2003 04:57 AM (UTC) Amended on Thu 27 Nov 2003 05:02 AM (UTC) by Johnathan Allen
|
| Message
| I thought <V> tags didn't need to be defined, according to the MXP specs on zugg's website.
Quote:
<VAR> <V>
<VAR Name [DESC=description] [PRIVATE] [PUBLISH] [DELETE] [ADD] [REMOVE]>Value</VAR>
The <!ENTITY> tag allows the MUD server to set the value of a variable without displaying the value to the user. The <VAR> tag is just like the <!ENTITY> tag, except that the value of the variable is placed between the <VAR> and </VAR> tags, and this value is displayed to the user.
Hp: <VAR Hp>100</Var>
would display: "Hp: 100" to the user, and would set the entity hp to 100.
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #26 on Thu 27 Nov 2003 06:54 PM (UTC) |
| Message
| Grrrr, he has amended the spec since I did it. MUSHclient supports <var> not <v>.
For some reason Zugg has thrown in synonyms into the MXP specs, for instance <i> and <italic> are the same. When I did the MXP implementation there was only <var> but I see from your quote he has added <v> as well.
I'll add that into the next version. |
- 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.
82,173 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top