Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Xyzzy Script for Group Only & Channel?

Happyholly Grigges
Registered User
Join date: 22 Dec 2006
Posts: 9
07-05-2009 10:10
Hello All,
I am learning or well trying to learn the Xyzzy script. I am still new to scripting and am getting frustrated trying to figure out how to set the Xyzzy script to group use only and on a channel. Can anyone point me in the right direction here? I have been researching and trying to figure it out on my own for a bit and I am just not getting.

default {
state_entry() {
llListen(100, "", llGetOwner(), "";);
}

listen(integer channel, string name, key id, string message)
{

Thank you for your time,
Holly
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-05-2009 11:54
The snippet you posted shows that your script is already listing on channel 100. If you want to listen on a different channel, just change that number in the llListen handle.

As for listening only to members of the group, all you have to do is add a tiny bit to the listen event. As written, your script will only listen to the object's owner, so try this instead ....

CODE

integer MyChannel = 100; // Set a different value for MyChannel if you want
default {
state_entry() {
llListen(MyChannel, "", NULL_KEY,"");
}

listen(integer channel, string name, key id, string message)
{
if (llSameGroup(id)) //If the avatar speaking is a group member ...
{
// Do a lot of stuff
}
else
{
llInstantMessage(id,"Sorry, I only listen to group members."); //Don't do stuff at all
}
}
}
_____________________
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
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-05-2009 12:51
note:

llListen( MyChannel, "", "", "" );

behaves identically to

llListen( MyChannel, "", NULL_KEY, "" );

but uses about 31 less bytes
_____________________
|
| . "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...
| -
Happyholly Grigges
Registered User
Join date: 22 Dec 2006
Posts: 9
07-05-2009 16:21
Thank you! Thank you! Thank you! Thank you!
I was using the right line, but *blush* had it in the wrong place. O-O

Thank you so much both of you for the help. I got what I needed working.

Holly :)