childhoodbestfriend489 Posted March 1, 2021 Share Posted March 1, 2021 Two freebie script examples required: Don't want to put down inventory item names in llDialogue script but it will show all inventory list. Don't want to put down all button names in llDialogue script but it will show all lines of notecard in a list. Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 1, 2021 Share Posted March 1, 2021 The simplest approach to this is to list all inventory items with an index number at the start of each line, or list all the notecard lines with an index number at the start of each line, and either have a dialogue with numbered buttons, or more sensibly, use llTextbox to allow the user to input the number of the item they are interested in. The biggest drawback with this method though is that for any reasonably-sized inventory or well-stuffed notecard they're going to be hit with a wall of text in their local chat window. Link to comment Share on other sites More sharing options...
Rolig Loon Posted March 1, 2021 Share Posted March 1, 2021 This is not the place to "require" free scripts. If you would like help with a script that you are writing, just ask. Show us what you have done and where you are stuck. Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 1, 2021 Share Posted March 1, 2021 "Please miss, I'm stuck" Where are you stuck? "I don't know where to begin" Sorry, couldn't resist it. 1 Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 1, 2021 Share Posted March 1, 2021 37 minutes ago, childhoodbestfriend489 said: Don't want to put down inventory item names in llDialogue script but it will show all inventory list. A pointer to get you started with this one. Look at the box-unpacker example Link to comment Share on other sites More sharing options...
childhoodbestfriend489 Posted March 1, 2021 Author Share Posted March 1, 2021 wrong script : default { state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { list b = []; integer n = llGetInventoryNumber(INVENTORY_ALL); integer x; do { b += llGetInventoryName(INVENTORY_ALL,x); } while (++x <++n); llDialog(llDetectedKey(0), "Please choose one of the below options:",b,0); } } Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 1, 2021 Share Posted March 1, 2021 (edited) Ok, so several things are preventing that script from doing anything: dialogs are limited in the number of buttons, so creating a list then requires you to split that list up into pages. Can be hard work. Have a look at The first example in llTextbox here , because it shows most of what I've suggested you try. My earlier suggestion about llTextbox would work a bit better. Instead of populating the list, each inventory name is chatted out or IMed to the toucher preceded by the string value of integer x. llWhisper(0, (string) x + " " + llGetInventoryName(..., x) ); They will see several lines of text with a number followed by a name. Then instead of llDialog, use llTextbox to ask the user to enter a number. After llTextbox( or indeed llDialog) you must have an llListen(...) call. After the touch event you must then have a listen event to catch their response. You have used channel 0 in your dialog call which means whatever the dialog outputs will get mixed up in local chat, it is far better to use a negative number for the channel in dialogs, say -142536, and then the listen you set up must also listen on this channel. Use an integer to store the listen handle returned by the call to llListen, because at the end of the listen event you will probably want to close that listen. Edited March 1, 2021 by Profaitchikenz Haiku 1 Link to comment Share on other sites More sharing options...
childhoodbestfriend489 Posted March 1, 2021 Author Share Posted March 1, 2021 And how to include permission in this wrong script: key teleportee; default { touch_start(integer num_detected) { string thisScript = llGetScriptName(); list inventoryItems; integer inventoryNumber = llGetInventoryNumber(INVENTORY_ALL); integer index; for ( ; index < inventoryNumber; ++index ) { string itemName = llGetInventoryName(INVENTORY_ALL, index); if (itemName != thisScript) { if (llGetInventoryPermMask(itemName, MASK_OWNER) & PERM_COPY) { inventoryItems += itemName; } else { llSay(0, "Unable to copy the item named '" + itemName + "'."); } } } if (inventoryItems == [] ) { llSay(0, "No copiable items found, sorry."); } else { llDialog(llDetectedKey(0), "\nPlease make a choice.",inventoryItems, 0); integer listenHandle = llListen(0, "", llDetectedKey(0), ""); // 3.0 seconds delay } } listen(integer channel, string name, key id, string message) { llTeleportAgent(teleportee, "message", <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>); } } Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 1, 2021 Share Posted March 1, 2021 (edited) In order to make this work reliably you should restrict the inventory search to type INVENTORY_LANDMARK so that there's no chance of trying to teleport somebody to a texture or an animation. You would need to request teleport permission for the teleportee, but there's no place in the script where teleportee is ever assigned a value to there's no chance of actually getting that permission. The actual permission is granted by llRequestPermissions(avatar_key, PERMISSION_TELEPORT) and so would then need to have a run_time_permissions event, in which the given permissions are tested, and that event is the correct place to then call llTeleportAgent. In the listen, when the toucher has chosen a landmark, you would need to request permissions for them. The destination landmark is therefore going to have to be a global variable to which the value of message in the listen event must be assigned. In your script you are instead trying to teleport somebody to a place called "message", a string literal. Do you really intend to teleport somebody to a null vector? (zero vector in a region is the corner of a sim and is a most uncomfortable place to find oneself). 128,128,26 is safe in that it is dead-centre of the sim and a reasonable assumption of a ground level. So, putting things all together, you also want a global variable destination, to which the value of message is assigned teleportee is assigned the value of id in the listen event. a call is then made to llRequestPermissions(teleportee, PERMISSION_TELEPORT) and in a new event run_time_permissions, you first check if PERMISSION_TELEPORT is set, run_time_permissions(integer perms) { if(perms & PERMISSION_TELEPORT) and if so, call llTeleportAgent with teleportee, destination ,<128,128,26>, ZERO_VECTOR as the parameters. Edited March 1, 2021 by Profaitchikenz Haiku 1 Link to comment Share on other sites More sharing options...
Fritigern Gothly Posted March 1, 2021 Share Posted March 1, 2021 (edited) Okay, I have to know now. You made 5 posts with the title "SLS_Help_Post_<number>". Are you really calling LSL (Linden Scripting Language) SLS? Or what else is SLS supposed to mean? Edited March 1, 2021 by Fritigern Gothly 1 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted March 2, 2021 Share Posted March 2, 2021 2 hours ago, Fritigern Gothly said: Are You really calling LSL (Linden Scripting Language) SLS? Or what else is SLS supposed to mean? I thought it was a play on LSL and SOS (Save Our Ship). Link to comment Share on other sites More sharing options...
Fritigern Gothly Posted March 2, 2021 Share Posted March 2, 2021 49 minutes ago, Quistessa said: I thought it was a play on LSL and SOS (Save Our Ship). *Save Our Souls 1 Link to comment Share on other sites More sharing options...
childhoodbestfriend489 Posted March 2, 2021 Author Share Posted March 2, 2021 I am trying force teleport Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 2, 2021 Share Posted March 2, 2021 You'll get there, just keep working on it 1 Link to comment Share on other sites More sharing options...
RunawayBunny Posted March 2, 2021 Share Posted March 2, 2021 On 3/1/2021 at 4:44 PM, childhoodbestfriend489 said: Don't want to put down inventory item names I don't understand what you mean but here is a example for displaying dialog box based on inventory listing: http://wiki.secondlife.com/w/index.php?title=User:Susie_Chaffe Credits: Susie Chaffe Link to comment Share on other sites More sharing options...
Bugs Larnia Posted March 3, 2021 Share Posted March 3, 2021 I'm not entirely certain about what you need with the inventory giver either, but I have a library giver (numbered buttons, legend in bluenote) here. Maybe that's a starting point? Link to comment Share on other sites More sharing options...
Profaitchikenz Haiku Posted March 3, 2021 Share Posted March 3, 2021 I was starting to get the idea, the object purports to be a giver of things, the clicker believes that they are getting a "short sharp thrill" thingy, but the sensation-seeker instead gets TP-ed into said short sharp thrill. It's going to fail on the popup box "da-da-da, an object owned by ... wishes to teleport your avatar into the bowels of hell", to which quite a few are going to say Oh no, not me you don't". But as a starter script it's quite a good one for finding out how to do things. Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now