Forums » Bugs

Using %target% with prompt command

Mar 20, 2011 meridian link
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
Mar 20, 2011 PaKettle link
alias wannachat "prompt ' /msg %target% ' "

I think....
Mar 21, 2011 meridian link
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"
Mar 21, 2011 raybondo link
Yeah, that's a dumb limitation of our command parser that was written like 10 years ago.