Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with Chat Object/Repeating script

Angelo Beauchamp
Registered User
Join date: 6 Jul 2008
Posts: 24
01-10-2009 05:19
Hi all - looking for some pointers with this one. What I want to create is a script which does the following ....

1, listen on a given channel (for ease of clarity in the specs, say Channel 23)
2. when something is said on this channel, say a series of predefined statements in open
3. finally, repeat what was said on Channel 23 in open chat
4. (probably) reset and get ready to go all over again.

The purpose of this is to assist in the hosting/running of trivia events, whereby the questionmaster/mistress (got to remain PC) simply copies the question from a notecard - obviously already prefixed with the "/23", and the script does an announcement of a forthcoming question, and then does a countdown to zero, before repeating the question.

Any hints, pointers would be appreciated, or if anyone knows of a script/device already in existance that would need just a little tweaking, that would do as well.

Many many thanks in advance
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-10-2009 10:44
Certainly. You'll want to keep track of what was said on channel "23" in a global variable. Also, when it is set, start a timer. The timer should keep track of where it is in its sequence, and when the last bit has been said, say what is stored in the global variable and then stop the timer. Then:

A.) If you want to queue up several such sequences to go one after the other, you'll want a list instead of a simple string variable.

B.) If you want to interrupt the last sequence when a new one is triggered, no complex logic should be necessary (the above desctiption should take care of it).

C.) If you want to keep a new sequence from being triggered while one is already progressing, add a little logic in the listen that is similar to that in the timer, or swtich to another state until the sequence is complete.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-10-2009 10:48
make it even easier on your host/ess and give them one that includes a notecard reader and works on touch. they drop in their question card, and on touch it reads the next line in the notecard....

there's plenty of examples of those on the forum

that will eliminate the need for filtering who can and cannot use the quiz device

if you insist on a separate device you can filter the chat based on llSameGroup in id, save the chatted message to last element of a global list variable and trigger a timer with a counter to give the count down messages based on the list index. remember to reset your counter and clear your timer on the last element.
_____________________
|
| . "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...
| -