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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Dec 17, 2008 10:31 pm   

CSS in HTML Logging?
 
Can I use CSS inline HTML for HTML logging?

Here's what I want to do:
Code:

<trigger name="Write Tick" priority="2020" id="202">
  <pattern>^Timer now at 41 secs.</pattern>
  <value>#WRITELOG Timer now at 41 secs.</value>
</trigger>


I don't want all of the command or status echoes to be logged, but I do want this one echoed so I figured I'd writelog it. Since I've got color logging I figured I would writelog it the color it is in the program which is a dark orange, however it is simply being written in default gray at the moment. Not sure what I'm doing wrong.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Dec 17, 2008 11:12 pm   
 
My guess would be that because you're not quoting any of the string, some of it's being interpreted before the log is printed. It's also possible that the routine that outputs things to the log sanitises the input first, stopping any tags in your text from being rendered.
_________________
Rorso's syntax colouriser.

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


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Dec 17, 2008 11:18 pm   
 
So I should put quotes around the whole thing?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Dec 17, 2008 11:25 pm   
 
I have no idea if that'll work or not and neither, I suspect, does anyone else - using HTML logging in this way hasn't been talked about any more. It was just a suggestion - try things out and see if something works.
_________________
Rorso's syntax colouriser.

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


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Wed Dec 17, 2008 11:29 pm   
 
Nope, didn't work either. I guess I'll play with it more later.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Dwoggurd
Wanderer


Joined: 29 Jan 2008
Posts: 63

PostPosted: Thu Dec 18, 2008 12:27 am   
 
Show the resulting html tag in your log for your tick message?
It should look like <span style="color:#xxxxxx;">
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Dec 18, 2008 6:28 am   
 
Code:

<html><head><title></title>
</head>
<body bgcolor="#000000" leftmargin=2 topmargin=0 rightmargin=2 bottommargin=2>
<font size=2 color="#c0c0c0" face="Courier New">
<div>> <font color="#ffffff">2:00am</font> | <font color="#ffffff">1526</font>/<font color="#ffffff">1526</font><font color="#ff0000">hp</font> | <font color="#ffffff">712</font>/<font color="#ffffff">712</font><font color="#0000ff">mn</font> | <font color="#ffffff">401</font>/<font color="#ffffff">406</font><font color=>mv</font></div>

<div><br></div>
<div>Tick in 5 seconds.</div>
<div>You go to sleep on a sleeping pad.</div>
<div><br></div>
<div><br></div>
<div>> <font color="#ffffff">2:00am</font> | <font color="#ffffff">1526</font>/<font color="#ffffff">1526</font><font color="#ff0000">hp</font> | <font color="#ffffff">712</font>/<font color="#ffffff">712</font><font color="#0000ff">mn</font> | <font color="#ffffff">401</font>/<font color="#ffffff">406</font><font color=>mv</font></div>

<div><br></div>
<div><br></div>
<div><br></div>
<div>The detect magic wears off.</div>
<div><br></div>
<div>Timer now at 41 secs.</div>
<div><br></div>
<div>> <font color="#ffffff">2:00am</font> | <font color="#ffffff">1526</font>/<font color="#ffffff">1526</font><font color="#ff0000">hp</font> | <font color="#ffffff">712</font>/<font color="#ffffff">712</font><font color="#0000ff">mn</font> | <font color="#ffffff">406</font>/<font color="#ffffff">406</font><font color=>mv</font></div>

<div><br></div>
<div>You wake up and rest on a sleeping pad.</div>
<div><br></div>
<div><br></div>
<div>> <font color="#ffffff">2:00am</font> | <font color="#ffffff">1526</font>/<font color="#ffffff">1526</font><font color="#ff0000">hp</font> | <font color="#ffffff">712</font>/<font color="#ffffff">712</font><font color="#0000ff">mn</font> | <font color="#ffffff">406</font>/<font color="#ffffff">406</font><font color=>mv</font></div>

</font>
</body></html>
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Dwoggurd
Wanderer


Joined: 29 Jan 2008
Posts: 63

PostPosted: Thu Dec 18, 2008 7:30 am   
 
I see no special tags for the timer message. By the way, how you got this html code? Is this from some external tool? What CMUD version?
When I tried to set html logging in CMUD 2.37 and looked at the resulting file using "notepad" it had different format, color by <span> and no html headers.

Also, your trigger sets no color, it just does #writelog, so I guess it does what it supposed to do: writes the message without any colors to your log.
How it becomes orange on your screen? Do you have an additional color trigger for it or it's some sort of default color for something? If this is the case, I don't think CMUD can make any connection between that color trigger and your writelog-trigger.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Dec 18, 2008 5:23 pm   
 
Dwoggurd wrote:
I see no special tags for the timer message. By the way, how you got this html code? Is this from some external tool? What CMUD version?
When I tried to set html logging in CMUD 2.37 and looked at the resulting file using "notepad" it had different format, color by <span> and no html headers.


I saved it in .html from the editor and then opened it in CMUD, though I suppose since the editor saw it in default color it would strip any attempt at a tag, I'll have to look at the original html file. This source came from "view source" in Firefox.

Quote:

Also, your trigger sets no color, it just does #writelog, so I guess it does what it supposed to do: writes the message without any colors to your log.
How it becomes orange on your screen? Do you have an additional color trigger for it or it's some sort of default color for something? If this is the case, I don't think CMUD can make any connection between that color trigger and your writelog-trigger.


MY trigger does set color, it sets it in html format, but that's not working. Since I log in HTML I have to put HTML in my writelog for it to work. I've already done it before for something else, but it doesn't seem to like the CSS I have embedded in my HTML tag. Orange is the color I have set for CMUD messages, it's not colored by a trigger. However, anything writelogged will be done in default color unless told otherwise, which I did.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Dec 18, 2008 10:34 pm   
 
The CMUD editor is not a full-featured HTML editor. So don't try to use complex stuff like CSS and expect it to work fully in CMUD. You need to use a *real* HTML editor if you want full CSS support.

The #WRITELOG will write whatever you give it to the log file. If you add CSS, then #WRITELOG will write it. #WRITELOG doesn't care what text you send...it's just directly written to the log file. So my guess is that the problem you are having is with loading the text into the CMUD editor and not with the #WRITELOG command.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Dec 19, 2008 3:57 am   
 
Zugg wrote:
The CMUD editor is not a full-featured HTML editor. So don't try to use complex stuff like CSS and expect it to work fully in CMUD. You need to use a *real* HTML editor if you want full CSS support.

The #WRITELOG will write whatever you give it to the log file. If you add CSS, then #WRITELOG will write it. #WRITELOG doesn't care what text you send...it's just directly written to the log file. So my guess is that the problem you are having is with loading the text into the CMUD editor and not with the #WRITELOG command.


That would certainly make sense. Razz Thanks.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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