I need a simple script with a menu and 3 options.

Amigo Uriza

Too Old for This Job
Joined
Sep 22, 2018
Messages
45
Joined SLU
03-31-2010
SLU Posts
273
Hey, I'm moving my store from one place to another location and I need a custom script to tell customers who land in the old spot to move to the new location.

The idea is that when someone touches or steps on a prim ( that I will place in hte old location), a blue would menu appears on the top of the screen saying that Store has moved and offering 3 buttons.

1. Button: giving a landmark
2 Button: showing the new store location on the map.
3. Button: giving the url location in local chat.

If someone can at least give me the code for the menu options, I could probably handle the options myself copying code from other scripts.

Thanks in advance 🤗
 

Soen Eber

Vatican mole
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
2,882
Someone else will have to fill in the "show map" code, I'm on a tight schedule today and can't take the extra half hour to work it. The base of the code will be parsing the slurl to something llMapObject can use by parsing the SLURL for the region name and destination and converting the region name and destination.

You'll also need to dump in an LM to the contents tab and change the SLURL name in the script.

EDIT: Missed the part about someone walking over it to trigger. Any scripter should know how to do this with llVolumeDetect.

Code:
// Landmark giver - Soen Eber 4/12/19
// based on dialog script at http://wiki.secondlife.com/wiki/LlDialog

// change these values to whatever you wish
integer _delay   = 15;  // how long before the dialog times out
string  _dlg_msg = "Select how you wish to receive the landmark";
list    _btns    = ["Say SLURL", "Show Map", "Give LM"];

// You MUST replace this, otherwise you'll visit my (Soen Eber) lab!
string  _SLURL   = "http://maps.secondlife.com/secondlife/Bradmoor/235/48/556";

// don't change these
integer _ch;
integer _listener;
key     _id;

cleanup()
{
    llListenRemove(_listener);
    _id = NULL_KEY;
    llSetTimerEvent(0.0);
} 
default
{
    state_entry()
    {
        cleanup(); // shouldn't need to do this but let's be safe...
        
        // unique negative channel number based on obj key
         _ch = 0x80000000 | (integer)("0x"+(string)llGetKey()); 
    }
    touch_start(integer total_number)
    {
        _id = llDetectedKey(0);
        _listener = llListen(_ch, "", _id, "");
        llDialog(_id, _dlg_msg, _btns, _ch);
        llSetTimerEvent(_delay);
    }
    listen(integer chan, string name, key id, string msg)
    {
        if (msg == llList2String(_btns, 0)) {
            llSay(0, _SLURL);
        }
        else if (msg == llList2String(_btns, 1)) {
            llSay(0, msg+"show map stub");
        }
        else if (msg == llList2String(_btns, 2)) {
            llGiveInventory(_id, llGetInventoryName(INVENTORY_LANDMARK, 0));
        }
        else llInstantMessage(
            _id, 
            "Don't know how to handle response '"+msg+"'"
            +", contact "+llKey2Name(llGetOwner())+" for help"
       );
        cleanup();
    }
    timer()
    {
        llSay(0, "*menu timed out* -- touch again for menu");
        cleanup();
    }
}
 
Last edited:
  • 1Thanks
Reactions: Amigo Uriza

Amigo Uriza

Too Old for This Job
Joined
Sep 22, 2018
Messages
45
Joined SLU
03-31-2010
SLU Posts
273
THank you !!



Ok, I tried to pass this command inside hte lldialog, with no sucess.

Code:
llMapDestination("Bonaire Island",<128.0,187.0,23.0>,ZERO_VECTOR);
I guess there is something I'm missing to work.
For now I will use the example by clicking at least, it will bring the attention.
 

Soen Eber

Vatican mole
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
2,882
I'll finish it sometime tomorrow, right now a css assignment and quiz is killing me.

We'll talk about payment. I don't need Lindens, just product which would be free for you to pass on is fine. Send a LM and I'll see what I want. Bit of a fun task and one of those "I really should make one of these things..." projects.
 

Soen Eber

Vatican mole
VVO Supporter 🍦🎈👾❤
Joined
Sep 20, 2018
Messages
2,882
Haven't been able to finish this -- end of semester and swamped. Sorry.