|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: 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. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: 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? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Wed Mar 04, 2015 4:42 pm |
Arghh, so simple. Thank you very much!
|
|
|
|
|
|