![]() ![]() ![]() But if you're that skilled, you might as well store the text on a web service and get the text snippet count and text snippets from there. Be warned that changing the contents of the notecard and saving, stores the new content under a different UUID. If you know the UUID of the notecard, you can read from it as long as it's transferable (and not deleted). The notecard you are reading from does not necessarily have to be in the same prim. NcReqId = llGetNotecardLine(ncName, (integer)llFrand(numOfLines)) LlSay(PUBLIC_CHANNEL, "~!~ Unconfigured, check notecard ~!~") PUBLIC_CHANNEL has the integer value 0 But my problem is that when i add an item that have more than 24 characters it doesnt work. The script that i took works very well, i can add 22 items in the content tab of the prim. NcNumOfLinesReqId = llGetNumberOfNotecardLines(ncName) i took a script from the web, cause i needed a giver items script. If (change & (CHANGED_OWNER | CHANGED_INVENTORY)) CHANGED_INVENTORY has the integer value 0x01 (1) CHANGED_OWNER has the integer value 0x80 (128) reset script to make sure you have the current number of lines Put the name of your notecard as in the prim's inventory here. in this example from a notecard named "colors" SCRIPT within the same prim: // this script reads from a notecard which is named whatever you set in init NOTECARD named colors or whatever you set in the script: blue Following up on this second issue, why do you ask a question to get a random notecard line number and give an answer that provides a random within a range? And what will you do if the notecard changes? Change the code and the notecard? This seems to be redundant to me. The second issue with your code above is that you are not checking against CHANGED_INVENTORY and I'm not quite sure why you'd not do that. It skips the dataserver event, thereby reducing code complexity. Integer random = llFrand((integer)(max/2)) + llFrand((integer)(max/2)) string osGetNotecard (string name) This function directly reads the entire contents of a notecard if it exists within the task inventory, and dumps it into a string. If you want to make sure you have a more random number as there are known issues with the randomness of llFrand you could do (without checking whether the number is even or odd): integer max ![]() It's not clear why you do such unnecessary math with adding one and then substracting it again later in the answer you give yourself above. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |