Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

whats the deal?

Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
11-11-2008 16:09
All day I have been working on a script and testing it. Now it seems lsl is not wanting to pick up keys like this for me now. Any one know whats going on with it?

list owners = ["ea7516ac-7e14-4785-b117-3a4706f6292f"];

default
{
state_entry()
{
llListen(1, "", "", "";);
}

listen(integer channel, string name, key id, string message)
{
if(llListFindList(owners, [id]) > -1)
{
llOwnerSay(message);
}
}
}
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
11-11-2008 16:19
Looks like the problem is that you're storing a string not a key in your list. Try casting the string to a key, like this:


list owners = [(key)"ea7516ac-7e14-4785-b117-3a4706f6292f"];
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-11-2008 16:21
i assume you're gonna be adding more keys to the list. but what you could try in the listen event is instead of seeing if it's more than negative 1, check to see if it's not equal to negative 1. IE:

if(llListFindList(owners, [id]) != -1)//if id is not in the list
{;}//leave it empty, or do something here if who it hears is not on the list
else
{
llOwnerSay(message);
}


edit: or what pedro so, but to simplify it, you could do this
leave the list as is, and then:

if(llListFindList(owners, [(string)id]) > -1)

or even check the name instead of the key?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
lol
11-11-2008 16:24
I don't think that will work. For real up to about 30 mins ago it was working fine then poof it will not pick up any keys from the list.

Ruthven Willenov
I tried your 2 ideas still nothing. Kinda weird lol
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
11-11-2008 17:07
Ruthven is right - when you have a listener that checks for agents saying something in chat, you could easily store the agent's names instead of the keys:

CODE


list allowed = ["Jenn Yoshikawa"];
integer listener;
integer chatChannel = 0;

default{

state_entry(){
listener = llListen(chatChannel, "", NULL_KEY, "");
}

listen(integer channel, string name, key id, string message){
// check for name of the agent

string clickerName = llKey2Name(id);

if(llListFindList(allowed, [clickerName]) != -1){
llOwnerSay(message);
}
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
11-11-2008 17:18
Sorry Jenn but they are right, you can not compare a key to a string and one or the other has to be cast to work, and it does work because I just tested in world. Ruthven suggested storing and testing names which I demonstrated in your thread from the other day:

/54/3c/292011/1.html

EDIT Haruki got to it before me!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-11-2008 17:46
if (~llListFindList( allowed, (list)clickerName )){
also works
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Tyken Hightower
Automagical
Join date: 15 Feb 2006
Posts: 472
11-11-2008 22:55
From: Void Singer
if (~llListFindList( allowed, (list)clickerName )){
also works


Using (list) used to have terrible problems in this exact situation, and is probably not a good idea, when you can just use brackets. o.o
_____________________