Search code examples
scriptingmirc

Does mIRC Scripting have an escape character?


I'm trying to write a simple multi-line Alias that says several predefined strings of characters in mIRC. The problem is that the strings can contain:

  • {
  • }
  • |

which are all used in the scripting language to group sections of code/commands. So I was wondering if there was an escape character I could use.

In lack of that, is there a method, or alternative way to be able to "say" multiple lines of these strings, so that this:

alias test1 {
/msg # samplestring}contains_chars|
/msg # _that|break_continuity}{
}

Outputs this on typing /test1 on a channel:

<MyName> samplestring}contains_chars|
<MyName> _that|break_continuity}{

It doesn't have to use the /msg command specifically, either, as long as the output is the same.

So basically:

  1. Is there an escape character of sorts I can use to differentiate code from a string in mIRC scripting?
  2. Is there a way to tell a script to evaluate all characters in a string as a literal? Think " " quotes in languages like Java.
  3. Is the above even possible using only mIRC scripting?

Solution

  • "In lack of that, is there a method, or alternative way to be able to "say" multiple lines of these strings, so that this:..."

    I think you have to have to use msg # every time when you want to message a channel. Alterativelty you can use the /say command to message the active window.

    Regarding the other 3 questions:

    1. Yes, for example you can use $chr(123) instead of a {, $chr(125) instead of a } and $chr(124) instead of a | (pipe). For a full list of numbers you can go to http://www.atwebresults.com/ascii-codes.php?type=2. The code for a dot is 46 so $chr(46) will represent a dot.
    2. I don't think there is any 'simple' way to do this. To print identifiers as plain text you have to add a ! after the $. For example '$!time' will return the plain text '$time' as $time will return the actual value of $time.
    3. Yes.