Rom Derivitive, MXP and Mobprogs

Posted by Thalor42 on Thu 03 Mar 2011 02:37 PM — 5 posts, 22,720 views.

#0
Ok I've gone over this as much as I can on my code....

In ZMUD when I send the CLI command #MXP <SEND>Look</SEND>

Which displays look

I click on it and it sends look to the mud and the mud looks.....Thats great.

I can also have the mud send MXP to the client as well.

Example:

Code (text):


write_to_buffer( d, MXPTAG ("!ELEMENT look \"<send href='look'>\""),0);

LATER ON IN CODE

stc( "* " MXPTAG("look") "@Rlook@x" MXPTAG("/look")"",ch);



Which displays look. I click it and it looks for me.

My problem stems from wanting mobprogs to send the codes to the client.

Im probably being REAL stupid about it....

I am using



mob echoat $n #MXP <SEND>look</SEND>

and

mob echoat $n #MXP \x03send\x04 look \x03/send\x04


to try to get it to send. It prints on the screen.


All I get is whatever I type into the mobprog displayed on the screen, zmud either wont interpret it OR
its not being translated properly in the code before being sent to the character.

Is this a case of mob echoat not using write_to_buffer and going right to act?

Any help with this would be great! Thanks!
Australia Forum Administrator #1
I'm not sure how to help as I'm not sure how you implemented MXP in the code. The stuff about:

Quote:

mob echoat $n #MXP \x03send\x04 look \x03/send\x04


... sounds like what I suggested to do for the < and > signs, which get converted back at the last moment (and thus don't become MXP tags).

If you get a packet debug (MUSHclient will do that) then you can at least see what is arriving from the MUD. If zMUD is not displaying the hyperlinks you are probably getting &lt; rather than <, but it is hard to be sure.
#2
I';m using your implementation of MXP from your page. It's been driving me nutty...im going to see if I can see the output of the string as it leaves the server.... if you can think of ANYTHING let me know!

Thanks!
Australia Forum Administrator #3
I think I see what your problem is now. And I think I had it backwards about the \x03. That is what gets converted to "<" and the "normal" "<" gets converted to &lt;

So what you are saying is that the normal C-style MXP works, but not when inside a "mob echoat"? That's probably because the "<" inside the echo gets converted (correctly in my opinion) to &lt;.

Do you ever use <, > or & inside the mob echoat commands? You probably do somewhere, right?

Maybe make a new command, like "mob echoatmxp".

Then when you go to echo whatever that string is, you convert the "<" and ">" to \x03 and \x04, so that the output routine converts them back.

The whole system was designed to be "fail safe" so that if you didn't take special steps, stray < and > signs did not end up in the output, possibly confusing the MXP parser at the client end.
Amended on Sat 05 Mar 2011 02:38 AM by Nick Gammon
#4
Thanks for the tip. I'll give it a shot!