Jump to content

strange list errors


Alishen
 Share

You are about to reply to a thread that has been inactive for 1437 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

So i know how to use list, this has always  worked in  the past for me.

 touch_start(integer total_number)
 {
 list stuff = llParseString2List((string)llGetObjectDesc(),[":"], []);
 who = llDetectedKey(0); 
 vector pos = llDetectedTouchST(0);
 integer link = llDetectedLinkNumber(0);
 Pos = ((llFloor((pos.x*1)*x)/1)*(integer)y)+llCeil(pos.y*y);   
 {
 if(link == 5){
 if(~llListFindList(player, [who]))
 {
// do somthing
 llSay(0,"do something");
 }else{
 llSay(0,"this is the list key residing in the player list - "+llDumpList2String(player,","));
 llSay(0,"this is the the clickers key, we looking for - "+(string)who);
 }
 }
 }

 

my uid key is added to the list after a payment, the list is player as you see in the llDumpList2String(player,","));

 

I should get  llSay(0,"do something"), as my key is clearly in the list, also I tried it with 

 if(llListFindList(player, [who]) == -1)
 {

// key not in list

 llSay(0,"this is the list key residing in the player list - "+llDumpList2String(player,","));
 llSay(0,"this is the the clickers key, we looking for - "+(string)who);

 

also I make the key a string and trimmed it for white spaces before placing in the list feeling that might be it, but still no.
 }else{

//key in list
// do somthing
 llSay(0,"do something");
 }

every time I run the function it can not find the key in the list, but as you see in my debug message my key is in the list and my key is the clicker..

[05:41] Alishen - Cho-han Game: this is the list key residing in the player list - 69282ae3-173d-414b-959a-8ca337a17d17
[05:41] Alishen - Cho-han Game: this is the the clickers key, we looking for - 69282ae3-173d-414b-959a-8ca337a17d17

Edited by Alishen
Link to comment
Share on other sites

15 hours ago, Alishen said:

 list stuff = llParseString2List((string)llGetObjectDesc(),[":"], []);
 who = llDetectedKey(0); 
...
 if(~llListFindList(player, [who]))

Your problem is a type mismatch.

default
{
    state_entry()
    {
        list stuff  = ["779e1d56-5500-4e22-940a-cd7b5adddbe0"];
        key who     =  "779e1d56-5500-4e22-940a-cd7b5adddbe0";

        llOwnerSay( (string)llListFindList(stuff, [who]) );
    }
}

This script will return -1 (not found). Why? Because the list contains a string, and who contains a key.

They may look the same, but they aren't the same.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1437 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...