Change font size
It is currently Thu Nov 22, 2018 5:49 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: OS Simulator Version Script
PostPosted: Tue Jun 30, 2009 9:44 am 
User avatar

Joined: Thu Jun 18, 2009 8:08 am
Posts: 11
Location: South Australia
Hi there,

I thought I would share this script I made, it's just like nebadon's os version except it doesn't shout and makes the text a little more pretty than what osGetSimulatorVersion() spits out by default. I only have one region and it's on Debian, so I can say it works with debian, but it might need some fiddling with for other operating systems. No warranties or anything like that, just thought I would share :)

{L_CODE}:
// Set this to 1 if you want to see the Additional info.
integer show_additional_info = 0;

string parsed_text() {
    string osstr = osGetSimulatorVersion();
    list values;
    list additional_info;
    integer i;
   
    integer osstart = llSubStringIndex(osstr, "(OS") + 4;
    integer ossend = llSubStringIndex(llGetSubString(osstr, osstart, -1), ")") + osstart - 2;
    string operatingSystem = llGetSubString(osstr, osstart, ossend);

    values = llParseString2List(llGetSubString(osstr, 0, osstart - 4), [" "], []);
    additional_info = llParseString2List(llGetSubString(osstr, ossend + 3, -1), [" "], []);
   
    string simversion = llList2String(values, 0) + " " + llList2String(values, 1) + llList2String(values, 3);
    string parsedstr = llGetRegionName() + "\n" + simversion + "\nOn " + operatingSystem;
    if (show_additional_info == 1) {
        for (i=0;i<llGetListLength(additional_info);i++) {
            parsedstr += "\n" + llList2String(additional_info, i);
        }
    }
    return parsedstr;
}

default
{
    state_entry()
    {
        llSetTimerEvent(3600);
        llSetText(parsed_text(), <1,1,1>, 1.0);
    }
    timer()
    {
        llSetText(parsed_text(), <1,1,1>, 1.0);
    }
    touch_start(integer num)
    {
        llSetText(parsed_text(), <1,1,1>, 1.0);
    }
}


Top
 Profile  
 
 Post subject: Re: OS Simulator Version Script
PostPosted: Tue Jun 30, 2009 7:24 pm 
OSG Elite
User avatar

Joined: Thu Jul 31, 2008 2:48 am
Posts: 394
Will be interesting to see this script in action. Especially after considering that the type List is only partially implemented according to wiki entry on LSL Status/Types

Was playing around with a script a few months back that depended on type List and functions that acted upon the List type. That's when I discovered my bookmark to LSL Status in OpenSimulator was a smart bookmark to keep :D

Now I'll have to go digging for that failed script and see if some of the functionality it required is now implemented.
I hadn't noticed any work on Lists in the commit changelogs in the interim.
thanx for sharing Xundra.

have fun,
PocoLoco
Avatar@Large


Top
 Profile  
 
 Post subject: Re: OS Simulator Version Script
PostPosted: Wed Jul 01, 2009 2:58 am 
User avatar

Joined: Thu Jun 18, 2009 8:08 am
Posts: 11
Location: South Australia
{L_QUOTE}:
Will be interesting to see this script in action. Especially after considering that the type List is only partially implemented according to wiki entry on LSL Status/Types


I've used lists quite a lot in my fishing game and haven't come across any problems yet, the function page only lists llParseString2List as partially complete with regards to spacers. The types page doesn't say what functionality is missing, but I guess if most of the functions regarding lists are marked as complete they would be safe to use?

If you find your script that failed, I would be interested to know how it did so I know what to avoid and work around in my own scripts.

Oh, if you want to see the script in action I have mine set up right near the teleport landing place on Snowpaw Isle.


Top
 Profile  
 
 Post subject: Re: OS Simulator Version Script
PostPosted: Wed Jul 01, 2009 9:50 am 
OSG Elite
User avatar

Joined: Thu Jul 31, 2008 2:48 am
Posts: 394
Well, it has been months since I tried scripting anything with a Lists. And the wiki by definition is not necessarily up to date.
I assumed you had a working model, aka Proof-of-Concept :D
What will be interesting to me, assuming I can find that troublesome script, is what functions I was using compared to what we will know from your script of functions that do work.
Enough babbling from me ;)
time to pull that Hard Drive from my crashed XP machine and start retrieving some archived content. Wasn't quite enough to justify burning a CD so it all still resides on a PC that won't boot :cry:
If it's anywhere it's on that HD.

PocoLoco
Avatar@Large


Top
 Profile  
 
 Post subject: Re: OS Simulator Version Script
PostPosted: Sat Oct 17, 2009 9:51 am 
Furious Typer
User avatar

Joined: Tue Aug 18, 2009 1:24 pm
Posts: 64
Location: Netherlands
works but i'm not getting "Git" number. not sure if this is possible, but would be cool... :D

thanks

_________________
۩____________________________________________________________________۩
Website: http://verwijs.wordpress.com
Website: http://verwijs-pc.nl (dutch)
Twitter: http://www.twitter.com/OpenSimFan/
Osgrid Profile: http://www.osgrid.org/elgg/pg/profile/Christopher.MetalFan


Top
 Profile  
 
 Post subject: Re: OS Simulator Version Script
PostPosted: Sat Oct 17, 2009 4:59 pm 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
to get the git revision # go into the root of your project and type the following

{L_CODE}:
git log -n 1 --pretty="format:%h %ci" > bin/.version


then restart your simulator, and you will have the git revision displayed as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net