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
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Sat Sep 03, 2011 1:21 pm   

status window question
 
I searched around but didn't find any answers, so I am guessing the technical answer is "no", but still asking just in case.

Is it possible to use html tags (like <table>) for display purposes inside the status window?

I capture and display a fair amount of prompt info and various other tid bits, but keeping things neat and formatted in the status window can be a bit taxing.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Sep 03, 2011 1:43 pm   
 
I agree that they can. The status window is capable of using MXP tags, which are similar to (but different from) html tags.

I use my status window to display two lists, each in its own column, that are ever-changing. Here is the code that I use to keep it nice and tidy to look at:
Code:
 <var name="STWColumnWidth" type="Integer" id="46">21</var>
<func name="column" id="49">
  <value>#IF (%len(%1)<=@STWColumnWidth) {#RETURN %concat(%repeat(" ",%eval(@STWColumnWidth-%len(%1))),%1)} {#RETURN %concat(%delete(%1,%eval(@STWColumnWidth-1),500),".."))}</value>
</func>

<stat name="Status Window" showinbar="false" showinwindow="true" id="43">
  <value><![CDATA[%if(@CorePulse,,)<font terminal 8><u>%concat(%ansi(cyan,high),%repeat(" ",%eval(@STWColumnWidth-2)),%if(%numitems(@queue)<10," "),%numitems(@queue)," ",</u>,%if(%trigger(queueTick),I,O),<u>,%ansi(magenta,high)," ",%numitems(@loop),%if(%numitems(@queue)<10," "),%repeat(" ",%eval(@STWColumnWidth-4)),</u>)
%ansi(cyan,high) @column(@queue.6) %ansi(magenta,high)%delete(@loop.6,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.5) %ansi(magenta,high)%delete(@loop.5,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.4) %ansi(magenta,high)%delete(@loop.4,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.3) %ansi(magenta,high)%delete(@loop.3,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.2) %ansi(magenta,high)%delete(@loop.2,@STWColumnWidth,500)
<u>%ansi(cyan,high) @column(@queue.1)</u> <u>%ansi(magenta,high)%delete(@loop.1%repeat(" ",@STWColumnWidth),@STWColumnWidth,500)</u>
<font calibri 11> %ansi( green, high) @queueExec
<font calibri 12> %ansi(yellow,high) %repeat(" ",%eval(40-%len(@Stat))) @Stat
]]></value>
</stat>

I'm sure this isn't exactly what you want, but may give you an idea on how to proceed. The variable @STWColumnWidth can be adjusted depending on how wide your status window is set. Notice that the left column uses the @column function to adjust to appropriate width and right-adjust, where the right column only trims down the right column. If you want more columns, you could do it the same way, just use the @column function for each column. To left-justify, change the coding for the @column function so the %repeat is second within the %concat, rather than first as I have it here. That is:
Code:
<func name="column" id="49">
  <value>#IF (%len(%1)<=@STWColumnWidth) {#RETURN %concat(%1,%repeat(" ",%eval(@STWColumnWidth-%len(%1))))} {#RETURN %concat(%delete(%1,%eval(@STWColumnWidth-1),500),".."))}</value>
</func>


I've also read about some plug-in that will help adjust your status window, but I haven't looked into that - someone else might chime in with that suggestion?
_________________
.geniusclown
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Sat Sep 03, 2011 3:04 pm   
 
geniusclown wrote:
I agree that they can. The status window is capable of using MXP tags, which are similar to (but different from) html tags.

I use my status window to display two lists, each in its own column, that are ever-changing. Here is the code that I use to keep it nice and tidy to look at:
Code:
 <var name="STWColumnWidth" type="Integer" id="46">21</var>
<func name="column" id="49">
  <value>#IF (%len(%1)<=@STWColumnWidth) {#RETURN %concat(%repeat(" ",%eval(@STWColumnWidth-%len(%1))),%1)} {#RETURN %concat(%delete(%1,%eval(@STWColumnWidth-1),500),".."))}</value>
