got another problem, im creating a door with a access the trouble is im having a problem with making a list. im not realy sure how to explain what the problem is, i was in one of my scripting trances and threw it together in a couble minutes without thinking. so im just going to post the script
WARNING: Leagthy
CODE
integer handle;
string NOTECARD_NAME = "access list";
list notecard_line = ["0","1","2","3","4","5","7","8","9"];
integer num_notecard_lines = 0;
key notecard_request = NULL_KEY;
list card_data;
integer
check_card(string name)
{
integer i = llGetInventoryType(name);
return i == INVENTORY_NOTECARD;
}
default
{
state_entry()
{
state init;
}
}
state ready
{
state_entry()
{
llWhisper(0,"Door Unlocked");
llListen(0,"",llGetOwner(),"");
llSetStatus(STATUS_PHANTOM,TRUE);
}
changed(integer change)
{
if (change & (CHANGED_INVENTORY)) // if someone edits the card, reset the script
{
llResetScript();
}
}
listen(integer channel, string name, key id, string message)
{
if(message == "main door")
{
llDialog(id, "Laser Door", ["Lock", "End"], -1000);
handle = llListen(-1000, "", llGetObjectName(), "");
llListen(-1000, "", llGetObjectName(), "");
}
if(message == "Lock")
{
llListenRemove(handle);
state locked;
}
if((message == "End"))
{
llListenRemove(handle);
llSay(0, "Entering Default Mode");
state default;
}
}
}
state init
{
state_entry()
{
if (!check_card(NOTECARD_NAME))
{
state error;
}
llSetText("initialising...", <1, 1, 1>, 0);
notecard_request = NULL_KEY;
notecard_line = 0;
num_notecard_lines = 0;
notecard_request = llGetNumberOfNotecardLines(NOTECARD_NAME);
llSetTimerEvent(5.0);
}
timer()
{
llSetTimerEvent(0.0);
state error;
}
dataserver(key query_id, string data)
{
if (query_id == notecard_request)
{
llSetTimerEvent(0.0);
if (data == EOF)
{
state ready;
}
else if (num_notecard_lines == 0)
{
num_notecard_lines = (integer)data;
notecard_request = llGetNotecardLine(NOTECARD_NAME, notecard_line);
}
else
{
if (data != "" && llGetSubString(data, 0, 0) != "#")
{
card_data = (card_data = []) + card_data + data;
}
++notecard_line;
notecard_request = llGetNotecardLine(NOTECARD_NAME, notecard_line);
}
}
llWhisper(0,"read " + (string)(notecard_line) + " of " + (string)num_notecard_lines + " lines", <1, 1, 1>, 1);
}
state_exit()
{
llSetText("", <0, 0, 0>, 0);
}
}
state locked
{
state_entry()
{
llListen(0,"",llGetOwner(),"");
llWhisper(0,"Door Locked, Only Peaple on Access List Can Pass");
llSetStatus(STATUS_PHANTOM,FALSE);
llSetTextureAnim(ANIM_ON|LOOP|SMOOTH,ALL_SIDES,1,1,0,1,0.4);
}
changed(integer change)
{
if (change & (CHANGED_INVENTORY)) // if someone edits the card, reset the script
{
llResetScript();
}
}
listen(integer channel, string name, key id, string message)
{
if(message == "main door")
{
llDialog(id, "Laser Door", ["Open", "End"], -1000);
handle = llListen(-1000, "", llGetObjectName(), "");
llListen(-1000, "", llGetObjectName(), "");
}
if(message == "Open")
{
llListenRemove(handle);
state default;
}
if((message == "End"))
{
llListenRemove(handle);
llSay(0, "Entering Default Mode");
state default;
}
}
collision(integer total_number)
{
if(~llListFindList(access_list, (list)llDetectedName(0))) // create a list using what was on the notecard
{
llSetStatus(STATUS_PHANTOM,TRUE);
llSleep(3);
llSetStatus(STATUS_PHANTOM,FALSE);
}
else
{
llSay(0, "Locked: only owner can pass");
llSleep(4);
}
}
}
state error
{
state_entry()
{
llOwnerSay("something went wrong; try checking that the notecard [ " + NOTECARD_NAME + " ] exists and contains data");
}
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
llResetScript();
}
}
}
, but I do have a couple of questions about this part: