Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need a script to read land url

Joseph Brinner
Registered User
Join date: 29 Dec 2008
Posts: 81
09-05-2009 22:52
I have a message board that displays land music info,but i need a script that reads the url if its changed and updates display,like shoutcast boards do.Call joseph brinner
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-05-2009 23:10
Something like this (untested) script should work, though it just does SetText unstead of the whole shoutcast display thingie..

CODE

float UPDATE_TIME = 600.0; // 10 minutes

string gLastUrl;

Update()
{
string url = llList2String (llParcelMediaQuery ([PARCEL_MEDIA_COMMAND_URL]), 0);
if (gLastUrl != url)
{
gLastUrl = url;
llSetText ("Playing: " + url, <1.0, 1.0, 1.0>, 1.0);
}
}

default
{
state_entry()
{
llSetText ("", ZERO_VECTOR, 0.0);
llSetTimerEvent (UPDATE_TIME);
}
}
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Joseph Brinner
Registered User
Join date: 29 Dec 2008
Posts: 81
hey sindy
09-05-2009 23:50
i set this into new script,i get syntax error


CODE

float UPDATE_TIME = 600.0; // 10 minutes

string gLastUrl;

Update()
{
string url = llList2String (llParcelMediaQuery ([PARCEL_MEDIA_COMMAND_URL]), 0);
if (gLastUrl != url)
{
gLastUrl = url;
llSetText ("Playing: " + url, <1.0, 1.0, 1.0>, 1.0);
}
}

default
{
state_entry()
{
llSetText ("", ZERO_VECTOR, 0.0);
llSetTimerEvent (UPDATE_TIME);
}
}
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-06-2009 07:29
Hm.. It works for me.. Did you include the
CODE
 and 
stuff? If so, remove those - they're just to make the script look good here in the forums, if they ever turn formatting back on here.

/me tweaks the script a little:
CODE

float UPDATE_TIME = 600.0; // 10 minutes

string gLastUrl;

Update()
{
string url = llList2String (llParcelMediaQuery ([PARCEL_MEDIA_COMMAND_URL]), 0);
if (gLastUrl != url)
{
gLastUrl = url;
llSetText ("Playing: " + url, <1.0, 1.0, 1.0>, 1.0);
}
}

default
{
state_entry()
{
llSetText ("", ZERO_VECTOR, 0.0);
llSetTimerEvent (UPDATE_TIME);
Update();
}
}

_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-06-2009 17:45
Hm.. Update: on group deeded land, you have to deed the object with this script, too.. If you just put it on group-deeded land without deeding the object, it won't work..
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Indeterminate Schism
Registered User
Join date: 24 May 2008
Posts: 236
09-07-2009 01:49
Another possible reason this is not working for you is that this will read the parcel Media URL, not the music URL. The latter is not possible. Go figure.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
09-07-2009 07:15
Hm.. I tested this yesterday on land I own that has music but not video and it worked on, once I deeded it. Dunno what would happen if you have both music and video.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left