Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 1:50 am   

#MXP Question
 
After like 5 hours of trying to explain something to someone earlier, it was asked how to make something blink. As far as I know there isn't a tag in MXP to allow this is there? I'm curious why not? I realize that blink is out the window when it comes to HTML and such due to accessibility. However, sometimes maybe you want to have something blink? I've pretty much quit using ANSI period due to it's limitations, but then here comes blink and boom only ANSI can do it...?

While I am on this topic, I went back and was reading the old MXP references. I noticed that MUDS can define their own tags. Is it possible for the user to define their own tags sort of like their own CSS stylesheet? I think that would be pretty awesome if I had more power to define how I want my text to be displayed. The current open tags are great, don't get me wrong. It's just if I wanted to create my own that I use often like the MUD can that would be even better. For instance, I normally color text with a white foreground and blue background for information messages. If I could make my own tag just to do this like <Info>, that would be awesome.

If I can do this already, then I apologize, but it is totally unclear on how it would be accomplished by reading the manual.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Apr 21, 2008 2:22 am   
 
The #MXP command has a hidden parameter before the text. If you use "#MXP 1 {stuff}" then that parameter kicks in and 1 is used for the mode. You should also be able to do "#MXP 6" to set mode 6, which I think is the locked secure mode; then use "#MXP 0" to release it.

If you use that with an onLoad event then you can define all the elements you want and have them available every time.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Apr 21, 2008 2:55 am   
 
Viji's right about using the #mxp command to define your own elements - there're a couple of threads that mention being able to do it, though I never have myself.

And I thought the exact same thing about blink as you did, presumably in the exact same thread. But then again, I don't reckon it's all that annoying to use ANSI for it, if (like me) that's the only time you do use ANSI.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 2:59 am   
 
I have no idea how that would allow me to create my own tags. Doesn't the mode just tag the line sent from the mud?

I'm reading this page http://www.zuggsoft.com/zmud/mxp.htm.

1 is secure mode

0 is open mode

6 is lock secure mode

So how would I define my own tag like instead of <color white blue>text</color> for my own information message I could create a tag called <IM>text</IM> for a shortcut. I also see on that page where you can get text to blink with MXP?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Apr 21, 2008 3:07 am   
 
From that same page, oldguy2:

Quote:
Elements

<!ELEMENT> <!EL>
<!ELEMENT element-name [definition] [ATT=attribute-list] [TAG=tag] [FLAG=flags] [OPEN] [DELETE] [EMPTY]>

Used to define a new element (user-defined tag). The name of the tag is specified. To specify a Command element with empty content (such as a simple command tag), add the keyword EMPTY after the name of the tag. For example:

<!EL Command EMPTY>

specifies a tag called <Command> which does not require a closing </Command> since it has no content.

The 'Definition' is the optional macro expansion for this element. You can use a list of any text or other MXP commands in this definition. For example, to create a new element called "RED" which colors text red and makes it bold, you would define it as:

<!ELEMENT red '<COLOR red><B>'>

And then you could use it in your MUD output like this:

<red>This text is bold and red</red>

The 'Attribute-list' allows you to define arguments or attributes for your element. You can optionally specify the attributes using the <!ATTLIST> MXP command described later, or you can include them in the <!ELEMENT> definition for simplicity. To create an element that would allow you to change the text color, but would default to red, you would do:

<!ELEMENT boldtext '<COLOR &col;><B>' ATT='col=red'>

Then you could use it on the MUD like this:

<boldtext>This is bold red</boldtext>
<boldtext col=blue>This is bold blue text</boldtext>
<boldtext blue>This is also bold blue text</boldtext>

Note that you use an attribute in the element definition by referring to it as an entity. In this case, the temporary entity &col; refers to the color attribute that is passed. The 'col=red' defines the attribute, and gives the default value of 'red'. When the new element is used, the name of the attribute can be omitted if you give the arguments in the same order as the definition. That is how the third example is able to work.

The TAG=tag argument allows you to associate an element with a user-defined line tag. This is explained more in a later section.

The FLAG=flags argument allows you to assign an internal action to the element. This is explained more in a later section.

The OPEN argument sets the defined element to be an "Open" element. By default, elements are created as "Secure" elements.

The DELETE argument allows you to delete an element previously defined.

Security Note: Elements are marked as to whether they are created by the MUD or created interactively by the user. The user cannot override Secure elements sent from the MUD. The user is only allowed to override Open elements sent from the MUD.


Charneus
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 3:15 am   
 
Yes I know that.

That's a sucky explanation of how a user can create their own tags client side...

So I do what?

#MXP 1 {<!ELEMENT red '<COLOR red><B>'>}

Then put that in an onLoad event?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Apr 21, 2008 3:19 am   
 
That's because it's not really meant for client-side implementation. Your command there should be exactly what you want - you don't want to lock secure mode in case the MUD (or someone on your MUD whose chat channels don't eat MXP properly) starts sending naughty tags.

You could actually just define an MXP trigger for the tag, too. In fact, you could probably write your own blink tag with an mxp trigger. Before you ask how you'd go about doing that, I don't quite know. If I decide to have a play around with it at some point and come up with something, I'll let you know.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 3:22 am   
 
The only problem is it isn't working. The MUDS I play don't even use MXP. I just use it on my side, which is what I am trying to do here and create my own tags, even one that blinks!

I don't see why it would be a problem to make this much easier to do client side.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 3:42 am   
 
Well mine work, but this one doesn't work at all.

<!ELEMENT ImmChan '<FONT COLOR=Red,Blink>'>

That's the example in the reference.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Apr 21, 2008 3:52 am   
 
Haha! This is pretty awesome. Now if I could figure out how to get blink to work.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Apr 22, 2008 1:54 am   
 
Ok apparently I am an idiot or something. I'm trying to create my own blink tag. However, the example from the reference doesn't work. Neither has anything I have tried so far. It is probably something easy I am overlooking.

I must figure it out now that I started or I will just flip out. lol Come on anyone have an idea how to do it?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Tue Apr 22, 2008 3:37 am   
 
Well, I've looked too.
Admittedly probably not as thoroughly as you; and haven't been able to get it to work either.

I cannot get it to work in Zmud either.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Apr 22, 2008 4:08 am   
 
As far as I'm aware, there isn't and never has been a blink option. I've never been able to get blink to work via MXP, ever, and I'm guessing that it's just a problem with the help files. Zugg can probably shed more light on it (as well as whether or not blinking MXP will ever be added). In the meantime, you could try an MXP trigger that puts %ansi(blink) after its opening tag and %ansi(none) after its closing tag. It wouldn't work perfectly (if you used it like this: <color red><blink>haddock</blink>cheese</color> then cheese would come out in the default colour) but it'd work for most purposes.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net