|
kellie Heron
Registered User
Join date: 13 Apr 2007
Posts: 5
|
05-18-2007 18:31
Does llInstantMessage() fail when the message text contains \n characters?
I tried to write a script using this, but the IM is not delivered. I checked the key using llKey2Name and it's my key... I tested the string using llOwnerSay and it displayed it fine... So I can only think it's a problem with llInstantMessage... Does anyone know?
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
05-18-2007 18:47
From the wiki: From: llInstantMessage Note: If message exceeds 1023 bytes (excluding null), it will be truncated. String length can be determined with llStringLength. For a multi-line message, use new lines: "This is on one line.\nThis is on another line." However, bear in mind that this will display as a single line if the chat history window is closed, but will show up appropriately if it's open.
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
05-18-2007 18:51
I'm testing llInstantMessage now sending something to myself and I'm getting no response back, whether I use \n or not. Seems like a bug, or a current issue. According to stats, the sim I'm in is in near-perfect health.
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
05-18-2007 19:04
Whatever the hiccup was, it seems to be working again now at least for me. It was failing after every save and re-run, then I happened to get an asset error once, but after that it had no problems. default { state_entry() { llSay(0, "Hello, Avatar!"); }
touch_start(integer total_number) { key avatar = llGetOwner(); llOwnerSay("Owner Say"); llWhisper(0, "Whisper"); llSay(0, "Say"); llInstantMessage(avatar, "Single line IM"); llInstantMessage(avatar, "Multi line IM\nMulti-line IM"); } }
|
|
kellie Heron
Registered User
Join date: 13 Apr 2007
Posts: 5
|
05-18-2007 19:06
I just tried it again though, didn't change the llInstantMessage call at all, just changed my string concatenation to add \\n instead of \n, and the IM came through.
Soooo... Something tells me the function just refuses to work with \n chars.
Weird tho! I tried it with a manually constructed string, and it worked O.o
|
|
kellie Heron
Registered User
Join date: 13 Apr 2007
Posts: 5
|
05-18-2007 19:27
Bah... fixed it. Put some extra checks and processing into the string concatenator... There must have been some extra trailing newlines or something freaking the llInstantMessage function out (Although llOwnerSay was fine with them O.o).
|