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
Weather Weather  

Weather

Weather

Category: Weather
By : Encog Dod
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Weather
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Weather_1.lsl
1 // From the book:
2 //
3 // Scripting Recipes for Second Life
4 // by Jeff Heaton (Encog Dod in SL)
5 // ISBN: 160439000
6 X// Copyright 2007 by Heaton Research, Inc.
7 //
8 // This script may be freely copied and modified so long as this header
9 // remains unmodified.
10 //
11 // For more information about this book visit the following web site:
12 //
13 // http://www.heatonresearch.com/articles/series/22/
14
15 float SEALEVEL = 101.32500;
16
17 default
18 {
20 {
22 }
23
24 timer()
25 {
26 string result;
27
29 vector pos = llGetPos();
30 float base = llLog10(5- ((pos.z - llWater(ZERO_VECTOR))/15500));
31 float pascal = (SEALEVEL + base);
32 float temperatureF = ((((pascal * (2 * llPow(10,22)))/
33 (1.8311*llPow(10,20))/ 8.314472)/19.85553747) + (sun.z * 10));
34 vector wind = llWind(pos);
35 float cloud = llCloud(ZERO_VECTOR);
36 cloud = cloud*100.0;
37
38 result = "Temperature: " + (string) temperatureF;
39 result+= "\nBarometer:" + (string)pascal;
40 result+= "\nWind:" + (string)llVecMag(wind);
41 result+= "\nClouds: " + (string)cloud + "%";
42 llSetText(result,<0,1,1>,1);
43
44 //llSay(0,"Current Temperature is "+ (string)((temperatureF - 32) * 5/9) +" Degrees Celsius");
45 }
46 }

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