Jump to content

Object / AV scanner using llCastRay in mouse look


Lucinda Bulloch
 Share

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

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

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
Link to comment
Share on other sites

  • 2 weeks later...

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

 

Link to comment
Share on other sites

  • 2 years later...


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.

Link to comment
Share on other sites

  • 4 weeks later...
You are about to reply to a thread that has been inactive for 3122 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...