Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

notecard reading

tucor Capalini
Registered User
Join date: 18 Jun 2007
Posts: 44
02-25-2008 18:17
OK, my mind is boggled yet again....
Im trying to get a script to read a notecard when touched by the owner. The touch filtering is no problem, reading a line of the notecard is no problem, reading all 5 lines is no problem.
Assigning each line to a seperate string however....bit of a problem.
This is fairly hacked up job of the example in the wikki.
and it constantly repeats after it is started.
any help is greatly appreciated!

Thank you
tucor

key kQuery;
integer iLine = 0;
string one;
string two;
string three;
string four;
string five;

default {

state_entry() {

kQuery = llGetNotecardLine("notecard", iLine);
//llSay(0,(string)kQuery);
}

dataserver(key query_id, string data) {

if (query_id == kQuery) {

if (data == EOF) {

llSay(0, "No more lines in notecard, read " + (string)iLine + " lines.";);

} else {

// increment line count
llSay(0, "Line " + (string)iLine + ": " + data);
if(iLine=0){one=data;}
if(iLine=1){two=data;}
if(iLine=2){three=data;}
if(iLine=3){four=data;}
if(iLine=4){five=data;}
iLine++;

kQuery = llGetNotecardLine("notecard", iLine); // read another line when you can

}
llSay(0," "+one+two+three+four+five);
}
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-25-2008 18:52
You need another = in your "if(iLine=" tests. Happens to all of us:)
_____________________
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
tucor Capalini
Registered User
Join date: 18 Jun 2007
Posts: 44
02-25-2008 19:08
You know whats really sad, is i made that mistake yesterday, only the opposite way. sheesh!!

Grazie molto!!!!
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-25-2008 19:12
From: tucor Capalini
Grazie molto!!!!

Prego!!
_____________________
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
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
02-25-2008 23:12
Instead of using five variables and unneccessary code to handle them I would suggest looking into using LISTS for this purpose.