satyajitdas20 Posted July 15, 2023 Share Posted July 15, 2023 (edited) Hi, First of all apologies, i know this might be very basic but I am learning scripting, so asking stupid questions. I am trying to make a simple contact giver script. When the object is clicked, it should show a pop up menu with a list of contacts which are meant to be shown. Something like the image i have uploaded. So I am using a URL giver script and trying to modify it. (The second picture here). What i have figured out is in place of URL, we can enter secondlife:///app/agent/UUID/about. 1. However, my script shows 'Go to page' and 'Cancel' instead of just the 'Ok' button. I dont see any button in the script, so how do I modify it. 2. Also, how do i change the color of the string info = " " text from the default white to black. 3. And the third line in the pop up says 'Owner of the object' without any line in the script that asks it to be displayed. How do i remove this line? Thanks in advance Jason. default { touch_start(integer num_detected) { key id = llDetectedKey(0); integer avatarInSameSim = (llGetAgentSize(id) != ZERO_VECTOR);// TRUE or FALSE if (avatarInSameSim) { string info = "Visit the Second Life website!"; // must start with either "http://..." or "https://..." string url = "secondlife:///app/agent/6614770b-0cc3-4c07-98a3-21e07d45fd4b/about"; llLoadURL(id, info, url); } else { llInstantMessage(id, "I can only open a URL dialog on your screen if you're in my sim!"); } } } Edited July 15, 2023 by satyajitdas20 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted July 15, 2023 Share Posted July 15, 2023 (edited) All popups from llLoadUrl will have the "Go to page" and "Cancel" buttons. These can't be changed. The popup in the first image uses llDialog with an empty list of buttons. The "OK" button is shown by default when the list of buttons is empty. The "Ignore" button is always shown for llDialog popups. The three profile links are written in the "message" part of llDialog, something along the lines of: default { touch_start(integer total_number) { string message = "Firstname Lastname\nsecondlife:///app/agent/6614770b-0cc3-4c07-98a3-21e07d45fd4b/about\n\nFirstname Lastname\nsecondlife:///app/agent/6614770b-0cc3-4c07-98a3-21e07d45fd4b/about\n\nFirstname Lastname\nsecondlife:///app/agent/6614770b-0cc3-4c07-98a3-21e07d45fd4b/about"; llDialog(llGetOwner(), message, [], 0); } } If you want something that's a lot easier to maintain, you should make a function that writes each line based on a given name/UUID. You could also use lists. list stuff = [ "Jason", "secondlife:///app/agent/6614770b-0cc3-4c07-98a3-21e07d45fd4b/about", "Nina", "secondlife:///app/agent/779e1d56-5500-4e22-940a-cd7b5adddbe0/about" ]; string message = llDumpList2String(stuff, "\n"); llDialog(llGetOwner(), message, [], 0); Edited July 15, 2023 by Wulfie Reanimator Link to comment Share on other sites More sharing options...
satyajitdas20 Posted July 15, 2023 Author Share Posted July 15, 2023 @Wulfie Reanimator Thanks, yes. Both of them worked. I find the second one better organized. That's the difference between the quality of scripting. Bothe the scripts solve the purpose but the second one is better. Thanks for teaching! 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