Jump to content
Sign in to follow this  
Lucinda Bulloch

Object / AV scanner using llCastRay in mouse look

Recommended Posts

Below is a basic scanner in mouse look that uses cast ray and not sensor, it will only work in a region, cast ray wont cross boarder yet, but will work within a region to your Max draw distance, just put this script in an object and wear it, go into mouse look and put the cross hairs on any object or av, click the left mouse button and the script info about the object/av will be printed out, they wont know they are being scanned, the code below will only get the data from the first object it hits, but this code is fun to play with, have fun.

 

integer firecontrols;
default
{
  state_entry()
   {
    llSetMemoryLimit(0x2800);
    firecontrols =CONTROL_LBUTTON|CONTROL_ML_LBUTTON;
   }  
 
   attach(key id)
    {
     if(id == llGetOwner())llRequestPermissions(id,PERMISSION_TAKE_CONTROLS|PERMISSION_TRACK_CAMERA);
     else llReleaseControls();   
    }   
   run_time_permissions(integer perm)
    {
     if(perm)llTakeControls(firecontrols, TRUE, FALSE);
    }
   control(key id, integer level, integer edge)
    {
     if(level&edge&firecontrols)
      {
       vector start =  llGetCameraPos();
       list results = llCastRay(start,start + <1000,0,0>*llGetCameraRot(),[
       RC_REJECT_TYPES,RC_REJECT_LAND,
       RC_DATA_FLAGS,RC_GET_ROOT_KEY,
       RC_MAX_HITS,1,
       RC_DETECT_PHANTOM,TRUE
       ]);
       list dat = llGetObjectDetails(llList2Key(results,0), [
       OBJECT_NAME,
       OBJECT_OWNER,
       OBJECT_CREATOR,
       OBJECT_RUNNING_SCRIPT_COUNT,
       OBJECT_TOTAL_SCRIPT_COUNT,
       OBJECT_SCRIPT_MEMORY,
       OBJECT_SCRIPT_TIME,
       OBJECT_PRIM_EQUIVALENCE
       ]);  
       llOwnerSay(
       "\nName = "+llList2String(dat,0)+
       "\nOwner = "+llKey2Name(llList2String(dat,1))+
       "\nCreator = "+llKey2Name(llList2String(dat,2))+
       "\nScripts running = "+llList2String(dat,3)+
       "\nTotal Scripts = "+llList2String(dat,4)+
       "\nMemory used = "+llList2String(dat,5)+
       "\nScript time = "+llList2String(dat,6)+
       "\nPrims = "+llList2String(dat,7)
       );
     }
   } 
   
}

 

No need to right click and edit now, you have no idea how much that upsets boat owners.

I have just changed the getpos to getcamerapos, the getpos had an offset the getcamerapos does not

 

Ps, thank you for fixing castray.

  • Like 2

Share this post


Link to post
Share on other sites

Hi, I just sent you the new meter inworld, the one you got was just before I updated the market place box, it now has the new meter in, but would be great if you could test the new one, it is very fast and crisp.

Share this post


Link to post
Share on other sites

Hello Lucinda,

Great script, but I have a problem, it only worked once.  Made a Prim, droped in your script, and it worked.

I TPed and after that, the script post to Local, but no Info after any = sign. I remade the prim, copied the script from here again, but still no info. Was hopping you might know why ..

 

Thank you for your time, Silver

 

Share this post


Link to post
Share on other sites


Ywoski Khan wrote:

is this out of date for 2014? I cant get it to do anything at all, mouselook left click middle click right click tried all 3 nothing
:(

I just gave it a try and it works perfectly for me. Maybe you have added the script to an already worn attachment. To make it work it has to be re-attached then. Or it won't request control permissions.

Other than that, make sure you attached it in a place where you have rights to run scripts.

Share this post


Link to post
Share on other sites

Not only it continues to work in 2014, but (shhh!) it even works under OpenSimulator... hehe.

Thanks for the script, I was going nuts in figuring out how to compensate for the camera movement, and all that because I got the control grabbing function wrong! Silly me!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...