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


Joined: 24 Jul 2005
Posts: 137

PostPosted: Wed Mar 04, 2015 4:45 am   

Using variables in seperate windows.
 
Is it possible to use a variable from my main session in other windows?

I've been trying but it does not read them.
Reply with quote
shalimar
GURU


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

PostPosted: Wed Mar 04, 2015 4:57 am   
 
Yes it is possible.
The easiest method is to create a module to store any variables that will be used in other windows.
Technically you could use the long variable reference syntax... but I always forget how it goes.
_________________
Discord: Shalimarwildcat
Reply with quote
Scarn
Apprentice


Joined: 24 Jul 2005
Posts: 137

PostPosted: Wed Mar 04, 2015 5:58 am   
 
I figured out a way:

From my main window I can:

Code:

#EXEC WindowName:#VAR Name Value


The window in question contains a list of all characters online, I have a script that runs a %replaceitem to colourcode different people, depending what variable they are assigned too - but it is very messy and slow.

My plan is to make this trigger in the window:

Code:

#TRIGGER {@Varaible} {#CW Colour}


But it isn't working :(

Any ideas?
Reply with quote
shalimar
GURU


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

PostPosted: Wed Mar 04, 2015 6:46 am   
 
when using a variable list in a trigger pattern, it needs to be enclosed in its own set of curly braces
#TR {{@VAR}} {#CW color}

By the by, this is the exact reason i use a module in my own play.
I put the trigger in there as well, and then it works in all windows, instead of needing to be repeated in each.
_________________
Discord: Shalimarwildcat
Reply with quote
Scarn
Apprentice


Joined: 24 Jul 2005
Posts: 137

PostPosted: Wed Mar 04, 2015 4:42 pm   
 
Arghh, so simple. Thank you very much!
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