Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pre-loaded Text Chat in Notecard? Help!

Morgan Underwood
Registered User
Join date: 24 Oct 2007
Posts: 13
04-24-2008 23:41
Hi- I'm trying to make a HUD that allows me to pre-load lines of frequently used chat text; I've got a script that *works* but I have to enter everything directly into the script itself. Can someone PLEASE point me in the right direction on how I can grab these text lines from a more easily-edited notecard?

I have a rather complicated item that does this, but the script is locked and I can't even attempt to reverse-engineer it! However, if it's any help, the notecard is set up like so:

Hello|Hello!
How|How are you?
Bye|Goodbye!

The HUD give a selection button with the first text listed, and when pressed it enters the text after the vertical line into chat.

If anyone can shed some light on this, or provide a sample notecard-reading script sample I'd VERY much appreciate it! Thanks in advance for your time and consideration--
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-25-2008 05:16
Try reading Notecard Reader Help needed
_____________________
I'm back......
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
04-25-2008 13:15
From: Mrc Homewood
CODE

key kQuery;
integer pause = 2; // delay between lines
integer iLine = 0;
default
{
touch_start(integer num) // touch to start reading notecard
{
llSay(0, "Reading notecard...");
kQuery = llGetNotecardLine("My Notecard", iLine); // "My Notecard" is default change to what you like
}

dataserver(key query_id, string data)
{
if (query_id == kQuery)
{
if (data == EOF)
{

llSay(0, "No more lines in notecard, read " + (string)iLine + " lines."); // omit this is feel like it

}
else
{
llSay(0,data);
llSleep(pause);
iLine++;
kQuery = llGetNotecardLine("My Notecard", iLine); // change "My Notecard" to what notecard you have like above

}
}
}
}


made that a good month ago, make a notecard line by line of what you wont it to say
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-25-2008 13:24
You may also want to mess around with Gestures if you haven't, in case you might want a non-script solution.
Morgan Underwood
Registered User
Join date: 24 Oct 2007
Posts: 13
04-26-2008 23:47
To clarify where I am and what I'm trying to do:

I'm wanting to be able to SELECT a particular line of text from a notecard, specifically a line that is user-changable (i.e., the user can enter whatever text he or she wants and the script will pick it up and send it to chat).

I have gotten as far as setting up demo menus and button texts and all- this is how my notecard is set up currently:

MENU DEFAULT
TEXT What would you like to say?
TOMENU MHELLO Hello

MENU MHELLO
TEXT What would you like to say?
TEXT 1. Hello!
TEXT 2. Hi!
TEXT 3. Hiya!
OPTION 1
OPTION 2
OPTION 3

(The OPTION buttons are labeled 1,2,3 in the menu)

What I want to be able to do is hit OPTION button #1 and pick up the "Hello!" behind TEXT 1 to be sent to chat.

I've gotten as far in the script as this (The llSetColor is leftover from the original script I'm working off of):

if (str=="MHELLO|1";) llSetColor(<1,0,0>,ALL_SIDES);
if (str=="MHELLO|2";) llSetColor(<0,1,0>,ALL_SIDES);
if (str=="MHELLO|3";) llSetColor(<0,0,1>,ALL_SIDES);

What do I use in the place of of the 'llSetColor' function? I'm sure it must be something related to 'llGetNotecardLine' but how do I tell it WHERE to pick up from? Remember I'm wanting the OPTION buttons to pull up and send to chat whatever text is listed for that button, whatever the user may enter.

Or, is there a separator involved in it as well? Such as OPTION 1|blahblahblah ? If so, still how do I tell the script where to pick up the text after the | separator?

ANY help on this will, as always, be greatly appreciated!
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-27-2008 03:10
Basically you need to read the notecard on start up and store the data internally in a list.
Then when an option is selected use the option number as an index into the list to obtain the correct data. Since its straighforward text use llSay...

Reading of the notecard was covered in the urls I gave you previously....
_____________________
I'm back......
Morgan Underwood
Registered User
Join date: 24 Oct 2007
Posts: 13
04-27-2008 08:56
Yes, I'm as far as that- but what is the sequence itself that I enter behind llGetNotecardLine in order to grab the text? llGetNotecardLine(???????)

then once I have that nailed down, what do I use in llSay to publish the grabbed text from GetNotcardLine? I mean, how do I send it FROM the llGetNotecardLine to llSay?

I dont' mean to sound like a dunce about it; I just don't have the experience yet with all of this
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
04-27-2008 09:37
From: Morgan Underwood
how do I send it FROM the llGetNotecardLine to llSay?

I dont' mean to sound like a dunce about it; I just don't have the experience yet with all of this

You don't, which is what Newgate was pointing out. You read the contents of the notecard into a list and then use the info like you are already using it in your existing script.
From: Morgan Underwood
I've got a script that *works* but I have to enter everything directly into the script itself.

Post this script here and we can help show you how to load the notecard into it.
_____________________
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