Help with "hidden" communications
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-11-2006 02:45
From: Llauren Mandelbrot I never said anything about what listen channel the helmet would shout on. I had assumed that it would shout [in the user`s name] on a "private" channel, not on public-chat channel 0, exactly as the script already does.
If I were to do this, I would make the helmet change its name dynamicaly, unless there were good reason to not do so.
With my idea, only wearers of the helmet would hear the shouting, and they would hear it as normal object chat, but under the name of the original speaker Main reason for not dynamically changing name was that it was easier to code up  In reality I dont think it makes that much difference to the final output:- [12:34] Fred Avitar: Alpha Foxtrot Charlie, I`m in position! [12:34] COMMS HELMET : Fred Avitar : Alpha Foxtrot Charlie, I`m in position! But thats just my view. From: Llauren Mandelbrot After reviewing the script, I see one major flaw with Newgy`s latest script. It never sets up a listen for the open chat to transmit to other helmets. I would suggest adding OOOPS!Yes I own up,somewhere in the hacking around between Mine and Kator's version's the open chat listen was deleted. My only excuse was it was 1am my time!!!!!
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-11-2006 03:40
Although I'm not following the whole thread... a variation on Llauren's suggestion could work nicely, especially if the helmet is multi-prim.
Prims other than the route can be named, and speak with their own name. You rename the "mic"/respeaker prim *once* per owner to the owner's name. It shouts on your random channel with the owner's name directly.
The "earpiece"/relayer prim - if I'm understanding this thread (which I'm skimming after a very disrupted night's sleep so I might not be) you're essentially tying two helmets together by walkie-talkie more or less. When you make the link, change that prim's name until a new link is made. It's far less work on the prims, and although it adds a script I think it only adds one event (a link message) to the existing scripts, so it's hardly hugely high impact.
If you're opening multi-user chat channels you can still reduce the number of changes of name by simply renaming for each new speaker, it will probably be nicer to test if the name is the same as the current name (stored in the script, not by accessing llGetLinkName() is likely to be less impact on the server) and only resetting the name for a new speaker.
|
|
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
|
11-11-2006 06:30
jeeze you guys wake up early for meh... I live in PST so this real early...anyway I actually kinda like the stationary name seeing how I make the helmets no-mod in the first place... (should of stated that awhile ago though I was way too damn tired to remember that juicy tidbit of data) Because of the fact they are about 59 prims and if somebody was to try to resize them they would have to do it piece by piece so technically I've tried to make this a one-size-fits-all kind of thing then made the prims no-mod to prevent damage to the helmet. Now I belive that would completely invalidate the helmets ability to change its own name because it has no modify privs to itself correct?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-11-2006 07:27
I like Eloise Pasteur Idea of a mic and an ear piece, would be very easy to do. Not sure what the penalty is for changing object name? From: Llauren Mandelbrot in event state_entry(), if I`m reading the script right, and the script as posted is current. This is correct. After reviewing the script, I see one major flaw with Newgy`s latest script. It never sets up a listen for the open chat to transmit to other helmets. I would suggest adding ChatListen = llListen(0,"","",""  ; Reading Llaurens comments and revisiting the code with a few hrs sleep , heres a new version to play with. Fixes the broken chat and allows the chat to be turned on and off. Also integrated Llaurens name changing suggestion (I think) LLaurens suggestion was 3/4 correct, but as we only need to listen to the owner should be ChatListen = llListen(0,"",Owner,""  ; integer CommsChannel=4;
integer BroadcastChannel=300; integer BroadcastListen = 0; integer ChatListen = 0;
key Owner; string OwnerName;
Help() { llSetObjectName("Comms Helmet"); llOwnerSay("To turn the unit on use/" + (string)CommsChannel + "on"); llOwnerSay("To shut the unit off use/" + (string)CommsChannel + "off"); llOwnerSay("To send a message use normal chat"); llOwnerSay("To switch Channels use /" + (string)CommsChannel + "channel=xxxxx where xxxxx is the desired channel."); llSetObjectName(OwnerName); }
On() { Off(); llOwnerSay("Broadcasting On " + (string)BroadcastChannel); BroadcastListen = llListen(BroadcastChannel,"","",""); ChatListen = llListen(0,"",Owner,""); }
Off() { if(BroadcastListen != 0)llListenRemove(BroadcastListen); BroadcastListen = 0; if(ChatListen != 0)llListenRemove(ChatListen); ChatListen = 0; }
default { state_entry() { llSetObjectName("Comms Helmet"); Owner = llGetOwner(); OwnerName = llKey2Name(Owner); llOwnerSay("Comms Unit Online. Use Channel " + (string)CommsChannel + " to control. type Help for details"); llListen(CommsChannel,"",Owner,""); llSetObjectName(OwnerName); }
changed(integer change) { // something changed if (change & CHANGED_OWNER) { llOwnerSay("Detected New User, resetting"); llResetScript(); } }
listen(integer channel, string name, key id, string message) { list ldata = llParseString2List(message, ["="], [""]); string command = llToLower(llList2String(ldata,0) ); string value = llList2String(ldata,1); if(channel == BroadcastChannel) { // Check for Echo's of owner voice if(command != OwnerName) { llSetObjectName(command); llOwnerSay(value); llSetObjectName(OwnerName); } } else if(channel == CommsChannel) { string strlower = llToLower(message); if("help" == strlower) { Help(); } else if("on" == strlower) { On(); } else if("off" == strlower) { llOwnerSay("Switching Off."); Off(); } else { if("channel" == command) { // Always use a negative channel integer newchannel = (integer)value; if(newchannel > 0) newchannel = - newchannel; if(newchannel < 0) { BroadcastChannel = channel; On(); } } } } else if(0 == channel) { if(BroadcastListen != 0) { string str = OwnerName + "=" + message; llShout(BroadcastChannel,str); } } } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-11-2006 07:46
The more I look at this the more I think it lends itself to HUD driven comms system. Buttons for on/off and assigned channels. You could then have more than one active net at a time.
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-11-2006 09:23
I like Eloise Pasteur Idea of a mic and an ear piece, would be very easy to do. Not sure what the penalty is for changing object name?I think it may force a full object update. That is rumored to be laggy. Eloise`s idea would also require an additional script.Reading Llaurens comments and revisiting the code with a few hrs sleep , heres a new version to play with. Fixes the broken chat and allows the chat to be turned on and off. Also integrated Llaurens name changing suggestion (I think)Nope. Almost, but not quite. I`ve fixed that below. LLaurens suggestion was 3/4 correct, but as we only need to listen to the owner should be ChatListen = llListen(0,"",Owner,"" ;Correct. I missed that one. Here`s a revision of your latest version:integer CommsChannel=4; integer BroadcastChannel=300; integer BroadcastListen = 0; integer ChatListen = 0; key Owner; string OwnerName; Help() { llSetObjectName("Comms Helmet"); llOwnerSay("To turn the unit on use/" + (string)CommsChannel + "on"); llOwnerSay("To shut the unit off use/" + (string)CommsChannel + "off"); llOwnerSay("To send a message use normal chat"); llOwnerSay("To switch Channels use /" + (string)CommsChannel + "channel=xxxxx where xxxxx is the desired channel."); } On() { Off(); llSetObjectName("Comms Helmet"); llOwnerSay("Broadcasting On " + (string)BroadcastChannel); BroadcastListen = llListen(BroadcastChannel,"","",""); ChatListen = llListen(0,"",Owner,""); } Off() { // Don`t need double ifs, because we always toggle both at once? if(BroadcastListen != 0)llListenRemove(BroadcastListen); BroadcastListen = 0; if(ChatListen != 0)llListenRemove(ChatListen); ChatListen = 0; } default { state_entry() { llSetObjectName("Comms Helmet"); Owner = llGetOwner(); OwnerName = llKey2Name(Owner); llOwnerSay("Comms Unit Online. Use Channel " + (string)CommsChannel + " to control. type Help for details"); llListen(CommsChannel,"",Owner,""); llSetObjectName(OwnerName); } changed(integer change) { // something changed if (change & CHANGED_OWNER) { llSetObjectName("Comms Helmet"); llOwnerSay("Detected New User, resetting"); llResetScript(); } } listen(integer channel, string name, key id, string message) { if(channel == BroadcastChannel) { // Check for Echo's of owner voice if(command != OwnerName) // What`s this doing? The helmet can`t hear itself, can it? { llSetObjectName(name); llOwnerSay(message); } } else if(channel == CommsChannel) { string strlower = llToLower(message); if("help" == strlower) { Help(); } else if("on" == strlower) { On(); } else if("off" == strlower) { llOwnerSay("Switching Off."); Off(); } else { list ldata = llParseString2List(message, ["="], [""]); string command = llToLower(llList2String(ldata,0) ); if("channel" == command) { string value = llList2String(ldata,1); // Always use a negative channel integer newchannel = (integer)value; if(newchannel > 0) newchannel = - newchannel; if(newchannel < 0) { BroadcastChannel = channel; On(); } // What if the user tries to set the channel to zero? } } } else if(0 == channel) { if(BroadcastListen != 0) // What`s this for? On/Off already toggle the listen itself. { llSetObjectName(OwnerName); llShout(BroadcastChannel,message); } } } } Sorry about the formatting. I can never seem to get scripts to format properly here. Also, no guarantees that this even compiles, much less works.
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-11-2006 10:23
From: Llauren Mandelbrot Sorry about the formatting. I can never seem to get scripts to format properly here.  Also, no guarantees that this even compiles, much less works. If you are using Scite-EZ, I was having the same problem. Open the Global Options file and change tabsize from 4 to 1 at around line # 173. Keep the indent size at 4. It will not correct your existing files but any new scripts will look right, here in the forum or in a script in SL.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
|
11-11-2006 11:10
Oh bloody hell, disregard this... completely... ecchWell Lauren like I said though, because I sell the helmet itself as no-mod scripts inside will fail when trying to switch a object name in a no-mod item. So I fixed the compile issue and the echo issue and came out with this integer CommsChannel=4; integer BroadcastChannel=300; integer BroadcastListen = 0; integer ChatListen = 0; key Owner; string OwnerName; Help() { llOwnerSay("To turn the unit on use/" + (string)CommsChannel + "on"); llOwnerSay("To shut the unit off use/" + (string)CommsChannel + "off"); llOwnerSay("To send a message use normal chat"); llOwnerSay("To switch Channels use /" + (string)CommsChannel + "channel=xxxxx where xxxxx is the desired channel."); } On() { Off(); llOwnerSay("Broadcasting On " + (string)BroadcastChannel); BroadcastListen = llListen(BroadcastChannel,"","",""); ChatListen = llListen(0,"",Owner,""); } Off() { // Don`t need double ifs, because we always toggle both at once? if(BroadcastListen != 0)llListenRemove(BroadcastListen); BroadcastListen = 0; if(ChatListen != 0)llListenRemove(ChatListen); ChatListen = 0; } default { state_entry() { Owner = llGetOwner(); OwnerName = llKey2Name(Owner); llOwnerSay("Comms Unit Online. Use Channel " + (string)CommsChannel + " to control. type Help for details"); llListen(CommsChannel,"",Owner,""); } changed(integer change) { // something changed if (change & CHANGED_OWNER) { llOwnerSay("Detected New User, resetting"); llResetScript(); } } listen(integer channel, string name, key id, string message) { if(channel == BroadcastChannel) { // Check for Echo's of owner voice if(channel == BroadcastChannel) { integer check = llSubStringIndex(message,OwnerName); if(-1 == check) llOwnerSay(message); }
} else if(channel == CommsChannel) { string strlower = llToLower(message); if("help" == strlower) { Help(); } else if("on" == strlower) { On(); } else if("off" == strlower) { llOwnerSay("Switching Off."); Off(); } else { list ldata = llParseString2List(message, ["="], [""]); string command = llToLower(llList2String(ldata,0) ); if("channel" == command) { string value = llList2String(ldata,1); // Always use a negative channel integer newchannel = (integer)value; if(newchannel > 0) newchannel = - newchannel; if(newchannel < 0) { BroadcastChannel = channel; On(); } // What if the user tries to set the channel to zero? } } } else if(0 == channel) { if(BroadcastListen != 0) // What`s this for? On/Off already toggle the listen itself. { llShout(BroadcastChannel,message); } } } }
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-11-2006 13:09
If you are using Scite-EZ,I don`t. I use the script editor and Kate, but I don`t use either for scripts I post here. I use the Forum advanced WISIWYG editor for that. It *never* works the way I want, though, for script formatting. Oh bloody hell, disregard this... completely... ecch::giggle::Well Lauren like I said though, because I sell the helmet itself as no-mod scripts inside will fail when trying to switch a object name in a no-mod item.Quite right. I hadn`t taken that into consideration. Apologies.So I fixed the compile issue and the echo issue and came out with thisLike I just told Jesse in another thread, I`m too tired to think straight on this at the moment. I think I`ll let Mr. Out of Cheese Error have the honor of hacking at this next. Mebbe he can fix up the formatting, whilst he`s at it. I do note, however, that you failed to restore some stuff that I cut out when switching to the change-my-own-name method of operation. The current script fails to send on the original speaker`s name at all. I took all that out because it wasn`t needed, if the helmet changed its name. It is needed if the helmet does not change its name. Newgy? You`re on-line right now. It`s your turn.
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
|
11-11-2006 14:05
Yeah I would put more work into it but apparently I'm a walking, talking, flying mobile simcrasher thats trying to figure out just what attachment is causing every sim he tries to region cross into to crash like a rock....
So far I'm down to my AO in the area of HUD items...
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-11-2006 14:15
Eeek!
Also, I see that Newgate is off-line now. I wonder why he logged out of the Forums without chiming in here.
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-11-2006 14:54
From: Llauren Mandelbrot Eeek!
Also, I see that Newgate is off-line now. I wonder why he logged out of the Forums without chiming in here.
I went ahead and took the liberty of putting an APB out for him, called local hospitals and the drunk tank(just in case). Can't find him.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-11-2006 15:38
From: Llauren Mandelbrot Eeek!
Also, I see that Newgate is off-line now. I wonder why he logged out of the Forums without chiming in here.
From: Jesse Barnett I went ahead and took the liberty of putting an APB out for him, called local hospitals and the drunk tank(just in case).
Can't find him. ROFL Sorry didnt know it was compulsory..... I've been investigating a problem with a lift. Seems phantom doesnt apply to AV's anymore... Oh and Jesse, we dont have APB's over here...... From: Llauren Mandelbrot Like I just told Jesse in another thread, I`m too tired to think straight on this at the moment. I think I`ll let Mr. Out of Cheese Error have the honor of hacking at this next. Mebbe he can fix up the formatting, whilst he`s at it. I do note, however, that you failed to restore some stuff that I cut out when switching to the change-my-own-name method of operation. The current script fails to send on the original speaker`s name at all. I took all that out because it wasn`t needed, if the helmet changed its name. It is needed if the helmet does not change its name. Newgy? You`re on-line right now. It`s your turn.
Well Kator does seem to have reverted a few things. This is more like my version 3 rather than the most recent one, Although it is still heavily mangled in a few places. and no I'm not here to typeset for you guys......
|
|
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
|
11-11-2006 15:43
Well I finally broke down, modded it a bit and went with the name switch, HOWEVER, I am having other issues... This is listening to everybody, not just the owner. though I thought this might work. Perhaps using listener=llListen(CHANNEL,"",OwnerKey(),""); would work instead? integer LISTEN=TRUE; integer CHANNEL=2; integer listener; key Owner; start_listen() { llListenRemove(listener); if (LISTEN==TRUE) listener=llListen(CHANNEL,"",Owner,""); } hide_me() { llSetAlpha(0.0, ALL_SIDES); } show_me() { llSetAlpha(1.0, ALL_SIDES); } default { state_entry() { start_listen(); } on_rez(integer r) { start_listen(); } listen(integer channel, string name, key id, string msg) { if (msg=="open") { hide_me(); } else if (msg=="close") { show_me(); } } }
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-11-2006 15:59
From: Kator Bergson Well I finally broke down, modded it a bit and went with the name switch, HOWEVER, I am having other issues... This is listening to everybody, not just the owner. if (LISTEN==TRUE) LISTEN is alwasy true so why bother.... listener=llListen(CHANNEL,"",Owner,""); You never set the Owner Key so its using a NULL KEY which is every one.
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
I`m sorry...
11-11-2006 17:56
Newgy, glad we could entertain you. Well Kator does seem to have reverted a few things. This is more like my version 3 rather than the most recent one, Although it is still heavily mangled in a few places.As I told Kator, I took your then-latest script and edited in the name-change stuff, which may have reverted some of your code. Kator`s last version posted clearly derives from my edits. I apologize if I messed things up on you. I was only trying to help, at a time when you had logged out of the Forums for a while. [Little green button when on-line, grey when off-line.]
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Kator Bergson
I'm freakin out man!
Join date: 24 Nov 2005
Posts: 125
|
11-11-2006 18:35
Yeah somethin about me, I always make stuff harder than it has to be, but then it at least challenges me... heh
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-12-2006 02:21
From: Llauren Mandelbrot Newgy, glad we could entertain you. As I told Kator, I took your then-latest script and edited in the name-change stuff, which may have reverted some of your code. Kator`s last version posted clearly derives from my edits. I apologize if I messed things up on you. I was only trying to help, at a time when you had logged out of the Forums for a while. [Little green button when on-line, grey when off-line.] LLauren, My comment was certainly not meant as offensive/derogatory. My apologies for making you feel the need to apologise.  I'm not worried about 'messed up' code. If I was I'd never post here would I?  The stength of the forums is that anyone can give additional insights and add to the code. Kator, Post a current Latest version along with the list of issues and I'll have another play.
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
It`s cool.
11-12-2006 10:49
LLauren,Newgy,My comment was certainly not meant as offensive/derogatory.Nor was it taken as such.My apologies for making you feel the need to apologise. No apology needed. You made reference to stuff having been "reverted". I acknowleged that I may have been the one who reverted it [though I cannot be certain that it wasn`t Kator who reverted, as I didn`t vet Kator`s latest code that closely], and issued a friendly apology for any inconvenience I may have inadvertantly caused. I`m sorry I sounded like you needed to apologize for making me apologize. I'm not worried about 'messed up' code. If I was I'd never post here would I? Right. The stength of the forums is that anyone can give additional insights and add to the code.Indeed.Kator, Post a current Latest version along with the list of issues and I'll have another play.Like I said, the ball`s in your court for now.
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
11-12-2006 11:50
heehee I am in a playful mood today and couldn't help myself.
I apologise for Llauren apologising to Newgate for apologising to Llauren becaue Llauren apologised to Newgate.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-12-2006 12:24
heehee I am in a playful mood today and couldn't help myself. I apologise for Llauren apologising to Newgate for apologising to Llauren becaue Llauren apologised to Newgate.LOL! [Literally!]
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-12-2006 12:47
Damm Jesse beat me to it..... I apologise for being slow...... 
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-12-2006 13:00
Damm Jesse beat me to it..... I apologise for being slow...... ::giggle::
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
Newgy's version of Llauren's Version or Kator's version of Newgy's Version.......
11-12-2006 13:13
Based on the last comms script posted (I think) with corrections to the logic where things appear to have gone astray and incorporation of LLauren's comments... integer CommsChannel=4; integer BroadcastChannel=300; integer BroadcastListen = 0; integer ChatListen = 0;
key Owner; string OwnerName;
Help() { llSetObjectName("Comms Helmet"); llOwnerSay("To turn the unit on use/" + (string)CommsChannel + "on"); llOwnerSay("To shut the unit off use/" + (string)CommsChannel + "off"); llOwnerSay("To send a message use normal chat"); llOwnerSay("To switch Channels use /" + (string)CommsChannel + "channel=xxxxx where xxxxx is the desired channel."); if(BroadcastListen != 0)llSetObjectName(OwnerName); }
On() { Off(); llOwnerSay("Mic Active. Broadcasting On " + (string)BroadcastChannel); BroadcastListen = llListen(BroadcastChannel,"","",""); ChatListen = llListen(0,"",Owner,""); llSetObjectName(OwnerName); }
Off() { if(BroadcastListen != 0) { llListenRemove(BroadcastListen); llListenRemove(ChatListen); BroadcastListen = 0; ChatListen = 0; } llSetObjectName("Comms Helmet"); }
default { state_entry() { llSetObjectName("Comms Helmet"); Owner = llGetOwner(); OwnerName = llKey2Name(Owner); llOwnerSay("Comms Unit Online. Use Channel " + (string)CommsChannel + " to control. type Help for details"); llListen(CommsChannel,"",Owner,""); llSetObjectName(OwnerName); }
changed(integer change) { // something changed if (change & CHANGED_OWNER) { llResetScript(); } }
listen(integer channel, string name, key id, string message) { if(channel == BroadcastChannel) { // Check for Echo's of owner voice // Appears that Shouts do echo.....? if(name != OwnerName) { llSetObjectName(name); llOwnerSay(message); llSetObjectName(OwnerName); } } else if(channel == CommsChannel) { string strlower = llToLower(message); if("help" == strlower) { Help(); } else if("on" == strlower) { On(); } else if("off" == strlower) { llOwnerSay("Switching Off."); Off(); } else { list ldata = llParseString2List(message, ["="], [""]); string command = llToLower(llList2String(ldata,0) );
if("channel" == command) { string value = llList2String(ldata,1); // Always use a negative channel // And dont allow zero integer newchannel = (integer)value; if(newchannel > 0) newchannel = - newchannel; if(newchannel < 0) { BroadcastChannel = channel; On(); } } } } else if(0 == channel) { llShout(BroadcastChannel,message); } } }
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
11-12-2006 15:03
Newgy's version of Llauren's Version or Kator's version of Newgy's Version.......::giggle::Based on the last comms script posted (I think) with corrections to the logic where things appear to have gone astray and incorporation of LLauren's comments...Um, Newgy?Well Lauren like I said though, because I sell the helmet itself as no-mod scripts inside will fail when trying to switch a object name in a no-mod item.This means that my name-changing idea cannot be used. On the other hand...Well I finally broke down, modded it a bit and went with the name switch,...so I guess it`s OK after all... ...and what does happen if the user attempts to specify channel zero? Otherwise, it looks great!
By the way, if anyone uses this, would it be amis if I asked that the names of Llauren Mandelbrot, Newgate Ludd, and Kator Bergson were listed as contributing authors?
_____________________
- ninjafoo Ng Says:
November 4th, 2006 at 7:27 am We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?
|