Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Notecard reading issues

Lorathana Eldrich
Registered User
Join date: 6 Apr 2006
Posts: 45
12-28-2006 21:03
I'm not really that great with scripting, but I am trying to get the llGetNotecardLine
To stop reading after a certain point, like I want to have it just read 10 lines and stop, not read the 10 lines, and continue on through the notecard lol

Does anyone have any clue how I can get around this?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-28-2006 21:37
Make a loop that executes 10 times, and read one line each time?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
12-29-2006 01:09
In the Dataserver Event condition llGetNotecardLine according to the number of lines read, or (I would suggest more typical) condition it according to some kind of exit string in the Notecard itself - for example "~exit".

CODE
dataserver(key query_id, string data)
{
if (query_id == dsQueryId) // only really required if processing more than one kind of DataServer request.
{
if (data != EOF && llToLower(data) != "~exit") // exit strategy 1
{
//do stuff

if (ncLine < 9) // exit strategy 2
{
++ncLine;
dsQueryId = llGetNotecardLine(NotecardName, ncLine);
}
else
{
llOwnerSay("...finished reading the Notecard.");
}
}
else
{
llOwnerSay("...finished reading the Notecard.");
}
}
}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
12-29-2006 01:10
Winter's suggestion is correct.
Each dataserver request is passed a line number which you manual increment to get the next. Just exit after the 10th.
EDIT : Pale's code shows this.
Lorathana Eldrich
Registered User
Join date: 6 Apr 2006
Posts: 45
12-29-2006 08:16
ok thanks :)

When the servers come back up I'll give it a go..thankyou very much.