Jump to content

Simple Contact Giver Script


satyajitdas20
 Share

You are about to reply to a thread that has been inactive for 296 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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!");
        }
    }
}

 

2023-07-15.png

2023-07-15 (1).png

Edited by satyajitdas20
Link to comment
Share on other sites

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 by Wulfie Reanimator
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 296 days.

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
 Share

×
×
  • Create New...