Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Invalid key passed to IM?

Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
07-17-2008 23:01
Trying to avoid using SHOUT but only the owner im is working. the detectkey one is posting a an error stating Invalid Key Passed to Instant Message. Below is a clip of the code. Any clue?

CODE

if(gMyTRequest==id)
{
integer i;
list lbody=llParseString2List(body,["\n"],[]);
integer count=llGetListLength(lbody);
//This turns newline characters char(10) into new lines in chat
//These are Unix/LSL style end of lines, use \r\n in place of \n for
// Windows style end of line from web server.
for(i=0;i<count;i++)
{
// llOwnerSay(llList2String(lbody,i));

llInstantMessage(llDetectedKey(0),llList2String(lbody,i));
llInstantMessage(llGetOwner(),llList2String(lbody,i));

//llShout(0,llList2String(lbody,i));
//llSay(0,llList2String(lbody,i));
}
}
Talon Brown
Slacker Punk
Join date: 17 May 2006
Posts: 352
07-17-2008 23:08
It would help if you indicated which event that code is in. From the wiki: The llDetected* functions will only return a meaningful value in the collision(), collision_start(), collision_end(), sensor(), touch(), touch_start(), or touch_end() events.
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
07-18-2008 06:31
From: Talon Brown
It would help if you indicated which event that code is in. From the wiki: The llDetected* functions will only return a meaningful value in the collision(), collision_start(), collision_end(), sensor(), touch(), touch_start(), or touch_end() events.



Hi Talon, my bad. its in http_response

I do get it in touch_start and that works. Am I out of luck if I need it in the http_response??

Thanks
Cheree Bury
ChereeMotion Owner
Join date: 6 Jun 2007
Posts: 666
07-18-2008 06:52
From: Nichiren Dinzeo
Hi Talon, my bad. its in http_response

I do get it in touch_start and that works. Am I out of luck if I need it in the http_response??

Thanks


I'm pretty sure that llDetectedKey will return NULL_KEY inside http_response. How about storing the last toucher's key in a global variable and using that?
Nichiren Dinzeo
Registered User
Join date: 14 Feb 2007
Posts: 203
07-18-2008 07:10
From: Cheree Bury
I'm pretty sure that llDetectedKey will return NULL_KEY inside http_response. How about storing the last toucher's key in a global variable and using that?


That did it!! Thanks