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
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sun Feb 09, 2003 4:42 am   

coloring variable lists
 
okay i was attempting group same colored items together in a variable array, however i am having trouble setting all the items listed in the variable to a color

Shalimar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 09, 2003 1:12 pm   
 
Please give an example.

What do you mean by setting all the items listed in the variable to a color? Do you want to add ANSI color codes to each item in the list?

Kjata
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sun Feb 09, 2003 8:07 pm   
 
i want all items in the list to have the same color trigger, i was hoping to save space by putting say all my ranger friends into @ranger, and whenever a member of @ranger shows up i want it to be colored green, is there a way to set the variable to the color, or do i need to do each name individually?

Shalimar
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 09, 2003 9:00 pm   
 
#TR {{@ranger}} {#CW green}

LightBulb
Advanced Member
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sun Feb 09, 2003 9:38 pm   
 
thanks lightbulb, that works great on the main window, will i need to make another copy of the trigger for a child window though? it doesnt seem to pick up on it there

Shalimar
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 09, 2003 11:26 pm   
 
quote:

thanks lightbulb, that works great on the main window, will i need to make another copy of the trigger for a child window though? it doesnt seem to pick up on it there

Shalimar



Depends on how you are sending it to the other window. If you are using #window or :window:, you probably are capturing the person's name in one of the system variables %1...%99. You can send this to the child window already colored by immediately preceding it with an %ansi() function (as in %ansi(green)%1), though it won't cover the situation where you have triggers in the child window that sub this text.

li'l shmoe of Dragon's Gate MUD
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Sun Feb 09, 2003 11:29 pm   
 
i already have a trigger to colorize names thanks to lightbulb, the childwindow is using #win, is there a way to have the child window and the main window within the scope of the trigger?

Shalimar

AIM: shalimarwildcat
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 09, 2003 11:56 pm   
 
Yes, you'll need another copy of the trigger for each child window. Each window has its own settings and needs its own settings file if you are going to save the settings for child windows. However, for one trigger it's probably simpler to just use an "atconnect" alias in the main window to remake the trigger each time you connect. In order to work properly, the child window will also need a copy of the variable, unless it's a global variable (#GVAR).
#AL atconnect {#CAP child;:child:#TR {{@ranger}} {#CW green};#FORALL @ranger {:child:#ADDITEM ranger {%i}};#DELITEM ranger %i}
NOTE: The #CAP is to ensure the window is open before sending commands to it. The #DELITEM is because, in testing, the child-window variable always had %i as the last item.
The child variable will be current at connect. If you add or remove names later, you'll need to add/remove them to the child variable also.
#AL addranger {#ADDI ranger %1;:child:#ADDI ranger %1}
#AL delranger {#DELI ranger %1;:child:#DELI ranger %1}

LightBulb
Advanced Member
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4715
Location: Pensacola, FL, USA

PostPosted: Mon Feb 10, 2003 12:47 am   
 
i was afraid of that, thanks for the answer

Shalimar

AIM: shalimarwildcat
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