mIRC Homepage

escape character

Posted By: Maelish

escape character - 09/01/13 08:51 PM

If I do something like this:


on *:FILESENT:*.*:/msg #channel I sent the file to $nick.

It'll drop $nick because there is a period. I know that I have to remove the period. However, is there an escape character I can put there so the period would show up?
Posted By: KindOne

Re: escape character - 09/01/13 09:35 PM

on *:FILESENT:*.*:msg #channel I sent the file to $nick $+ .

You don't need to use "/" inside of scripts.
If this is for multiple channels might want to look into using "$chan" instead of "#channel".

/help $+

Shows "Hello":
//echo -ag H $+ e $+ l $+ l $+ o 

Show your main nick:
//echo -ag My name is $mnick $+ . 

Posted By: Maelish

Re: escape character - 25/08/17 02:07 PM

It's been a long time since I've looked at this. It's my fault for not being clear. So let's ask this again but a different way.

The goal is to have use color codes or bold in statements similar to those below. I've noticed however that when using them, it seems to break things.

The first line has no control characters. The second have bold wrapped around them.
say test $$1, text
say test $$1, text
say test $$1 , text
say test $$1 $+ $chr(44) text

Produces this:
test username, text
test $$1, text
test $$1 , text
test $$1, text

Usually you'd use an escape sequence in most scripting languages, like the `\` in php. Is there an escape character or escape sequence for mirc scripting? If not, how would you get around that little irritation?
Posted By: maroon

Re: escape character - 25/08/17 04:06 PM

Mirc is very liberal when allowing names of aliases. $nick3 is a valid alias name, so when you touch things to $nick you're either getting blank or getting an identifier warning that you used an invalid warning. If you want to have extraneous stuff touching the name of an alias, there are a few cases like $mircdirtest where test displays along with the display of the pathname, but for the most part if you want to have something touching an identifier/variable/alias/command name, use $+(stuff,$$1,other stuff) to concatenate.

If you want an escape character to have special symbols not treated as such, you can use $chr(124) or for to have the pipe symbol displayed without being something which allows 2 commands on the same line. You can sometimes use $eval() to escape characters like the pipe symbol, but it doesn't always give expected results, and can't escape all characters. i.e. these don't work:

//echo -a $eval( , 1 )
//echo -a $eval($chr(40) #channel,2)

and this works
//echo -a $( ) )
but this doesn't
//echo -a $( ( )

But that's not an escape character in your context where you're wanting to have stuff touching an $identifier or %variable without being interpreted as being part of the name.

//echo -a $( ) )
is not working, it is simply showing the trailing parenthesis past the $( )

© 2021 mIRC Discussion Forums