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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
anylo
Beginner


Joined: 21 Feb 2001
Posts: 28
Location: Finland

PostPosted: Wed Jun 29, 2005 9:54 am   

Suggestion: %ansi(#FF0AEA)
 
Implement %ansi() function to accept RGB code, pretty please.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Jun 30, 2005 9:01 am   
 
RGB codes can be done with #CW, #COLOR, #MXP, and within mxp tags. The %ansi function is just for producing ansi color codes, I don't expect this will change.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
anylo
Beginner


Joined: 21 Feb 2001
Posts: 28
Location: Finland

PostPosted: Thu Jun 30, 2005 9:12 am   
 
Those commands don't work with #SUB etc.

Anyway, %ansi accepting RGB code is only "nice to have" feature.
Reply with quote
Thinjon100
Apprentice


Joined: 12 Jul 2004
Posts: 190
Location: Canada

PostPosted: Thu Jun 30, 2005 9:01 pm   
 
RGB colors WILL work with #PCOL though, which is easy simple to combine with #SUB lines to insert colored text.
_________________
If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :)
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jul 01, 2005 12:53 am   
 
Also take a look at the %color function. It accepts both #RRGGBB color syntax as well as standard web color names (gold, pink, etc)
Reply with quote
anylo
Beginner


Joined: 21 Feb 2001
Posts: 28
Location: Finland

PostPosted: Tue Jul 05, 2005 6:31 am   
 
Here's example code where I would like to replace colors with RGB values.

Code:

#CLASS {Inform}
#TRIGGER {^* is in excellent shape.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#~#, %ansi( bold, green)~#~#, %ansi( bold, blue)~#~#, %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is in a good shape.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#~#, %ansi( bold, green)~#~#, %ansi( bold, blue)~#, %repeat( " ", 1), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is slightly hurt.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#~#, %ansi( bold, green)~#~#, %repeat( " ", 2), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is noticeably hurt.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#~#, %ansi( bold, green)~#, %repeat( " ", 3), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is not in a good shape.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#~#, %repeat( " ", 4), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is in bad shape.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %ansi( bold, yellow)~#, %repeat( " ", 5), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is in very bad shape.$} {#SUB %concat( ~[, %ansi( bold, red)~#~#, %repeat( " ", 6), %ansi( green)~], " ", %ansi( green)%line)}
#TRIGGER {^* is near death.$} {#SUB %concat( ~[, %ansi( bold, red)~#, %repeat( " ", 7), %ansi( green)~], " ", %ansi( green)%line)}
#CLASS 0


How do I do that?
Reply with quote
Thinjon100
Apprentice


Joined: 12 Jul 2004
Posts: 190
Location: Canada

PostPosted: Tue Jul 05, 2005 7:10 am   
 
You might try this... you can adjust the coloring in the colorindicator alias to suit your tastes

Code:

#CLASS {Inform}
#ALIAS colorindicator {#PCOL {$FFFFFF} 0 0;#PCOL {$FF0000} 1 1;#PCOL {$FF8000} 2 2;#PCOL {$FFFF00} 3 3;#PCOL {$80FF00} 4 4;#PCOL {$00FF00} 5 5;#PCOL {$00FFFF} 6 6;#PCOL {$0080FF} 7 7;#PCOL {$0000FF} 8 8;#PCOL {$FFFFFF} 9 9}
#TRIGGER {^(*) is in excellent shape.$} {#COL green;#PSUB {%concat("~[~#~#~#~#~#~#~#~#~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is in a good shape.$} {#COL green;#PSUB {%concat("~[~#~#~#~#~#~#~# ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is slightly hurt.$} {#COL green;#PSUB {%concat("~[~#~#~#~#~#~#  ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is noticeably hurt.$} {#COL green;#PSUB {%concat("~[~#~#~#~#~#   ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is not in a good shape.$} {#COL green;#PSUB {%concat("~[~#~#~#~#    ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is in bad shape.$} {#COL green;#PSUB {%concat("~[~#~#~#     ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is in very bad shape.$} {#COL green;#PSUB {%concat("~[~#~#      ~] ",%1)} %x1;colorindicator}
#TRIGGER {^(*) is near death.$} {#COL green;#PSUB {%concat("~[~#       ~] ",%1)} %x1;colorindicator}
#CLASS 0


Since the spaces won't show color, it doesn't hurt to use one alias to color the entire colored section... you just won't see the colors with the # signs missing. I expanded upon your original 4-color scale with 8 HTML colors for a smoother gradient, and I made the brackets white (my personal preference).
Reply with quote
anylo
Beginner


Joined: 21 Feb 2001
Posts: 28
Location: Finland

PostPosted: Tue Jul 05, 2005 7:21 am   
 
Thanks mate, looked great.
Reply with quote
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Tue Jul 05, 2005 2:06 pm   
 
I'm gonna hop in on the ansi discussion to ask:

How do you send a reset? To tell clear all ansi vars, like at the end of an ansified bit?
_________________
Barry
Gaidin @ 3k.org
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 05, 2005 10:36 pm   
 
Doing %ansi("reset") should work if I remember the source code correctly. Or, sending

%e[0m

is also the ANSI reset code sequence.
Reply with quote
GaidinBDJ
Wanderer


Joined: 15 Nov 2002
Posts: 52
Location: Las Vegas, Nevada

PostPosted: Tue Jul 05, 2005 10:41 pm   
 
Danke. Might wanna stick something in the ansi code list for that.
_________________
Barry
Gaidin @ 3k.org
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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