Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A listen is still active in a script that is turned off

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-10-2006 16:47
Put this in a script and type:

/9 I am on and listening

Turn the script off and type:

/9 I and off and still listening

Turn back on the script and touch it. This is what you get:


[16:46] Object: I am on and listening, I am off and still listening

CODE

list test;

default {
state_entry() {
llListen(9, "", llGetOwner(), "" );
}
touch_start(integer num_detected) {
string say = llList2CSV(test);
llOwnerSay(say);
}
listen(integer channel, string name, key id, string message){
test = test + [message];
}
}
_____________________
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
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
12-10-2006 19:31
I think this is a side-effect of the goofy way that listens are implemented. Supposedly they work by periodically crawling the sim's chat buffer, so when you turn the script back on, it probably just starts looking where it left off before you stopped it. I had another script spam the chat before turning the script back on, and it didn't pick up any of my messages. Not really helpful, but interesting maybe.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
12-10-2006 20:39
Events are apparently added to a script's event queue even when the script isn't running. After "hearing" 64 lines of chat, the event queue would be full and it would hear no more until re-activated and those events in the queue are processed.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-11-2006 06:58
Reset the script before re-enabling.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Alidar Moxie
Registered User
Join date: 2 Dec 2005
Posts: 47
12-11-2006 09:30
would using llResetScript() alleviate this?
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
12-11-2006 10:28
From: Deanna Trollop
Events are apparently added to a script's event queue even when the script isn't running. After "hearing" 64 lines of chat, the event queue would be full and it would hear no more until re-activated and those events in the queue are processed.
Take the above script, say /9on, turn it off, and say /9off. Then add the following script to another object and click it. Notice that it uses a different channel and won't pass the id filter anyway. When it says done, say /9after and turn the script back on. You will get "on, after". If it worked the way you described, you would get "on, off" or "on, off, after".

CODE
default {
touch_start(integer total_number) {
integer i = 2048;
while ( i-- ) {
if ( (i % 50) == 0 )
llSetText( (string)i, <1,1,1>, 1.0 );
llSay(10, "Spam spam spam spam spam");
}
llOwnerSay("done");
}
}
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
12-11-2006 10:38
Has anyone tried using llListenControl(listen_handle,FALSE); before suspending the script to see if that stops listen events from queueing whilst asleep?