Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Notecard Reader

Jasmin Loire
Want to do my grading?
Join date: 4 Nov 2007
Posts: 68
02-09-2008 22:08
I've been looking for a script to put in a prim where, on touch, it will read you each line of a notecard.

I have a SpeakEasy HUD that I've rezzed and resized to do this task, however the script is no-mod so I cannot learn. I really want to learn how this script works.

I've googled and searched the forums, but all I can find are scripts that read specific lines from notecards to set paramaters of the script. I cannot wrap my brain around how to modify them to get it to read out each line of the notecard, one by one, in general chat.

Can anyone point me in the right direction? I figure it will have to do with setting something as a recursive variable.

Thanks in advance.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
02-09-2008 23:31
The first example script in http://wiki.secondlife.com/wiki/LlGetNotecardLine does just what you describe, so that would be the place to start! You just have to move it into a touch event.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-10-2008 00:29
You've seen how scripts get the lines. Instead of parsing them and setting variables based on the content, simply take the lines and communicate them with llOwnerSay(), llInstantMessage(), llWhisper(), llSay(), or llShout(). I listed those in order of decreasing SPAM potential (or script delay in the case of the first two), so I'd pick the first one from the list that will meet your needs.

For details, see:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llInstantMessage
http://www.lslwiki.net/lslwiki/wakka.php?wakka=chat
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-10-2008 00:33
By the way, you can add newlines to messages sent in the above ways, and with the character limits and maximum line size readable from a notecard you could probably safely spit out about 3-4 lines at a time. Adding a newline in a script would look something like:

CODE

string output = line1+"\n"+line2;
Jasmin Loire
Want to do my grading?
Join date: 4 Nov 2007
Posts: 68
02-10-2008 03:43
From: Viktoria Dovgal
The first example script in http://wiki.secondlife.com/wiki/LlGetNotecardLine does just what you describe, so that would be the place to start! You just have to move it into a touch event.


Ah, thank you. I'd seen that before and saw the "dataserver" portion so I figured that it was something that was specific to dataserver. However, that was the script that made me figure I had do use a recursive variable.

Thank you so much for helping me learn scripting :)