Parcel Analyzer

Thread Started By ☠ MosDef ☠

4999
3
  • 55 Vote(s) - 2.82 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
Code:
/*
Bornslippy Ruby presents...
Parcel Analyzer
Tags: avatar, effects, ground, group, math, owner, parcel, primitive, region, text, time, timer, world, featured, tools
Description:
License:

http://secondlife.coolminds.org
*/

vector Color = <0, .5, 0>;
  float UpdateInterval = 60.0;
integer UTCOffset = 1;
   list Days   = ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"];
   list Months = ["January", "Febrary", "March", "April", "May", "June", "July", "Agoust", "September", "October", "November", "December"];

string Parcel;

integer llAirPressure()
{
    vector Position = llGetPos();
    float Base_Reading = llLog10(5- (((Position.z - llWater(ZERO_VECTOR)) + 10.0)/15500));
    float KiloPascal = (101.32500 + Base_Reading);
    return (integer)KiloPascal;
}

string GetDay(integer offset)
{
    return llList2String(Days, ((((llGetUnixTime()/3600) + offset)/24)%7));
}

string GetMonth(integer month)
{
    return llList2String( ( [""] + Months ), month );
}

Refresh()
{
    if ( Parcel == "" )
    {        
        list flags = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME,PARCEL_DETAILS_DESC,PARCEL_DETAILS_OWNER,PARCEL_DETAILS_GROUP,PARCEL_DETAILS_AREA]);
    
        Parcel = "[Parcel: " + llList2String( flags, 0 ) + "]\n";
        
        if ( llList2String( flags, 1 ) != "" )
            Parcel += "[Description: " + llList2String( flags, 1 ) + "]\n";
            
        if ( llKey2Name( llList2Key( flags, 2 ) ) != "" )
            Parcel += "[Owner: " + llKey2Name( llList2Key( flags, 2 ) ) + "]\n";
            
        if ( llKey2Name( (key)llList2String( flags, 3 ) ) != "" )
            Parcel += "[Group: " + llKey2Name( (key)llList2String( flags, 3 ) ) + "]\n";
            
        Parcel += "[Size: " + llList2String( flags, 4 ) + " sqm.]";
    }
    
    list timestamp = llParseString2List(llGetTimestamp(),["T",":",":","."],[]);
    list date = llParseString2List(
            llList2String(timestamp, 0),
            ["-"],
            []);

    vector pos = llGetPos();        
    vector windVector = llWind(pos);
    float wind;
    if ( windVector.x > windVector.y ) wind = windVector.x;
    else wind = windVector.y;

    string sign;
    if ( UTCOffset > 0 ) sign = "+";
    else sign = "-";
    
    string text = (string)(llList2Integer(timestamp,1) + UTCOffset) + ":" + llList2String(timestamp,2 ) + " UTC"+sign+(string)UTCOffset+"\n" +
                GetDay(1) + " " + llList2String(date, 2) + " " + GetMonth((integer)llList2String(date, 1)) + " " + llList2String(date, 0) + "\n" +
                "[Parcel Informations]\n"+Parcel+"\n[Pressure: " + (string)llAirPressure() + " KiloPascal]" + "[Altitude: " + (string)((integer)pos.z) + " Meters][Wind: " + (string) wind +"]\n" +
                "[Sun: n/a]\n";

    llSetText(text, Color, 1);
}

default
{
    state_entry()
    {
        llSetTimerEvent( UpdateInterval );
    }
    
    timer()
    {
        Refresh();
    }
    
    changed( integer _c )
    {
        if ( _c & CHANGED_REGION )
        {
            list flags = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME,PARCEL_DETAILS_DESC,PARCEL_DETAILS_OWNER,PARCEL_DETAILS_GROUP,PARCEL_DETAILS_AREA]);
        
            Parcel = "[Parcel: " + llList2String( flags, 0 ) + "]\n";
            
            if ( llList2String( flags, 1 ) != "" )
                Parcel += "[Description: " + llList2String( flags, 1 ) + "]\n";
                
            if ( llKey2Name( llList2Key( flags, 2 ) ) != "" )
                Parcel += "[Owner: " + llKey2Name( llList2Key( flags, 2 ) ) + "]\n";
                
            if ( llKey2Name( (key)llList2String( flags, 3 ) ) != "" )
                Parcel += "[Group: " + llKey2Name( (key)llList2String( flags, 3 ) ) + "]\n";
                
            Parcel += "[Size: " + llList2String( flags, 4 ) + " sqm.]";
        }
    }
}
[Image: 8cWHDmW.png]
Reply




Messages In This Thread
Parcel Analyzer - by ☠ MosDef ☠ - 02-20-2013, 11:55 PM
RE: Parcel Analyzer - by Ken2011 - 03-02-2013, 04:49 PM
RE: Parcel Analyzer - by DarkVirus33 - 08-03-2014, 10:46 PM
RE: Parcel Analyzer - by Bonfire - 10-09-2014, 04:19 PM

Forum Jump:

1 Guest(s)
Share this:

About Second Life Copybot

Second Life CopyBot Forum is a place where you can get items for Second Life and other vitual worlds for free. With our CopyBot viewers you can export and import any content from these virtual worlds and modify them in 3D software such as Blender, 3D studio Macx etc...