Benja Kepler’s SL Blog

Background Bird Songs

March 16, 2008 · 2 Comments

Copy and paste the script:-

// Title: British Birdsongs
// Written: 11/04/2007
// Comments:
//
//
//
string version = "version: 1.00"; // change for each version
list listSongs;
integer counter;
integer songCount;
integer song;

//
// GMT time display in HH:MM format
//
float seconds;
float hours;
float minutes;
integer hh;
integer mm;
integer ss;
string HH;
string MM;

string hhmm()
{
seconds = llGetGMTclock();
hours = (seconds/3600);
hh = (integer)hours;
HH = (string)hh;
if(hh < 10) HH = "0" + HH;

minutes = (hours - (integer)hours) * 60;
mm = (integer)minutes;
MM = (string)mm;

if(mm ";
}
//
zzDisplay(list out) { // output debug info
llOwnerSay(llList2CSV(out));
}

// global initialization function.
//
init()
{
llOwnerSay(hhmm() + version);
llSetObjectDesc(version);
//
listSongs = [];
songCount = llGetInventoryNumber(INVENTORY_SOUND);
for(counter=0;counter < songCount;counter++){
listSongs += llGetInventoryName(INVENTORY_SOUND,counter);
}
llSetTimerEvent(11);
}

default
{
state_entry()
{
init();
}

on_rez(integer start_param)
{
init();
}

timer()
{
song = (integer)llFrand(songCount);
llPlaySound(llList2String(listSongs,song),1.0);

}
}

Categories: Scripting · Tutorials

2 responses so far ↓

  • Mike McKay // August 20, 2008 at 8:07 am

    Hi. Thank you very much for this script. I’m trying to make it work in OpenLife on the OpenSim platform. I changed the quotation marks to get rid of a few errors, but then get this:

    Primitive: Error compiling script:
    Line 78, char 0: Unexpected EOF

    Any ideas? Thanks again.

  • Benja // August 22, 2008 at 8:50 pm

    Hi Mike

    The script has 77 lines, so I’d suggest you check your paste, perhaps by pasting into notepad and then checking you have matching curly brackets.

    Did you copy the script from this blog, or from the box on my parcel? (http://slurl.com/secondlife/Stamper/21/7/32)

    Benja

Leave a Comment