|
Maliki Lupindo
Registered User
Join date: 16 Jul 2008
Posts: 7
|
05-28-2009 23:03
I have a random note reader that reads a quote form a note card but need to expand it to read 3 notes and place like below, but cannot seem to make it happen.
reads currently one note card and returns random statement.
need
Read card 1, get random line Read card 2, get random line Read card 3, get random line
quote (say text) card 1 card 2 card 3 ex: Another(card 1) wonderful(card 2) mess(card 3)
need the cards to be read but put together a sentence. And I guess Im just not thinking or have the current brain capacity to do this. Another day goes by hmmmmm.
or would it make sense to put all in one notecard and have the script read form 3 secions and compile a single phrase?
looked and found no usable script cuts clips or other help so this is my last option, ask for help. :/
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-29-2009 00:42
why not just store what the cards have in a single read, then get random indexes from those lists?
or as was suggested in a recent thread about reading multiple cards, store the card names in a list, and use two counters... one for the notecard line, and the other (which changes on each EOF, or in your case, each call) contains the current notecard to read from.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
05-29-2009 01:01
I'd probably try to load it all into a strided list and then get the strings by stride.
|
|
Maliki Lupindo
Registered User
Join date: 16 Jul 2008
Posts: 7
|
05-29-2009 09:53
Thanks I will give it a try and see if I can manage, been 2 days now and 3 hrs sleep with code and more so gonna try sleep first. That might help 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-30-2009 00:24
From: ElQ Homewood I'd probably try to load it all into a strided list and then get the strings by stride. considering all three will be random (and theres no guarantee that all three will be the same length) it's probably better to composite from 3 saved lists
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Maliki Lupindo
Registered User
Join date: 16 Jul 2008
Posts: 7
|
05-31-2009 02:10
Thanks trying still to get multiple reads with random, little success on compiling
|
|
Rebekka Revnik
Registered User
Join date: 26 Mar 2008
Posts: 18
|
05-31-2009 03:55
Hi, please try these lines. The script reads 3 ncs and mixes the lines by touching. string NCNAME1 = "words1"; string NCNAME2 = "words2"; string NCNAME3 = "words3";
integer NCLine1; integer NCLine2; integer NCLine3;
key NCid1; key NCid2; key NCid3;
list WordList1; list WordList2; list WordList3;
integer Ready;
Init() { Ready = 0; WordList1 = []; NCLine1 = 0; NCid1 = llGetNotecardLine(NCNAME1, NCLine1++); WordList2 = []; NCLine2 = 0; NCid2 = llGetNotecardLine(NCNAME2, NCLine2++); WordList3 = []; NCLine3 = 0; NCid3 = llGetNotecardLine(NCNAME3, NCLine3++); }
default { state_entry() { Init(); } on_rez(integer start_param) { Init(); } changed(integer change) { if(change & CHANGED_INVENTORY) Init(); } dataserver(key req, string data) { if(req == NCid1) { if(data == EOF) { Ready++; if(Ready == 3) state Start; } else { WordList1 += [data]; NCid1 = llGetNotecardLine(NCNAME1, NCLine1++); } } else if(req == NCid2) { if(data == EOF) { Ready++; if(Ready == 3) state Start; } else { WordList2 += [data]; NCid2 = llGetNotecardLine(NCNAME2, NCLine2++); } } if(req == NCid3) { if(data == EOF) { Ready++; if(Ready == 3) state Start; } else { WordList3 += [data]; NCid3 = llGetNotecardLine(NCNAME3, NCLine3++); } } } } state Start { touch_start(integer total_number) { string s = llList2String(WordList1, (integer)llFrand(llGetListLength(WordList1))); s += " " + llList2String(WordList2, (integer)llFrand(llGetListLength(WordList2))); s += " " + llList2String(WordList3, (integer)llFrand(llGetListLength(WordList3))); llSay(0, s); } }
|
|
Maliki Lupindo
Registered User
Join date: 16 Jul 2008
Posts: 7
|
06-03-2009 08:24
Your the best Rebekka! **bows** From: Rebekka Revnik Hi, please try these lines. The script reads 3 ncs and mixes the lines by touching. [/QUOTE Thank you very very much I had gotten it to two but kept getting something wrong on the third. You have saved my hair alot of pulling  Thanks again, Maliki ---Think my issues were the EOF not being in the right postion in the script too
|