Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

This script used to work help help lol!

Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-26-2009 14:56
This script for a url changing tv remote used to work like a champ but for some reason, whether an update of SL or Quicktime, it stopped functioning :(

I miss having it so much, can anyone look at it and tell me what might be wrong? I know its an old script and some functions might be outdated. If so, help me update it?

The remote itself does what it should still. It accepts url's and all, but it doesn't actually start them playing anymore.

list stream =[];
integer randchannel;
integer current;
integer stopper;
default
{
state_entry()
{
llSetText("click to change channel",<1,1,1>,1);
randchannel = (integer)llFrand(100000) + 1;
llListen(randchannel,"","","";);
llListen(0,"","","";);
}

touch_start(integer total_number)
{
llDialog(llDetectedKey(0),"Media Comander \n current stream is \n " + llList2String(stream,current),["play","stop","pause","loop","Next","Back"],randchannel);
}
listen(integer channel,string name,key id,string message)
{
stopper = 1;
if (message == "play" && channel == randchannel)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL, llList2String(stream,current),PARCEL_MEDIA_COMMAND_PLAY]);
}
if (message == "Next" && channel == randchannel)
{
if (current <= llGetListLength(stream) - 2 && stopper == 1)
{
current = current + 1;
llDialog(id,"Media Comander \n current stream is \n " + llList2String(stream,current),["play","stop","pause","loop","Next","Back"],randchannel);
stopper = 0;
}
if (current == llGetListLength(stream) - 1 && stopper == 1)
{
current = 0;
llDialog(id,"Media Comander \n current stream is \n " + llList2String(stream,current),["play","stop","pause","loop","Next","Back"],randchannel);
stopper = 0;
}
}
if (message == "Back" && channel == randchannel && stopper == 1)
{
if (current >= 1 && stopper == 1)
{
current = current - 1;
llDialog(id,"Media Comander \n current stream is \n " + llList2String(stream,current),["play","stop","pause","loop","Next","Back"],randchannel);
stopper = 0;
}
if (current == 0 && stopper == 1)
{
current = llGetListLength(stream) - 1;
llDialog(id,"Media Comander \n current stream is \n " + llList2String(stream,current),["play","stop","pause","loop","Next","Back"],randchannel);
stopper = 0;
}

}
if (message == "pause" && channel == randchannel)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_PAUSE]);
}
if (message == "loop" && channel == randchannel)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL, llList2String(stream,current),PARCEL_MEDIA_COMMAND_LOOP]);
}
if (message == "stop" && channel == randchannel)
{
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
}
if (llGetSubString(message,0,3) == "add " && id == llGetOwner())
{
stream += llGetSubString(message,4,llStringLength(message));
llSay(0,"stream: "+ llGetSubString(message,4,llStringLength(message)) +" added";);
}
if (message == "list" && id == llGetOwner())
{
llSay(0,llDumpList2String(stream," - \n";));
}
if (llGetSubString(message,0,3) == "rem " && id == llGetOwner())
{
string messages = llGetSubString(message,4,llStringLength(message));
if(llListFindList(stream,(list)messages) != -1)
{
integer find = llListFindList(stream,(list)messages);
stream = llDeleteSubList(stream, find, find);
llSay(0,messages + " removed";);
}
else
{
llSay(0,"stream url Not found";);
}
}
}
}
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-26-2009 19:01
you tube addresses? there's a thread about the changes they made.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-26-2009 20:28
Thanks for the suggestion Void. Not just youtube url's but also open source archive url's and such that I know work. I will try to search that thread just incase though.
To clarify, I can get the streams to work if I paste them into the media in about land OK, its just losing the function of a remote control that anyone can click is what I hope the script can be fixed for.
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-26-2009 21:01
there's also a current jira dealing with deeded items (and llDialog specifically)
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-26-2009 22:46
Good because I have ran into some problems concerning deeding to group. Thanks Void!
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-27-2009 11:22
Update-

