These forums are CLOSED. Please visit the new forums HERE
llSetText from chat; using \n and \" |
|
|
Yingzi Xue
Registered User
Join date: 11 Jun 2008
Posts: 144
|
12-29-2008 19:25
I'm writing a small script to allow me to set hover text on an object, then die the script. It works great, but I've found that if you pass \n or \" from chat text it doesn't work. A different format I'm assuming. I can get around it by using my own identifiers which the script replaces in the string with \n and \". Is there a function to convert chat text to allow these to be passed without the workaround?
|
|
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
|
12-29-2008 19:33
chattext is phrased and displayed differnetly by different clients.
" " changes into " " and linebreak changes into something new each year. try copying a linebreak from chattext and see if it pastes into a script to read and convert it. if not just change "." to ".\n " " works nicely within a string, you just need \" to get it into a scripts string without a listen, not to confuse the compiler. |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
12-29-2008 21:05
This SHOULD do it, but I haven't compiled or tested it so some fixes might be needed.
CODE
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
12-29-2008 23:40
...alternatively....
CODE
/esc _____________________
http://slurl.com/secondlife/Together
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
12-30-2008 02:32
...alternatively.... CODE
/esc True. I assumed backslash would be used as a true escape, meaning it could also escape itself for a literal backslash character. Your code wouldn't do that, but it WOULD strictly satisfy the original stated requirements. |
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
12-30-2008 02:46
True. I assumed backslash would be used as a true escape, meaning it could also escape itself for a literal backslash character. Your code wouldn't do that... Really? Try it ![]() edit: more accurately, you don't need to escape a backslash as it's already escaped by the time it gets to the listen. _____________________
http://slurl.com/secondlife/Together
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
12-30-2008 11:10
Really? Try it ![]() edit: more accurately, you don't need to escape a backslash as it's already escaped by the time it gets to the listen. Yeah. Really. If backslash is being treated as a true escape character, saying "Hello\\nThere" (from CHAT, not from inside a script) shouldn't have a newline in it. It should have a backslash followed by a lower-case N. If the result of THAT were fed back in it would have a newline and no backslashes. But the OP simply asked to be able to put newlines (and quotes) in, which your code certainly allows. |
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-30-2008 11:46
Doing this perfectly cleanly involves something like...
message = llDumpList2String(llParseString2List(message, ["%"], []), "%1" ;message = llDumpList2String(llParseString2List(message, ["\\\\"], []), "%2" ;message = llDumpList2String(llParseString2List(message, ["\\n"], []), "\n" ;message = llDumpList2String(llParseString2List(message, ["\\""], []), "\"" ;message = llDumpList2String(llParseString2List(message, ["%2"], []), "\\\\" ;message = llDumpList2String(llParseString2List(message, ["%1"], []), "%" ;_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/
"And now I'm going to show you something really cool." Skyhook Station - http://xrl.us/skyhook23 Coonspiracy Store - http://xrl.us/coonstore |