</func>

<stat name="Status Window" showinbar="false" showinwindow="true" id="43">
  <value><![CDATA[%if(@CorePulse,,)<font terminal 8><u>%concat(%ansi(cyan,high),%repeat(" ",%eval(@STWColumnWidth-2)),%if(%numitems(@queue)<10," "),%numitems(@queue)," ",</u>,%if(%trigger(queueTick),I,O),<u>,%ansi(magenta,high)," ",%numitems(@loop),%if(%numitems(@queue)<10," "),%repeat(" ",%eval(@STWColumnWidth-4)),</u>)
%ansi(cyan,high) @column(@queue.6) %ansi(magenta,high)%delete(@loop.6,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.5) %ansi(magenta,high)%delete(@loop.5,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.4) %ansi(magenta,high)%delete(@loop.4,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.3) %ansi(magenta,high)%delete(@loop.3,@STWColumnWidth,500)
%ansi(cyan,high) @column(@queue.2) %ansi(magenta,high)%delete(@loop.2,@STWColumnWidth,500)
<u>%ansi(cyan,high) @column(@queue.1)</u> <u>%ansi(magenta,high)%delete(@loop.1%repeat(" ",@STWColumnWidth),@STWColumnWidth,500)</u>
<font calibri 11> %ansi( green, high) @queueExec
<font calibri 12> %ansi(yellow,high) %repeat(" ",%eval(40-%len(@Stat))) @Stat
]]></value>
</stat>

I'm sure this isn't exactly what you want, but may give you an idea on how to proceed. The variable @STWColumnWidth can be adjusted depending on how wide your status window is set. Notice that the left column uses the @column function to adjust to appropriate width and right-adjust, where the right column only trims down the right column. If you want more columns, you could do it the same way, just use the @column function for each column. To left-justify, change the coding for the @column function so the %repeat is second within the %concat, rather than first as I have it here. That is:
Code:
<func name="column" id="49">
  <value>#IF (%len(%1)<=@STWColumnWidth) {#RETURN %concat(%1,%repeat(" ",%eval(@STWColumnWidth-%len(%1))))} {#RETURN %concat(%delete(%1,%eval(@STWColumnWidth-1),500),".."))}</value>
</func>


I've also read about some plug-in that will help adjust your status window, but I haven't looked into that - someone else might chime in with that suggestion?


wow that is so beyond my head. I am still a newb with coding/scripting. granted I can write some things but That is just ...
All I want is a simple formating like this...
Code:
<table>
<tr><td>-----------------------H.U.D.-----------------------</td></tr>
<tr><td><color white>Hit Points:</color> [@hp / @maxhp]</td></tr>
<tr><td>@bar(@hp,@maxhp,50)</td></tr>
<tr><td><color white>Concentration Points:</color> [@cp / @maxcp]</td></tr>
<tr><td>@bar(@cp,@maxcp,50)</td></tr>
<tr><td>----------------------------------------------------</td></tr>
<tr><td>------------------.W.I.M.P.D.I.R.-------------------</td></tr>
<tr><td align=center><color red>%upper(@WimpyDir)</color></td></tr>
<tr><td>----------------------------------------------------</td></tr>
<tr><td>----------------------.E.X.P.-----------------------</td></tr>
<tr><td><color white>Free Exp:</color> [@FreeExp]</td></tr>
<tr><td><color white>Exp Goal:</color> [@GoalExp]</td></tr>
<tr><td><color white>Total Exp:</color> [@TotalExp]</td></tr>
<tr><td>----------------------------------------------------</td></tr>
<tr><td>--------------------.F.U.N.D.S.---------------------</td></tr>
<tr><td><color white>Carried Gold:</color> [@cGold]</td></tr>
<tr><td><color white>Bank Gold:</color> [@bGold]</td></tr>
<tr><td>----------------------------------------------------</td></tr>
<tr><td>--------------.E.N.C.U.M.B.R.A.N.C.E.---------------</td></tr>
<tr><td><color white>Carrying:</color> @strent Strent and @scorcen Scorcen</td></tr>
<tr><td><color white>Max Load:</color> @maxstrent Strent and @maxscorcen Scorcen</td></tr>
<tr><td>----------------------------------------------------</td></tr>
<tr><td>---------------------.B.U.F.F.S.--------------------</td></tr>
<tr><td><color white>Higher Mind :</color> @HigherMind</td></tr>
<tr><td><color white>Invulnerability :</color> @Invulnerability</td></tr>
<tr><td>----------------------------------------------------</td></tr>
</table>


