PtokaX forum

Archive => Archived 5.1 boards => HOW-TO's => Topic started by: TTB on 07 February, 2008, 10:31:42

Title: Escaping
Post by: TTB on 07 February, 2008, 10:31:42
Hey,

I've some little client scripting. I created a #say command, which allows certain ppl to talk with the client. I've a problem: When users use the | character, the hub detects this as the end of a command<INPUT> #say Test1|Test2|Test3
<OUTPUT> Test1

I'm using now this to escape this:info = string.gsub(info, "%|", " ")My question: Is there a way to make it a | character without ending the command? I tried with:info = string.gsub(info, "%|", "\|")but doesn't work. Any other ideas?

Title: Re: Escaping
Post by: PPK on 07 February, 2008, 15:53:17
You can escape pipe in two ways.
First is original dc protocol way, escaping | with /%DCN124%/
Second is DC++ way, escaping | with &#124;
Title: Re: Escaping
Post by: TTB on 07 February, 2008, 16:59:31
Thank you PPK. Going to try!

After the try's:
info = string.gsub(info, "%|", "&#124;")     -- works