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


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jun 28, 2003 3:03 am   

First time Database question
 
First time using a database for zmud. I made one field "name" and I am adding names of thieves to the list. Is there anyway for ZMUD to automatically color those names in the mud if the name appears on screen?
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sat Jun 28, 2003 9:57 am   
 
sure, if you don't mind the processing overload. You have to open the database manually first, and this is assuming 'name' is the first field in the database, and you don't have any duplicates.

#tr {(%w)} {#if (%find(%1)) {#pcol ~#445566 %x1}}

replace 445566 with your favorite RGB color. There are a couple of other color formats, i.e. "~#445566" could be replaced with "red". see the helps for details. also, depending on what version you have, you may or may not need the ~ and you may or may not want to replace the '#' with a '$'
(i think v6.62 expects RGB colors in the form of '$445566', at least according too the command wizard 'more help' entry for #color)
i'll stop now that i've needlessly overcomplicated it
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Fri Jul 11, 2003 4:41 am   
 
quote:
Originally posted by Emit

sure, if you don't mind the processing overload. You have to open the database manually first, and this is assuming 'name' is the first field in the database, and you don't have any duplicates.

#tr {(%w)} {#if (%find(%1)) {#pcol ~#445566 %x1}}

replace 445566 with your favorite RGB color. There are a couple of other color formats, i.e. "~#445566" could be replaced with "red". see the helps for details. also, depending on what version you have, you may or may not need the ~ and you may or may not want to replace the '#' with a '$'
(i think v6.62 expects RGB colors in the form of '$445566', at least according too the command wizard 'more help' entry for #color)
i'll stop now that i've needlessly overcomplicated it




Hmm, I can't get this to work. I have a database called thieves and there is one field called name. I put what you told me to and did not get anything
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jul 11, 2003 11:34 am   
 
The Database is more for storing large records with many fields. For what you are doing you should use a simple list variable.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jul 11, 2003 3:05 pm   
 
To create a list and the trigger to use the list:
#VAR Thieves {%dblist( name)}
#TR {{@Thieves}} {#CW hi,blue}
Of course, you'll have to keep the list up to date by repeating the #VAR command occasionally.

It might be possible to do it directly:
#TR {{%dblist( name)}} {#CW hi,blue}
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