Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script to Record Chat?

Sudane Erato
Grump
Join date: 14 Nov 2004
Posts: 413
01-29-2005 09:31
From: Adam Marker
You certainly could send an e-mail for each sentence or call to listen(), but you don't have to.

Another method: The "listen" script can send each sentence to a "collector" script in the same prim (via linkmessage). When the collector gets near the maximum size for an e-mail, it can send an e-mail and reset its collection. The catch is that you have to remember at the end to tell the collector to dump the non-full collection one last time.

p.s. and yes indeed, vote for "write to notecard" early and often

Interesting! So the contents of a variable (i.e. "Message";) can be written to another script? How do you do this? (Which function writes to a script?)

Or maybe the question is: in what container do you hold all the "messages"? Another variable, like a very long string? Can strings contain LR/CR's? And is there a max length to a string?
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
01-29-2005 10:21
From: Adam Marker
You certainly could send an e-mail for each sentence or call to listen(), but you don't have to.

Another method: The "listen" script can send each sentence to a "collector" script in the same prim (via linkmessage). When the collector gets near the maximum size for an e-mail, it can send an e-mail and reset its collection. The catch is that you have to remember at the end to tell the collector to dump the non-full collection one last time.

p.s. and yes indeed, vote for "write to notecard" early and often
  1. Every time a script sends an email, the script is frozen solid for 20 seconds.
  2. I would more recommend sending an email every X number of lines, or after llGetFreeMemory reaches something like 9000 or so, since the maximum length of an email might potentially be outside the 16kb memory space we're given to work with.


From: Sudane Erato
Interesting! So the contents of a variable (i.e. "Message";) can be written to another script? How do you do this? (Which function writes to a script?)

Or maybe the question is: in what container do you hold all the "messages"? Another variable, like a very long string? Can strings contain LR/CR's? And is there a max length to a string?


llLinkedMessage() (you know about Wiki right?)

And I'd store them as strings in a list. Much easier that way.
_____________________
</sarcasm>
Danny DeGroot
Sub-legendary
Join date: 7 Jul 2004
Posts: 191
01-29-2005 10:51
From: Sudane Erato
Interesting! So the contents of a variable (i.e. "Message";) can be written to another script? How do you do this? (Which function writes to a script?)

Or maybe the question is: in what container do you hold all the "messages"? Another variable, like a very long string? Can strings contain LR/CR's? And is there a max length to a string?


The link messaging function lets you pass any or all of:

(1) key,
(1) integer, and
(1) string

in a single message between two scripts.

To keep up with the listen queue, your listener script needs to do as little work as possible inside each listen event. Maybe prepend the avie's name and a colon to the message, and then pump out a linked message and get back to listening.

Your collector script would just append the transferred string to a working string. And embedded newlines do work, so something like

buffer += ("\n" + new_msg);

should work just fine.

String length is limited by the script's 8k workspace. In a script that isn't doing much of anything but testing max string lengths, you can get a single string to right around 5k long before the script tanks.

You'll want to send emails off a little more frequently than that, though...I *think* an email's body maxes out at somewhere around 4k, maybe a little smaller...and any email you send is system-prepended with four lines of additional data before transmission:

Object name
Origin sim and global grid position
Local position
empty line

...which factors into your available character count. I'm thinking you should get the container script storing about 3000, 3500 characters max and then sending it off and starting a new buffer.

-- danny d.
1 2