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_Calculator_1  

Prim_Calculator_1

Prim Calculator 1.lsl

Category: Prim Calculator
By : Catherine Omega
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Prim_Calculator_1
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Prim_Calculator_1_1.lsl
1
2 //********************************************************
3 //This Script was pulled out for you by YadNi Monde from the SL FORUMS at http://forums.secondlife.com/forumdisplay.php?f=15, it is intended to stay FREE by it s author(s) and all the comments here in ORANGE must NOT be deleted. They include notes on how to use it and no help will be provided either by YadNi Monde or it s Author(s). IF YOU DO NOT AGREE WITH THIS JUST DONT USE!!!
4 //********************************************************
5
6
7
8
9 // Prim Calculator 1.3
10 // Catherine Omega Heavy Industries
11
12 // Tells you the number of prims that can be used on a given size of lot.
13 // Tells you the amount of land you must own to support a certain number of prims.
14 // Example: "/land 512" or "/prims 100"
15
16 default
17 {
19 {
20 llListen(0,"",llGetOwner(),"");
21 }
22
23 listen(integer channel, string name, key id, string m)
24 {
25 integer command_divide = llSubStringIndex(m," "); // establish that space (" ") divides words.
26
27 string gCommand = llToLower(llGetSubString(m, 0, command_divide - 1)); // grab the first word of the the input string.
28 string gSubCommand = llToLower(llGetSubString(m, command_divide + 1, 40)); // grab the rest of the input string.
29
30 // Calculate Prims
31 if(gCommand == "/land")
32 {
33 float land = (float)gSubCommand;
34 float primsF = land / 65536 * 15000;
35 integer primsI = (integer)primsF; // converts the float to an integer for easier reading. Note that land must be purchased in parcels of 16 square metres.
36
37 llSay(0,"You can use up to " + (string)primsI + " prims.");
38 }
39
40 // Calculate Land
41 if(gCommand == "/prims")
42 {
43 integer prims = (integer)gSubCommand;
44 integer land = prims * 65536 / 15000;
45 llSay(0,"You need " + (string)land + " square metres of land to support " + (string)prims + " prims.");
46 }
47 }
48 }
49
50 // END //

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