PtokaX forum

Development Section => LUA & PtokaX-Scripting-Interface => Topic started by: ruspant on 29 April, 2005, 21:24:30

Title: Sending pipe char inside a message
Post by: ruspant on 29 April, 2005, 21:24:30
I have an ascii text file which contains a list of emot.
Most of them contains  |  (pipe) char.
If I use this file with Ptokax text support, the main chat "explodes" and the message is splitted.
Obviously pipe chars are seen as message delimiters.
Is there a way to format the message in order to be seen correctly in main chat ?
thx
Title:
Post by: ruspant on 29 April, 2005, 21:40:27
Just found a solution.

replace pipe char ( | )

with the sequence

   |

which is interpreted as a pipechar by chat window.

Greetings
Title: Re: Sending pipe char inside a message
Post by: bluebear on 05 March, 2006, 11:43:54
I know im a little late.

A DirectConnect protocol message starts with "$" and ends with "|" therefore thease 2 chars can't be used in a chat message. So your need to escape them like this:

"$" escape too -> "$"
"|" escape too -> "|"

When client receives thease escape codes, it will turn them back into "$" and "|".

And acording to the DC wiki "&" escapes into "&", but it should not be nessesary to escape for chat messages. However "&" must escape in $UserCommand :)