Forums » Bugs
Using %target% with prompt command
I've run into a bit of a quandary trying to use %target% with the prompt command. It works okay if there are no spaces in the name of my target, but if there is a space in the name it can be problematic.
This works only for targets without a space in the name:
/prompt 'msg %target%'
This works for targets with spaces and without:
/prompt 'msg "%target%"'
But my real problem is trying to set up an alias because I need a 3rd set of quotes to do the above. Alternating the quotes like this does not work (syntax error):
/alias msg_target 'prompt "msg '%target%'"'
I've also tried using escape characters to get another set of quotes, but I have not found anything that works.
I call this a bug because prompt should be smarter about how it handles the use of %target% when it contains spaces in the name. Sure, I could use a plug-in to accomplish the same thing, but I'd rather use a bind for something simple like this.
NOTE: Using station guards to test the above works great if you want to test it for yourself and need a target to test on
This works only for targets without a space in the name:
/prompt 'msg %target%'
This works for targets with spaces and without:
/prompt 'msg "%target%"'
But my real problem is trying to set up an alias because I need a 3rd set of quotes to do the above. Alternating the quotes like this does not work (syntax error):
/alias msg_target 'prompt "msg '%target%'"'
I've also tried using escape characters to get another set of quotes, but I have not found anything that works.
I call this a bug because prompt should be smarter about how it handles the use of %target% when it contains spaces in the name. Sure, I could use a plug-in to accomplish the same thing, but I'd rather use a bind for something simple like this.
NOTE: Using station guards to test the above works great if you want to test it for yourself and need a target to test on
alias wannachat "prompt ' /msg %target% ' "
I think....
I think....
That only works if your target does not have a space in the name, Pa.
Try that on a station guard and you'll get "*Station is not online"
Try that on a station guard and you'll get "*Station is not online"
Yeah, that's a dumb limitation of our command parser that was written like 10 years ago.