Land Radio
|
|
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
|
07-08-2009 18:47
From: Void Singer yeah, that's why it's more effective to just add the owners automatically if you have whitelisting functions.... it also one less test to do, and easier to setup for users. If you would never have to reset the script after deeding that would be a good solution.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-08-2009 20:14
From: Raster Teazle If you would never have to reset the script after deeding that would be a good solution. you're presuming you add it by physically listing it... I'm saying add it via script... to be group friendly, you also need to be checking llDectedGroup, llSameGroup, or have an outside whitelisting function (that group members with modify powers can access, say via notecard, which you can manually add the original owner to) otherwise you're doing extra work testing for the owner (which won't help you for group deeding anyway) on top of testing a whitelist and or group membership.
_____________________
| | . "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... | - 
|
|
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
|
07-09-2009 13:08
From: Void Singer you're presuming you add it by physically listing it... I'm saying add it via script... to be group friendly, you also need to be checking llDectedGroup, llSameGroup, or have an outside whitelisting function (that group members with modify powers can access, say via notecard, which you can manually add the original owner to)
otherwise you're doing extra work testing for the owner (which won't help you for group deeding anyway) on top of testing a whitelist and or group membership. No, I presumed what you ment was to add the owner's name automatically via llDetectedOwner() in script. This will not work on a reset once the radio is deeded as the owner is now the group. I was assuming the radio was not to be deeded. So a check for the owner is all that would be needed to only allow the owner to operate. Deeding is different story and would of course require adding the owner's name to the okavatars list. Adding llDetectedGroup() would be undesirable in this case as then all members of the radio group would be allowed operation thus not limited to just the okavatars list. Anyway, all my products use a access list notecard which reads the names into a list. My instructions mention that you are to add your name to the access list before deeding to a group. This can be changed after deeding if the notecard was set to share with group and modify permission was set. By default I set it to not share as most people have everyone in the same group and they probably do not want just anyone adding names to the access list. Another thing I have on some of the products is to allow addition or deletion to the access list via chat command. The command is limited to members of the management list (which can be modified only by the owner) and can be used to add or delete names deeded of not. Normal members of the access list cannot use the chat command to add or delete names. There is included as well the ability for managers or owners depending on the product to set access to public or private use. This allows you to share the radio with anyone without having to deal with the access list. There is also a notecard for the stations as well and that is set by default to share with group to allow members to add stations if they want. This can be changed to not share before deeding if editing is not desired by group members. As for using outside web based lists, personally I am against creating any products that rely on a outside source. What will happen if that outside source is no longer there? I prefer products that will always work in SL even if I decide to pack up and leave. I do have one product that relies on outside scripts I host on another server I do not own or control. Every now and then there is a problem with the server and all the products that depend on it go down. This is one of the reason I give that product away for free as I consider it a "at your own risk" product. All of this is beyond the scope of this simple script and that is why I did not mention it before.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
Cf:tb
07-09-2009 23:47
I think we're actually on a similar track here... but to be sure.. this is the simplification of what I'm using... list white;
default{ //-- notecard reader to grab whitelist
state_exit(){ white = (list)llKey2Name( llGetOwner() ) + white; } }
state sWorking{ touch_end( integer vIntTtl ){ if (~llListFindList( white, (list)llDetectectedName( 0 ) || (llDetectedGroup( 0 ) && llGetPermMask( MASK_GROUP )) ){ //--command functions } } }
granted you wouldn't want the group section, but it sounds like you're using something similar to the first (although I'm guessing you use a say to add people to your whitelist?, which fails after deeding and reset, whereas the notecard reader won't and can be updated by anyone in the group with mod permissions)
_____________________
| | . "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... | - 
|
|
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
|
07-10-2009 02:00
@Void
Yep, that's very similar to what I do even as far as preferring touch_end over touch_start. All notecards are read in a state during initialization so on a reset everything is back.
Your state exit routine is a good idea as it makes the test for owner not needed in the touch event.
And correct that anything added to white list with the chat command is gone on a reset so the notecard is the standard whitelist with chat as a option with a warning that anything added with this is not permanent.
If the renter owns his own radio then they add their name to the whitelist and deed or have land owner/officer deed if deed permissions are not allowed. The radio owner can then use the chat commands to add or delete friends to the whitelist as desired.
In most cases you would not want all members of the radio group allowed to edit the whitelist. Most rental properties have one group for the land and renters. Your neighbor could remove your name from the whitelist and add his own. So by default the whitelist is set to not share with group.
There are different things to consider if the radio is supplied by the property owner to the renter. In this case you probably would want a manager/owner whitelist as well as a user whitelist.
Sorry for getting off topic with this.
And nice chatting with you Void your input is respected and appreciated.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-10-2009 02:40
From: Raster Teazle @Void
Yep, that's very similar to what I do even as far as preferring touch_end over touch_start. All notecards are read in a state during initialization so on a reset everything is back.
Your state exit routine is a good idea as it makes the test for owner not needed in the touch event.
And correct that anything added to white list with the chat command is gone on a reset so the notecard is the standard whitelist with chat as a option with a warning that anything added with this is not permanent.
If the renter owns his own radio then they add their name to the whitelist and deed or have land owner/officer deed if deed permissions are not allowed. The radio owner can then use the chat commands to add or delete friends to the whitelist as desired.
In most cases you would not want all members of the radio group allowed to edit the whitelist. Most rental properties have one group for the land and renters. Your neighbor could remove your name from the whitelist and add his own. So by default the whitelist is set to not share with group.
There are different things to consider if the radio is supplied by the property owner to the renter. In this case you probably would want a manager/owner whitelist as well as a user whitelist.
Sorry for getting off topic with this.
And nice chatting with you Void your input is respected and appreciated. I tend toward group enabled but no chat,but I do agree it's a better setup than staright group when owner/managers and renter/users share the group (unless all main controls are via notecard, then you can limit the everyone role from editing)... I'll sometimes tack on a mechanism to also grab either a second notecard our input from another script to add to the whitelist (send a polling call before the notecard read and catch the return via link message) or even description, but I'm leery of that with the stupid bug I found (roots with a blank description get changed to "  No Description)" when taken to inventory)... the poliing method works great if you have a rental box that returns the renter from a poll... but not many incorporate that yet =/
_____________________
| | . "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... | - 
|
|
Sephiroth Diavolo
Registered User
Join date: 14 Feb 2009
Posts: 2
|
07-10-2009 17:01
hi I'm new to scripting and playing about with this script, how do I go about adding a white list, which will be alot easier as I found when deeded the script can no longer be edited to add more people where as the stations note card can, everything I try I keep getting syntax errors
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-11-2009 00:03
From: Sephiroth Diavolo hi I'm new to scripting and playing about with this script, how do I go about adding a white list, which will be alot easier as I found when deeded the script can no longer be edited to add more people where as the stations note card can, everything I try I keep getting syntax errors a white list requires two main parts... first obviously a list (or a condition like group membership) and second a way to test it. my immediate suggestion would be to check out llListFindList and a basic notecard reader links follow https://wiki.secondlife.com/wiki/LlListFindListhttps://wiki.secondlife.com/wiki/Notecard_reading
_____________________
| | . "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... | - 
|
|
Sephiroth Diavolo
Registered User
Join date: 14 Feb 2009
Posts: 2
|
07-13-2009 07:21
thankyou for the links, I've been playing about the last few days with no success, new to scripting and not exactly sure how to get it working if anyone could talk me through it that would be great
|
|
Krissie Lemon
Registered User
Join date: 14 Feb 2009
Posts: 4
|
07-15-2009 15:14
hi I've just tried this script and used the links to try and add a white list with no success does anyone know how to do it?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-15-2009 18:51
post us some code and we can take a look at where you went wrong.
_____________________
| | . "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... | - 
|
|
Krissie Lemon
Registered User
Join date: 14 Feb 2009
Posts: 4
|
07-15-2009 19:34
hi void, well the codes on the first page and the link you supplied, I put list white at the top of the script and added a note card called white but I know nothing about scripting and no idea how to get the rest of the script from the link you gave to read the names from the note card, I tried changing the script from where it says numbers to white but keep getting syntax errors top of script: list white after default: { state_entry() { integer index = llListFindList(numbers, [3]); if (index != -1) { list three_four = llList2List(numbers, index, index + 1); llOwnerSay(llDumpList2String(three_four, ","  ); // Object: 3,4 } } } really not sure what I am doing, hope you can help me
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-15-2009 21:20
From: Krissie Lemon hi void, well the codes on the first page and the link you supplied, I put list white at the top of the script and added a note card called white but I know nothing about scripting and no idea how to get the rest of the script from the link you gave to read the names from the note card, I tried changing the script from where it says numbers to white but keep getting syntax errors
top of script:
really not sure what I am doing, hope you can help me mkay, well the first thing would be that naming the list and notecard the same doesn't give you direct access to the notecard... you need the code from the second link for that part.... it will read information from the notecard and store it in a list, so that you can check the list for the information (an analogy would be putting gas into your car before you can start the engine.. the notecard contents are gas, the notecard is a gascan, the notecard reader is a filling nozzle, and the list is your cars gas tank) second thing, is ... you gas tank isn't connected to the engine! llListFindList has two parts, the first part should be your list you are looking in (you don't have a list named number, only one named white... your gas tank, that needs to be changed), the 2nd part is what you are looking for (I'm guessing you were looking for the number 3?) a bit of gas =) then you tell it to get that bit of gas, and the bit after it (from a part that isn't in your car), and run the engine with it (tell you the what's stored in those two bits of gas)... ok the analogy failed at this point so let me demonstrate what your code should look like so far (without the notecard reader) list white = ["a", "b", "c", "d", "e", "f"]; //- gas tank prefilled, because we don't have our filling nozzle built in yet
default { state_entry() { integer index = llListFindList( white, ["d"] ); //-- look this bit of fuel in our tank if (index != -1) //-- is it in there? (-1 means no) { list three_four = llList2List( white, index, index + 1); //-- get our bit of searched for fuel, and the bit after it llOwnerSay( llDumpList2String( three_four, "," ) ); //-- tell us what kind of fuel was in there? // Object: d,e } } }
_____________________
| | . "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... | - 
|
|
Krissie Lemon
Registered User
Join date: 14 Feb 2009
Posts: 4
|
07-16-2009 04:46
thankyou Void, I tried adding the parts to the script and managed to get it to save correctly but now the stations menu doesn't show just keeps coming up with a message in chat when clicked saying "Object: d,e" to get the script to save I had to replace: touch_start(integer touchNumber) { integer ListLength = llGetListLength(OKAvatars); //OKAvatars is your name list integer i; for (i=0; i <= ListLength-1; ++i) { if (llDetectedName(0) == llList2String(OKAvatars, i)) { curStations(); //This is the line that's supposed to move to this new location llDialog(llDetectedKey(0), dispStationStr, theStations, 93); } } with your part so now the script looks like this: list white = ["a", "b", "c", "d", "e", "f"]; //- gas tank prefilled, because we don't have our filling nozzle built in yet string _notecard = "stations"; integer chatChannel = 24; string HELP_MSG = "touch for station dialog, or use ch 24 to change stations (example \"/24 3\"  "; list _radioURLs; list _radioStations; list theStations; integer _linenum = 0; integer curStationOffset = 0; integer stationChunk = 6; integer curStationEnd = 5; integer totalStations = 0; integer dialogActive = 0; integer curIdx = -1; string dispStationStr = ""; string NEXT_MSG = "Next >>"; string PREV_MSG = "<< Prev"; string LIST_MSG = "List"; string CUR_SET = "c"; string ALL_SET = "a"; list cmdNextChunk = [">>", "next", "Next", NEXT_MSG]; list cmdPrevChunk = ["<<", "prev", "Prev", PREV_MSG]; list cmdLsCur = ["ls", "list", LIST_MSG]; list cmdLsAll = ["la", "listall"]; list cmdSearch = ["s", "search"]; string newURL; string newDesc; reset_radio() { llSetText("starting radio ....", < 1,0,0 >, 1.0 ); llListen(77, "", "", ""  ; curStationOffset = 0; curStationEnd = 5; _linenum = 0; dialogActive = 0; _radioURLs = []; _radioStations = []; totalStations = 0; curIdx = -1; dispStationStr = ""; llGetNotecardLine(_notecard, _linenum); } add_station(string line) { list words = llParseString2List(line, [" ", " ", "="], []); if (llGetListLength(words) < 2) { return; } string url = llList2String(words, llGetListLength(words) - 1); string station = ""; integer i; for (i=0; i< llGetListLength(words) - 1; i++) { if (llStringLength(station) > 0) { station += " "; } station += llList2String(words, i); } _radioURLs += ; _radioStations += [station]; }
curStations() { theStations = [PREV_MSG, LIST_MSG, NEXT_MSG];
integer i; dispStationStr = "";
// llWhisper(0, "offset: " + (string)curStationOffset); // llWhisper(0, "end: " + (string)curStationEnd); for (i = curStationOffset; i < = curStationEnd; i++) { if (curIdx == i) { dispStationStr += "*"; } else { dispStationStr += " "; } dispStationStr += (string) (i + 1) + ") "; dispStationStr += llList2String(_radioStations, i); dispStationStr += "\n"; theStations += (string)(i + 1); } }
doNextSet() { curStationOffset += stationChunk; curStationEnd = curStationOffset + (stationChunk - 1); if (curStationOffset >= totalStations) { curStationOffset = 0; curStationEnd = curStationOffset + (stationChunk - 1); } if (curStationEnd >= totalStations) { curStationEnd = totalStations - 1; } }
doPrevSet() { if (curStationOffset > 1 && ((curStationOffset - stationChunk) < 1)) { curStationOffset = 0; } else { curStationOffset -= stationChunk; }
curStationEnd = curStationOffset + (stationChunk - 1); if (curStationEnd >= totalStations) { curStationEnd = totalStations - 1; } if (curStationOffset < 0) { curStationEnd = totalStations - 1; curStationOffset = totalStations - (stationChunk - 1); } }
doListStations(string mode) { integer i; integer startPos; integer endPos; if (mode == "a") { startPos = 0; endPos = totalStations - 1; } else { startPos = curStationOffset; endPos = curStationEnd; } for (i = startPos; i < = endPos; i++) { string newURL = llList2String(_radioURLs, i); string newDesc = llList2String(_radioStations, i); llSay(0, (string)(i + 1) + ": " + newDesc + " = " + newURL); } }
doSearch(string theTerm) { integer i; llSay(0, "the term is " + theTerm); for (i = 0; i < totalStations; i++) { string curString = llList2String(_radioStations, i); if (llSubStringIndex(curString, theTerm) != -1) { string newURL = llList2String(_radioURLs, i); llSay(0, (string)(i + 1) + ": " + curString + " = " + newURL); } } }
//-----------------------
default
{ on_rez(integer start_param) { reset_radio(); } state_entry() { reset_radio(); } changed(integer change) { if (change & CHANGED_INVENTORY) { reset_radio(); } }
dataserver(key query_id, string data) { if (data != EOF) { add_station(data); _linenum++; if (_linenum % 5 == 0) { llSetText("starting: \n" + (string)_linenum + " stations ...", < 1,0,0 >, 1.0 ); } llGetNotecardLine(_notecard, _linenum); return; } llListen(93, "", NULL_KEY, ""); totalStations = llGetListLength(_radioURLs); llSay(0, HELP_MSG); dialogActive = 1; llSetText("", < 1,0,0 >, 1.0 ); }
touch_start(integer touchNumber) { integer index = llListFindList( white, ["d"] ); //-- look this bit of fuel in our tank if (index != -1) //-- is it in there? (-1 means no) { list three_four = llList2List( white, index, index + 1); //-- get our bit of searched for fuel, and the bit after it llOwnerSay( llDumpList2String( three_four, "," ) ); //-- tell us what kind of fuel was in there? // Object: d,e }
}
listen(integer channel, string name, key id, string message) {
if (dialogActive == 0) { llWhisper(0, " ... still loading stations ..."); return; } if (message == "") { message = "cur"; } list words = llParseString2List(message, [" ", " ", "="], []); list testFind = llList2List(words, 0, 0); if (llListFindList(cmdNextChunk, testFind) != -1) { doNextSet(); curStations(); if (channel == chatChannel) { doListStations(CUR_SET); } else { llDialog(id, dispStationStr,theStations, 93); } return; } else if (llListFindList(cmdPrevChunk, testFind) != -1) { doPrevSet(); curStations(); if (channel == chatChannel) { doListStations(CUR_SET); } else { llDialog(id, dispStationStr, theStations, 93); } return; } else if (llListFindList(cmdSearch, testFind) != -1) { doSearch(message); return; } else if (llListFindList(cmdLsAll, testFind) != -1) { doListStations(ALL_SET); return; } else if (llListFindList(cmdLsCur, testFind) != -1) { doListStations(CUR_SET); return; }
else if ((integer)message > 0 && (integer)message < 256) { curIdx = (integer)message - 1; string newURL = llList2String(_radioURLs, curIdx); string newDesc = llList2String(_radioStations, curIdx); llSay(0, "setting station " + message + ":"); llSay(0, newDesc + " = " + newURL); llSetParcelMusicURL(newURL); } } }
but now just keeps coming up with the "Object: d,e" message
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-16-2009 22:57
lets take it a step at a time.... first because abc... was just an example, lets replace one of those with your name list white = ["Krissie Lemon", "b", "c", "d", "e", "f"]; //- gas tank prefilled, because we don't have our filling nozzle built in yet next is that touch event you replaced... some of the things in there are useful, and we want them... some we need to replace.... touch_start(integer touchNumber) { //-- this is the part that cecks if an av is allowed, so we want to use our version instead integer ListLength = llGetListLength(OKAvatars); //OKAvatars is your name list integer i; for (i=0; i <= ListLength-1; ++i) { if (llDetectedName(0) == llList2String(OKAvatars, i)) { //-- this is the part we need to keep, it updates the station and pops up our dialog curStations(); //This is the line that's supposed to move to this new location llDialog(llDetectedKey(0), dispStationStr, theStations, 93);// } } }
now in the example, we need to tweak one thing, and remove the stuff we don't need touch_start(integer touchNumber) { integer index = llListFindList( white, [llDetectedName( 0 )] ); //-- tweaked here to get the name of the toucher from the touch event if (index != -1) //-- is it in there? (-1 means no) { //-- and now we don't need this part, because it just tells us what we found... but we only care if it WAS found list three_four = llList2List( white, index, index + 1); //-- get our bit of searched for fuel, and the bit after it llOwnerSay( llDumpList2String( three_four, "," ) ); //-- tell us what kind of fuel was in there? // Object: d,e } }
then you put those together by taking the first highlighted section, and putting it in place of the second highlighed sectio and get touch_start( integer touchNumber ){ integer index = llListFindList( white, [llDetectedName( 0 )] ); if (index != -1){ curStations(); llDialog( llDetectedKey( 0 ), dispStationStr, theStations, 93 ); } }
_____________________
| | . "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... | - 
|
|
Krissie Lemon
Registered User
Join date: 14 Feb 2009
Posts: 4
|
07-19-2009 06:24
Hi Void, thankyou very much but still can't get it to read names from the white list note card
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-19-2009 06:40
you need to check the second page referenced which, for ease of incorporation you could include as a state between default and the working state (cince the original default already has a notcard reader for the stations) with appropriate changes in the state < insert name here >.
_____________________
| | . "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... | - 
|