[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  @conformat and @exitformat escaping characters?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

@conformat and @exitformat escaping characters?

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


Posted by Serja   USA  (4 posts)  [Biography] bio
Date Wed 03 Nov 2010 05:13 PM (UTC)
Message
Okay, I've been poking at this for the last 48, using Google and whatever help resources (not many) that I can find. What I am trying to do is customize my exit and contents display for my game but still have it output valid pueblo links for clicking to look and move, etc.

I have my code correct for the links, because when I copy the output (which comes out showing the HTML code as well as the data) and @emit/html on my TinyMUSH MUSHclient is happy to parse it and give me viable links.

What's happening when I put it into @exitformat/@conformat is that the html characters (<,>,&,") are getting escaped and so the client isn't parsing the text as MXP but as raw mud text. What I am trying to figure out is how to unescape the characters. I tried url_unescape and html_unescape with no success in my code, and also setting the attribute to html and seeing if it would stop it from doing it. Again, no luck.

Here's what I'm trying:

[url_unescape([sort([iter(%0,<a xch_cmd="[name(##)]">[name(##)]</a>,,|)],a,|,%B%B)])]

It outputs the links in the correct format, but again, is still escaping the characters. Has anyone seen this before? I'm using Tiny 3 and I think the server is running Pueblo 1.0 right now.

- Serja
Archwiz
Beyond the Shell
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 03 Nov 2010 08:37 PM (UTC)
Message
This is a server-side issue, right? It sounds like you haven't got the right format (if indeed it exists) to let the server output raw MXP in an @exitformat sequence.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Serja   USA  (4 posts)  [Biography] bio
Date Reply #2 on Wed 03 Nov 2010 09:02 PM (UTC)

Amended on Wed 03 Nov 2010 10:47 PM (UTC) by Serja

Message
It appears to be server side, yes. I know the server is configured for Pueblo -- that's the default for TinyMUSH -- and also the default exits and contents display do spit out clickable links. It is only when I try to customize it that I run into this issue.

I've tried unescaping, but either I'm doing it wrong or it's not taking. I'm pretty stumped on what to do, because I want to enhance my game with Pueblo for clients that support it, such as MUSHclient.

When I tell MUSHclient to give me the lot on MXP debugs I can see that the client is receiving escaped characters, so I know the server is the one doing the escaping. I just need to figure out how to make it /stop/ escaping.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 03 Nov 2010 09:37 PM (UTC)
Message
I understand the problem here. However it sounds to me that the server is correctly escaping whatever you put there. It would be a bug, really, if it didn't.

What you really need is some sort of @exitformat/html command that tells the server to not bother. If it doesn't have it, I don't think there is much you can do (apart from suggesting it to the admins).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 03 Nov 2010 09:38 PM (UTC)
Message
What you can do at the client end however is omit that line from output, and then construct your own hyperlinks (using the Hyperlink script function).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Serja   USA  (4 posts)  [Biography] bio
Date Reply #5 on Wed 03 Nov 2010 10:50 PM (UTC)
Message
@exitformat and @conformat don't take switches, unfortunately. Also, even when I /do/ use an appropriate command that is supposed to parse html in a desc (@htdesc) it's still escaping the characters, so I'm beginning to wonder if there is a bug somewhere in Tiny.

- Serja
[Go to top] top

Posted by Daniel P   USA  (91 posts)  [Biography] bio
Date Reply #6 on Mon 08 Nov 2010 05:26 PM (UTC)
Message
I've gotten a Pueblo @exitformat to work correctly with some of the built-in pueblo functions that are included in PennMUSH. I'm not sure what the exact differences are between Penn and Tiny, because one is a derivation of the other, but here is the code that I use for my exit line:


EXITFORMAT - [ansi(hw,Obvious exits:)]%r[ufun(exits,%0)]

EXITS - [switch(t(%0),1,[itemize(iter(%0,[tag(a,xch_cmd="go [name(##)]")][tag(font,color="#CCCCCC")][name(##)][endtag(font)][endtag(a)],%b,|),|)],None)]


I too have noticed that it's pretty impossible to catch the < > symbols with client-side MXP scripting (you can't just "@emit <font color="red">Red Text</font>" and hope it works), and I was also speculating the reason to be what you came up with (and thus has caused some of my ZMUD players to have to turn off Pueblo emulation completely), but if you can figure out the Tiny equivalents of the tag() and endtag() functions, I think you'll be good to go for Pueblo at least.
[Go to top] top

Posted by Serja   USA  (4 posts)  [Biography] bio
Date Reply #7 on Tue 09 Nov 2010 01:34 AM (UTC)
Message
Alas, Tiny has no such functions built in. :( I could possibly make them myself, but that seems a righteous pain in the rump, if you ask me.

What I've ended up having to do is use the @htdesc function and @desc and basically have a &base_desc and a &html_desc attribute on each room that contains the description (with or without Pueblo depending) and the contents and exits as appropriate and set the @htdesc and &html_desc both HTML for the purposes of rendering appropriately. >.<

It works, but it certainly is crude and means that for every thing I want to have HTML I have to have both an HTML and a non HTML version that the game calls on, depending on the player's flag.

I never even got a /response/ from the TinyMUSH Support list on this one, so clearly they deign it beneath their notice or assistance...
[Go to top] 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.


6,220 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]