Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Prim Calculator Prim_counterscanner  

Prim_counterscanner

Copyright © 2009 Linden Research, Inc. Licensed under Creative Commons Attribution-Share Alike 3.0, from the Wiki at http://community.secondlife.com/t5/LSL-Library/Sim-Prim-Count/td-p/1603611

Category: Prim Calculator
By : Rolig Loon
Created: 2012-08-10 Edited: 2012-08-10
Worlds: Second Life

the Zip file

Download all files for Prim_counterscanner
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Prim_counterscanner_1.lsl
1 //Sim Prim Scanner -- Rolig Loon -- July 2012
2
3 // I find that a 0.5m white sphere makes a nice container for this scanner script,
4 // but anything will do. It's just that the particle glow looks nice on that
5 // sphere. Your choice.
6
7 list gPrclID; // List of unique parcel UUIDs
8 integer gTotPrims; // Total prims detected
9 float gX; // X coordinate of curren scan target
10 float gY; // Y coordinate of current scan target
11 string gObjName; // This scanner's name
12 integer gNUM; // Sequence number of unique parcels scans
13
14 default
15 {
17 {
18 llSetColor(<1.0,1.0,1.0>,ALL_SIDES);
19 gPrclID = [];
20 gTotPrims = 0;
21 // Start scan in the SW corner of the sim
22 gX = 4.0;
23 gY = 4.0;
24 }
25
26 on_rez(integer start)
27 {
28 llSetPos(llGetPos() + <0.0,0.0,0.5>);
29 llSetText("Touch to start scan",<1.0,1.0,0.0>,1.0);
30 }
31
32 touch_start(integer total_number)
33 {
34 llSetText("Scanning ....",<1.0,1.0,0.0>,1.0);
35 // Cheesy visiual effects ........
36 llSetColor(<1.0,1.0,0.0>,ALL_SIDES);
39 PSYS_PART_START_SCALE, <0.02, 0.02, FALSE>, PSYS_PART_END_SCALE, <3.0, 3.0, FALSE>,
40 PSYS_PART_START_COLOR, <1.00,1.00,0.00>, PSYS_PART_END_COLOR, <1.00,1.00,0.00>,
44 PSYS_PART_MAX_AGE, (float) 0.75,
52 )]);
53 gObjName = llGetObjectName();
54 gNUM = 0;
55 llRegionSayTo(llGetOwner(),0,"Scan started on " + llGetRegionName());
56 llSetTimerEvent(0.1);
57 }
58
59 timer()
60 {
61 list parcel = llGetParcelDetails(<gX,gY,100.0>,[PARCEL_DETAILS_ID,PARCEL_DETAILS_NAME]);
62 key temp = llList2Key(parcel,0); // The parcel's UUID
63 string parcel_name = llList2String(parcel,1); // The parcel's name
64 if(parcel_name == "")
65 {
66 parcel_name = "(no name)";
67 }
68 if(!~llListFindList(gPrclID,[temp])) // Have we scanned this parcel before? If not ...
69 {
70 ++gNUM;
73 gTotPrims += Count;
74 llRegionSayTo(llGetOwner(),0, "/me "+ parcel_name + " @ <"+(string)gX+","+(string)gY+",Z> = " + (string)Count);
75 gPrclID += [temp];
76 }
77 if(gX < 256.0) // Increment X but don't let X go outside the sim borders
78 {
79 gX +=8.0;
80 }
81 if(gX > 256.0) // If it does, reset X and increment Y
82 {
83 gY += 8.0;
84 gX = 4.0;
85 }
86 if(gY > 256.0) // Don't let Y go outside the sim boders. If it does, wrap up the scan ....
87 {
88 llSetObjectName(gObjName);
89 llRegionSayTo(llGetOwner(),0,"Scan finished. Total Prims = " + (string)gTotPrims + " in " + (string)llGetListLength(gPrclID) + " parcels (not counting temp rez prims).");
91 llSetText("Touch to start scan",<1.0,1.0,0.0>,1.0);
93 }
94 }
95 }

Back to the Best Free Tools in Second Life and OpenSim.