Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Listen worked and then stopped

HatHead Rickenbacker
Registered Loser
Join date: 6 Nov 2006
Posts: 133
05-30-2007 06:17
Hello, I am very puzzled by an issue and would very much appreciate any insights/ideas.

I wrote a super simple chat repeater/intercom which listens on channel 0 and a negative channel number. The script shouts out any channel 0 chat it hears on a negative number channel and does an llSay for any shouted text it picks on that negative channel.

Here are the 2 involved scripts:

*********************
// Listen

default
{
state_entry()
{
llListen(-6523480, "", NULL_KEY, "";);
}
listen(integer channel, string name, key id, string message)
{
string new_message;
new_message = llGetSubString(message, 0, -1);
llSay(0, new_message);
}

on_rez(integer start_param)
{
llResetScript();
}
}

*********************
// Broadcast

default
{
state_entry()
{
llListen(0, "", NULL_KEY, "";);
}
listen(integer channel, string name, key id, string message)
{
llShout(-6523480, llKey2Name(id) + " says : " + message);
}

on_rez(integer start_param)
{
llResetScript();
}
}

*********************

I am using three objects with these 2 scripts across the intersection of 3 sims. It worked great until I accidentally made a copy of a repeater next to another in one sim causing a nasty loop spamming the chat. After fixing that, the object will no longer broadcast out chat to one of the sims although it will still listen (making it one way only) . This same object works in the other 2 sims fine.

No matter what I do - rename, copy a new instance, modify the script slightly, etc. - I cannot resolve this. Did this nasty loop trigger some sort of flag to prevent it from spamming again in that specific sim.

Thanks for any help!
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-30-2007 09:03
llShout has a range of 100m. Make sure the Listener is within 100m of the broadcaster, and check to make sure the running box is checked on all scripts.

Outside of that, I don't see any other reason it wouldn't work.
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
05-30-2007 09:10
you may want to try llRegionSay.

http://wiki.secondlife.com/wiki/LlRegionSay

it has no range within a region.
HatHead Rickenbacker
Registered Loser
Join date: 6 Nov 2006
Posts: 133
05-30-2007 09:36
Thanks for your replies - I appreciate it!

Talarus: Yes, all objects are within 100 meters of one another. Also, it is working one way but not the other so I know it is in range.

Gearsawe: It is cross-region so llRegionSay won't work in this situation. (Though I am very thankful for the new function!)
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
05-30-2007 11:09
you know now that think back try a positive channel number when shouting. I seem to have rememebr running into this problem once before. I shouldn't make a difference. but give it a try
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-30-2007 11:12
Have you double-checked to make sure the script is still running? There's a little checkbox on the lower-left of the script editing window...

edit: oops.. yeah, what Talarus said..
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
HatHead Rickenbacker
Registered Loser
Join date: 6 Nov 2006
Posts: 133
05-30-2007 12:30
Thanks again for your replies!

Meade: yup, all scripts have the run check box checked and are running.

Gearsawe: when I remove the negative sign from the broadcast channel to make it positive, nothing works at all (very odd). Incremented the channel numbers by 1 and still nothing. Put the negative sign back and it works (well kinda works, the issue with the one sim still remains).
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-30-2007 12:36
If you add a llSay (0, "yo!";) to the default state_entry on the one that's causing trouble, do you see the chat come out?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left