|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Apr 21, 2007 12:55 am
[1.29] Using :window: to send text containing parenthesis |
Just for a simple tells window.
I've tried a number of things but CMUD always seems to strip the parenthesis
tell = "hello (guinn) 123"
#exec {:Channels: #show @tell}
tell = "hello (guinn) 123"
tell = %quote(@tell)
#exec {:Channels: #show @tell}
tell = "hello (guinn) 123"
#exec {:Channels: #show %quote(@tell)}
I guess I have to use #exec otherwise the variable doesn't exist by the time it's expanded in the channels window?
Anyone with any ideas?
Cheers |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Apr 21, 2007 1:17 am |
tell = "hello (guinn) 123"
#WINDOW Channels {@tell} |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Apr 21, 2007 1:23 am |
that's had odd side effects when I've got the same session opened multiple times. I kept on getting duplicates of the same window name that'd then mess up when one session was closed
Not tried in a couple of versions, will see if it's better lately |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Apr 21, 2007 1:46 am |
Try to think about *exactly* what you are doing. #EXEC expands it's argument as a string before executing it. So, your #EXEC command in your first example converts #SHOW @tell to this:
:Channels: #SHOW hello (guinn) 123
OK, so try just typing this on the command line. Since (guinn) is just an argument being passed to the #SHOW command, the () just cause the #SHOW command to treat this argument as an expression, which strips the quotes. If you were typing this on the command line, you would want to do this:
:Channels:#SHOW {hello (guinn) 123}
so you would want your original #EXEC to be this:
#EXEC {:Channels:#SHOW {@tell}}
This is sort of like the old {%1} issue in zMUD. When you expand something that contains spaces, you need to make sure you have {} around the result so that it still gets treated as a single argument.
Another minor issue: Don't put any space after the : in your :Channels: command.
Since the @tell variable is not accessible from your Channels window (it's local to your main window), the #WINDOW command is the best way to display something in the window, as Nexela mentioned. There shouldn't be any issue with duplicate windows anymore. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Apr 21, 2007 1:57 am |
Oh, and of course we shouldn't forget the fact that you could avoid #EXEC all together by just specifying the full path for the @tell variable:
:Channels:#show @//untitled/tell |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Apr 21, 2007 2:04 am |
It's actually using either a local variable or parts of a trigger match in the real example, I just substituted a normal one for the sake of the example
Thanks for the help though, the {$tell} should work
edit: yep, that seems to have done the trick, and the nasty duplicate windows seem okay too |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
|
|