Jump to content

scanner script with dialogue popup, cant figure out how to add an access list


Ryuhei Chiung
 Share

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

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

Recommended Posts

integer switch=0;
key name;

default
{
state_entry()
{
    list access_list = ["aviname","","","","",""];
llWhisper(0,"protcol 5");
name = llGetOwner();
}

touch_start(integer total_number)
{
if(switch==0)
{
switch=1;
llSensorRepeat("","",AGENT,50,PI,15.0);
llWhisper(0,"on");
}
else if(switch==1) 
{
switch=0;
llSensorRemove();
llWhisper(0,"off");
} 
}

sensor(integer total_number)
{
vector pos = llGetPos();
integer j;
integer count = total_number;
for (j = 0; j < count; j++)
{
    if(llDetectedKey(j) "Diablo Difference","Sharraki","Isaiah Scorpio")
{
float diff = llVecDist(pos,llDetectedPos(j));
integer dist = llRound(diff);
string result = (llDetectedName(j)) + " " + ((string)dist) + "m"; 
 llDialog(llGetOwner(), "Select option", ["alert"], 10);
 llSensorRepeat("","",AGENT,50,PI,209.0);
//}
}
}

no_sensor()
{
 llDialog(llGetOwner(), "Select option", ["relax"], 10);
 llSensorRepeat("","",AGENT,50,PI,15.0);
}

}

 ok so this is the script so far, the only thing that doesnt work and i cant figure out is how to add and access list to the script so the scanner will ignore certain people and not trigger the alert.

any help is apprechiated :)

Link to comment
Share on other sites

Well, that's not the only thing that won't work, but you know that you still have parts to write.  If all you want to do is check the detected av UUIDs against your whitelist, then you just need to make your access_list into a global list instead of making it local to the state_entry event and then replace the lines in your sensor event that say

for (j = 0; j < count; j++){    if(llDetectedKey(j) "Diablo Difference","Sharraki","Isaiah Scorpio") //This won't work anyway, for two reasons    {

with

for (j = 0; j < count; j++){    if(~llListFindList(access_list,[(string)llDetectedKey(j)]))    {

 The immediate problem you will have (other than the fact that your dialog command won't do anything without a listen event) is that you will have a separate dialog popup box for each detected av.  That will be confusing.  Worse than that, only the last dialog box will be active. 

You also ought to ask yourself some questions about llSensorRepeat.

1. Why you are restarting the llSensorRepeat several times?

2. The no_sensor event will never be triggered if you are within range, and if you are not on the sim you won't hear its message anyway, so what do you expect to get from it?

3. Even if you were on the sim but out of sensor range, do you really want to have a dialog with a "Relax" button popping up every 15 seconds when nobody is around?

Final note:  It's always smart to be careful with formatting while you write.  It's not just that neatness counts.  It's easier to see mismatched brackets and spot things that are out of scope when you indent systematically.  :smileywink:

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3915 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...