if you would be so kind to write that and explain where to paste the code, i would greatly appreciate it.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Sep 03, 2011 4:34 pm   
 
One column table? That's easy. Use your code, with the following exceptions:

(1) Start by opening your Package Editor (the "Settings" button at the top of CMUD), and create a new Status Bar and put what you want for your Status Window in the Value field. Turn on Status Window under the Tools menu, or simply type "#STW on" from the command line to make it visible.
Alternatively, from the command line, use "#STW {full text, carriage returns allowed;next line needs at least one leading space}" - this is the syntax used in the code below.
You can resize, dock, etc. the status window. You can only have one Status Window, and will display the status setting for the currently focused window (created with the #WIN command). If you create more Status Windows for one window, the text will be appended to the existing Status Window, in order of their priority settings.

(2) <table> <tr> and <td> are not valid. Leave them out completely. The Status Window syntax respects carriage returns. <center> is invalid, and there is no simple substitution.

(3) <color> is not a valid MXP tag, but you can use ansi tags instead. Replace <color white> with %ansi(white). There is no end tag other than a carriage return, so replace </color> with %ansi(cyan,high) to change the color back to the default cyan color.

Here is the adjusted code (copy and paste to your command line):
Code:
#STW {-----------------------H.U.D.-----------------------
 %ansi(white)Hit Points:%ansi(cyan,high) ~[@hp / @maxhp~]
 @bar(@hp,@maxhp,50)
 %color(white)Concentration Points:%ansi(cyan,high) ~[@cp / @maxcp~]
 @bar(@cp,@maxcp,50)
 ----------------------------------------------------
 ------------------.W.I.M.P.D.I.R.-------------------
 %ansi(red,high)%upper(@WimpyDir)
 ----------------------------------------------------
 ----------------------.E.X.P.-----------------------
 %ansi(white)Free Exp:%ansi(cyan,high) [@FreeExp]
 %ansi(white)Exp Goal:%ansi(cyan,high) [@GoalExp]
 %ansi(white)Total Exp:%ansi(cyan,high) [@TotalExp]
 ----------------------------------------------------
 --------------------.F.U.N.D.S.---------------------
 %ansi(white)Carried Gold:%ansi(cyan,high) [@cGold]
 %ansi(white)Bank Gold:%ansi(cyan,high) [@bGold]
 ----------------------------------------------------
 --------------.E.N.C.U.M.B.R.A.N.C.E.---------------
 %ansi(white)Carrying:%ansi(cyan,high) @strent Strent and @scorcen Scorcen
 %ansi(white)Max Load:%ansi(cyan,high) @maxstrent Strent and @maxscorcen Scorcen
 ----------------------------------------------------
 ---------------------.B.U.F.F.S.--------------------
 %ansi(white)Higher Mind :%ansi(cyan,high) @HigherMind
 %ansi(white)Invulnerability :%ansi(cyan,high) @Invulnerability
 ----------------------------------------------------}
_________________
.geniusclown
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 168

PostPosted: Sat Sep 03, 2011 6:55 pm   
 
Thank you so much, that make alot more sense.

given time and more usage my experience might rise high enough to level
from newb to noob.
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