 |
swooster Newbie
Joined: 19 Jun 2002 Posts: 3 Location: USA
|
Posted: Fri Jun 21, 2002 2:02 pm
Expanding a variable non-recursively |
I'm trying to make an alias that will add a string to the status... my current code is:
#if (%len( @SystemStatusDefinition)) {
#var SystemStatusDefinition {@{SystemStatusDefinition}"~ ~ ~ ~ %1"}
} {
#var SystemStatusDefinition %1
}
#status @SystemStatusDefinition
My problem is, when it expands @SystemStatusDefinition, it expands any references to variables inside it... This means my status ends up getting set to "AltCmd: sneak CurrentVictim: Bob LockpickCountdown: @lpcount", so if I change my current victim, the status doesn't reflect that change (but the last item, such as the lockpick timer, works fine). Is there any way to get at the contents of @SystemStatusDefinition without expanding what's inside of it? Thanks.
-Swooster |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jun 21, 2002 3:15 pm |
You can use %expand to limit variable expansion.
It might be better to make your #STATUS command directly though. As it is, your status line should only change when @SystemStatusDefinition changes.
LightBulb
Senior Member |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Sat Jun 22, 2002 12:35 am |
First lets simplify. A space or four at the end of the status line will be invisible. So we will put spaces on at the end of each addittion and skip the IF.
#AL StAdd {SystemStatusDefinition=%concat(%expand(@SystemStatusDefinition,1),"%1 ")}
#AL StClear {SystemStatusDefinition=""}
Next simplification is that the status line only has to be defined once and then will update itself. |
|
|
 |
|
|