Isobeast Posted October 26, 2021 Share Posted October 26, 2021 Hey! how can a landowner allow others to control (change) the music stream on their land using a script? can anyone add their own streams in this case? is it possible? Link to comment Share on other sites More sharing options...
Qie Niangao Posted October 26, 2021 Share Posted October 26, 2021 The parcel audio stream can be set by a script owned by the same account that owns the land. (That means on group-owned land, the script needs to be in a group-deeded object.) Then it's up to the script to get stream links from wherever it's handy in the application. If, for example, literally anybody should be able to set the stream to anything at all, the script could take input from llTextBox() perhaps in a touch_start() event handler, then maybe llEscapeURL() of the response string it gets in listen(), and llSetParcelMusicURL() with that tidied-up string. Another common scenario is for the stream-changing script, owned by the landowner, to communicate with "remote control" scripted objects owned by tenants; there are surely commercial products that do this, and maybe some open source scripts. 1 1 Link to comment Share on other sites More sharing options...
Mollymews Posted October 26, 2021 Share Posted October 26, 2021 (edited) 1 hour ago, Isobeast said: Hey! how can a landowner allow others to control (change) the music stream on their land using a script? can anyone add their own streams in this case? is it possible? the method to do this is: http://wiki.secondlife.com/wiki/LlSetParcelMusicURL if you want the others to be able to set the parcel music to anything they want then the script can offer a llTextBox for them to type in the url edit: what Qie said Edited October 26, 2021 by Mollymews 1 1 Link to comment Share on other sites More sharing options...
Isobeast Posted October 26, 2021 Author Share Posted October 26, 2021 3 hours ago, Qie Niangao said: The parcel audio stream can be set by a script owned by the same account that owns the land. (That means on group-owned land, the script needs to be in a group-deeded object.) Then it's up to the script to get stream links from wherever it's handy in the application. If, for example, literally anybody should be able to set the stream to anything at all, the script could take input from llTextBox() perhaps in a touch_start() event handler, then maybe llEscapeURL() of the response string it gets in listen(), and llSetParcelMusicURL() with that tidied-up string. Another common scenario is for the stream-changing script, owned by the landowner, to communicate with "remote control" scripted objects owned by tenants; there are surely commercial products that do this, and maybe some open source scripts. 3 hours ago, Mollymews said: the method to do this is: http://wiki.secondlife.com/wiki/LlSetParcelMusicURL if you want the others to be able to set the parcel music to anything they want then the script can offer a llTextBox for them to type in the url edit: what Qie said Thank you very much! Definite progress has been made on this issue, thanks to you! Could you please also help to make the text box activate when the avatar is sitting on a prim? And how to determine the moment when the avatar gets up to change the URL to the default one? Link to comment Share on other sites More sharing options...
Isobeast Posted October 26, 2021 Author Share Posted October 26, 2021 (edited) This script looks very useful! https://community.secondlife.com/forums/topic/32812-basic-pose-ball-script/ ... But how do you prevent the error message from appearing if there is no animation in the prim or the animation is named incorrectly? Is it possible to simply pop up a message in the chat instead of it stating that "the animation is missing or is incorrectly named ... " Oh, and what to do if the URL entered is invalid, or the text is not a URL at all? Edited October 26, 2021 by Isobeast Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted October 26, 2021 Share Posted October 26, 2021 (edited) 40 minutes ago, Isobeast said: Could you please also help to make the text box activate when the avatar is sitting on a prim? And how to determine the moment when the avatar gets up to change the URL to the default one? changed(integer change) { if( change & CHANGED_LINK) { key avatar = llAvatarOnSitTarget(); if( avatar != NULL_KEY) { llTextBox(avatar, "Type in your wishes", channel); // you will need to have pre-defined channel } else { // the avatar previously sitting has just this minute leeft // do your tifyups here } } } Edited October 26, 2021 by Profaitchikenz Haiku 1 Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted October 26, 2021 Share Posted October 26, 2021 2 hours ago, Isobeast said: Oh, and what to do if the URL entered is invalid, or the text is not a URL at all? On this matter, I have no experience at all. If there's a channel playing Buxtehude I'll experiment. Just a guess, but you could try passing such an invalid string and seeing hat the function return codes are, that' most likely where youre going to get some indication of what didn't agree with the recieveer. 1 Link to comment Share on other sites More sharing options...
Isobeast Posted October 26, 2021 Author Share Posted October 26, 2021 1 hour ago, Profaitchikenz Haiku said: On this matter, I have no experience at all. If there's a channel playing Buxtehude I'll experiment. Just a guess, but you could try passing such an invalid string and seeing hat the function return codes are, that' most likely where youre going to get some indication of what didn't agree with the recieveer. Thank you very much! Now it is clear! Link to comment Share on other sites More sharing options...
Xiija Posted October 26, 2021 Share Posted October 26, 2021 small example of checking for animation.. key sitter; // global string animation; default { state_entry() { animation = llGetInventoryName( INVENTORY_ANIMATION,0 ); vector scale = llGetScale(); llSitTarget( <scale.x/2, 0.0, scale.z + 0.01>, ZERO_ROTATION ); llSetClickAction(CLICK_ACTION_SIT); } changed(integer change) { if (change & CHANGED_LINK) { sitter = llAvatarOnSitTarget(); if(sitter != NULL_KEY) { llRequestPermissions(sitter , PERMISSION_TRIGGER_ANIMATION); } else { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { if( animation) llStopAnimation(animation); } } } } run_time_permissions(integer perm) { if ( perm & PERMISSION_TRIGGER_ANIMATION ) { if( animation ) { llStartAnimation(animation); llStopAnimation("sit"); } else { llRegionSayTo( sitter,0, "the animation is missing or is incorrectly named ... " ); } } } } 1 Link to comment Share on other sites More sharing options...
Xiija Posted October 26, 2021 Share Posted October 26, 2021 to check for a valid stream, you might do something like... listen(integer channel, string name, key id, string message) { string stream = llStringTrim( message, STRING_TRIM ); if( llGetSubString( stream, 0, 3) != "http") { llSay(0, "Invalid Stream URL: " + message); } else { llSay(0, "Setting Stream to: " + message); } } 1 Link to comment Share on other sites More sharing options...
Mollymews Posted October 26, 2021 Share Posted October 26, 2021 (edited) we can check the current url with 4 hours ago, Isobeast said: Oh, and what to do if the URL entered is invalid, or the text is not a URL at all? as Prof suggested try sticking some random text in with llSetParcelMusicUrl i haven't got a own parcel at the moment to test it but I think that llGetParcelMusicUrl returns a empty string in the invalid/random case http://wiki.secondlife.com/wiki/LlGetParcelMusicURL Edited October 26, 2021 by Mollymews 1 Link to comment Share on other sites More sharing options...
Xiija Posted October 26, 2021 Share Posted October 26, 2021 @Mollymews sadly it will take ANY url ... 1 Link to comment Share on other sites More sharing options...
Mollymews Posted October 26, 2021 Share Posted October 26, 2021 (edited) 19 minutes ago, Xiija said: @Mollymews sadly it will take ANY url ... dang! on the bright side, i think you just found a persistent data storage for our parcel management application. Assume we don't care for music playing Edited October 26, 2021 by Mollymews assume 1 2 Link to comment Share on other sites More sharing options...
Lucia Nightfire Posted October 26, 2021 Share Posted October 26, 2021 Personally, I think it's completely dangerous to allow random people to change the parcel music url to anything they want. And that's about all I can say on the subject for security reasons. 😕 4 1 Link to comment Share on other sites More sharing options...
LoneWolfiNTj Posted October 27, 2021 Share Posted October 27, 2021 (edited) 18 hours ago, Isobeast said: how can a landowner allow others to control (change) the music stream on their land I recommend against allowing visitors to enter arbitrary URLs; it's a big security hole. (Not all internet sound streams are G-rated.) Instead, allow them to select stations from a menu. You can collect a few dozen radio stations, store them on a notecard as "name = URL" lines, retrieve them using llGetNotecardLine() and dataserver(), parse each line to name and URL using llParseString2List(), store the station names and URLs into lists (or into a strided list), present station names on dialog-box menu pages using llDialog(), and set media using llSetParcelMusicURL(). Edited October 27, 2021 by LoneWolfiNTj added more pointers 1 1 Link to comment Share on other sites More sharing options...
Mollymews Posted October 27, 2021 Share Posted October 27, 2021 Just now, LoneWolfiNTj said: you can just buy a radio from me naughty boy is against the Linden forum rules to promote our own products on the forum 2 Link to comment Share on other sites More sharing options...
LoneWolfiNTj Posted October 27, 2021 Share Posted October 27, 2021 1 minute ago, Mollymews said: is against the Linden forum rules to promote our own products on the forum Ah, OK. Well, then he'll just have to write his own script. 🙂 1 Link to comment Share on other sites More sharing options...
Mollymews Posted October 27, 2021 Share Posted October 27, 2021 Just now, LoneWolfiNTj said: Ah, OK. Well, then he'll just have to write his own script. 🙂 is all good, but just be aware is quite a few forum police on there. The report button gets a lot of love and yes thats what we are trying to encourage in the scripting forum. Have a go at doing themselves 1 Link to comment Share on other sites More sharing options...
LoneWolfiNTj Posted October 27, 2021 Share Posted October 27, 2021 1 minute ago, Mollymews said: Have a go at doing themselves Well, I did give the OP some pointers. But depending on how elaborate he/she wants to get, and depending on their prior experience, a script could take anything from 5 minutes to 20 hours to get working right. (I spent dozens of hours getting my own radio scripts working right. If I had it to do over again, it would now be much faster, but at the time I was much more of a noob, so it was a struggle. Ah, the joys and pains of getting a big script working right in a language one barely knows.) 2 Link to comment Share on other sites More sharing options...
Mollymews Posted October 27, 2021 Share Posted October 27, 2021 1 hour ago, LoneWolfiNTj said: Well, I did give the OP some pointers yes you did and is great that you did sometimes when it a conversation starts to get a little bit too involved then can always take it to PM/IM 1 Link to comment Share on other sites More sharing options...
LoneWolfiNTj Posted October 27, 2021 Share Posted October 27, 2021 11 minutes ago, Mollymews said: a little bit too involved Or in a regulatory grey area. 🙂 Alas, it's as you say, some people in internet groups (including site employees, forum mods, local residents, and random visitors) have inflexible views on "prevailing rules" and iron fists on "report" buttons. And me being a naughty son-of-a-gun who sees "rules" as being "flexible things which should be stretched as far as possible until I start getting suspended", well, I sometimes do get into trouble for that. 🙂 But you're right, some things should be taken private, in-part to avoid just that kind of problem. 1 Link to comment Share on other sites More sharing options...
Isobeast Posted October 27, 2021 Author Share Posted October 27, 2021 19 hours ago, Xiija said: to check for a valid stream, you might do something like... listen(integer channel, string name, key id, string message) { string stream = llStringTrim( message, STRING_TRIM ); if( llGetSubString( stream, 0, 3) != "http") { llSay(0, "Invalid Stream URL: " + message); } else { llSay(0, "Setting Stream to: " + message); } } Thank you very much! Your examples were very useful to me! Another question. I'm trying to add a group check if (llDetectedGroup(0)), and to use llUnSit() if not in group, but none of the events seem to work for this: changed, listen and run_time_permissions ... What to do in this case? 1 Link to comment Share on other sites More sharing options...
Isobeast Posted October 27, 2021 Author Share Posted October 27, 2021 I tried adding a touch event to catch the group and a timer to temporarily let the avatar sit down, but the script turned into a mess and I got confused. is there any other easier way to check? Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted October 27, 2021 Share Posted October 27, 2021 Not that I know of. Go back to where you were going to add the group-check and have another go. If the toucher is also the sitter, then do the llDetectedGroup() check. If that check is false, unsit the sitter. If nobody is sitting but you get a touch, what is your plan? Ignore the touch? Tell them to sit? 1 Link to comment Share on other sites More sharing options...
Isobeast Posted October 27, 2021 Author Share Posted October 27, 2021 (edited) 42 minutes ago, Profaitchikenz Haiku said: Not that I know of. Go back to where you were going to add the group-check and have another go. If the toucher is also the sitter, then do the llDetectedGroup() check. If that check is false, unsit the sitter. If nobody is sitting but you get a touch, what is your plan? Ignore the touch? Tell them to sit? The plan was this: the avatar clicks on the prim, and if the group matches, then the avatar has, say, ten seconds to sit down. if the group does not match, then there is no way to sit. and then I realized that the avatar can also sit with the right mouse button ... and then I got stuck. Edited October 27, 2021 by Isobeast Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now