renegad3 wrote:working on a small script to output text to an irc channel with eggdrop.
Is it possible to force the output to contain the \ as a character as opposed to it prefixing an actual code, such as a color code?
I would like the output to appear as: /!\ some other text follows
Thanks for any help, btw, I did try searching, but couldnt find any pointers.
The problem is that character is a "literal" escape, "". It has special meaning in it's \ form. So what you can do is use the power of substitution and double-quotes to your advantage. The hexadecimal character code for \ is 5c. So doing something like this, makes it no longer a special character causing issues, and using it with double-quotes allows it to return to the character it represents through substitution.
This is how everyone will suggest doing it, like willyw's advice above. But not knowing tcl syntax, it's golden rules, and what an escape can cause. Using this can/will lead to several issues.
Code: Select all
putserv "privmsg #channel : /!\\ some other text follows "
Using substitution to your advantage, yields the code below.
Code: Select all
putserv "privmsg #channel : /!\x5c some other text follows "
The beauty of doing this, is that you no longer need to care what your escape may influence. Wherever you would normally use "" within your double-quotes, instead use "\x5c" and it solves the problem. The same can be done for any problem characters, and this also solves matching issues.
The code below, adds underlines around your triangle, which will give it the bottom it lacks. Try the code below.
Code: Select all
putserv "privmsg #channel :\037/!\x5c\037 some other text follows "