The script in the remote does work when deeded to a group because we do have group owned land. What a pain though, once its deeded no more url's can be added unless I start with a fresh pre-deeded remote and reinclude every url. I had to make sure all url's I wanted were included before deeding. It says no permission even for the owners.

Where do I find that jira for the deeding problem to vote on it? It would be so much nicer to not have to replace the remote every time I find a new url I like. Url's from http://www.archive.org/details/opensource_movies do fine but of course youtube url's don't work.

Thanks for the information!
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-27-2009 11:58
From: Eanya Dalek
The script in the remote does work when deeded to a group because we do have group owned land. What a pain though, once its deeded no more url's can be added unless I start with a fresh pre-deeded remote and reinclude every url. I had to make sure all url's I wanted were included before deeding. It says no permission even for the owners.


Just a thought .... It looks like the only thing that prevents you from adding or deleting URLs once the device is deeded to the group is the && id == llGetOwner() part of the if tests for those parts of the script. Remove those restrictions or replace them with a password of some kind and you should be back in business.

Alternatively, if you do a small amount of rewriting, you could script an option for the remote to accept URLs from a notecard. If you allow inventory drops, then even if the remote is deeded to the group you ought to be able to reload a full list of URLs without having to type them in one at a time in chat.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-27-2009 12:03
Thanks Rolig, I'll work on that. I am slowly learning :) I also noticed that although the hud lists a movie, when I hit play it doesn't actually start that movie (but plays the last movie listed on the hud before) unless I stop and start play a second time. Which it didn't used to do. Hmmmm.

Thanks for the help all!
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Sharp Pike
Registered User
Join date: 24 Oct 2006
Posts: 12
04-27-2009 13:05
I had the same problem with starting the old URL until you stopped and started the player again. I solved the problem by loading the URL and issuing the play command with separate llParcelMediaCommandList calls.

In other words change this:
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL, llList2String(stream,current),PARCEL_MEDIA_COMMAND _PLAY]);

to this:
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL, llList2String(stream,current)]);
llParcelMediaCommandList([PARCEL_MEDIA_COMMAND _PLAY]);

Worked for me.
Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-27-2009 13:16
Awesome Sharp! That worked like a charm :D That is especially nice because it was confusing at times as to what url was actually playing before.
Now all I need is to figure out the code for having it accept notecards with url's. I checked the script library but haven't been successful finding anything yet. Anyone have any help for that?
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-27-2009 14:22
There's a lovely tutorial on configuring a scripted object with notecards at . You ought to be able to get the idea from there.

Incidentally, things can get confusing if you keep dropping new configuration notecards into an object without getting rid of old ones. One way to do that might be to put a code snippet like this in the part of your dataserver event that's reading cards ....

CODE

if (data == "Wipe Memory")
{
integer TotCards = llGetInventoryNumber(INVENTORY_NOTECARD);
integer x;
for (x = 0; x>=TotCards; ++x)
{
llRemoveInventory(INVENTORY_NOTECARD(x));
}
}


Then, before you drop the notecard with your new set of URLs onto the object, you drop a card that just contains the words "Wipe Memory." It should remove any previous cards (including itself), leaving you an empty inventory to drop the new configuration card into. You could use the same keyword approach on other notecards to delete some or all of the URLs that are saved in your stream playlist, too, the same way you delete them now by typing commands in chat.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Eanya Dalek
Registered User
Join date: 1 Oct 2004
Posts: 231
04-27-2009 14:28
Thanks Rolig, I'm on it :)
_____________________
The Mausoleum - Est. Oct. 2004
http://slurl.com/secondlife/echo/67/55/36/

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-27-2009 14:35
Of course, a simpler way would be to just put the following at the end of your dataserver event.....

CODE

if(EOF)
{
llRemoveInventory("The name of your notecard here");
}


That way, the script reads your configuration notecard, saves its contents, and then gets rid of the notecard right away. ;)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at