![]() This script is used in the tutorial Understand a simple script landmark notecard giver You can download this on a notecard or copy and paste it from here: //This script will automatically detect the name of you landmark and notecard. 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. A pretty simple freebee script that gives a landmark and a notecard to whoever touches the box. a user settable facelight with a HUD control script. Attach it to any HUD position and click it to control the face light. Be warned that changing the contents of the notecard and saving, stores the new content under a different UUID. This goes into a prim you can touch to get a menu. 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 NcNumOfLinesReqId = llGetNumberOfNotecardLines(ncName) 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. Integer random = llFrand((integer)(max/2)) + llFrand((integer)(max/2)) 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 |