Doorbell / Türklingel für OS geändert (mit privat & public Einstellung)

3 Monate 2 Wochen her #16 von Copper Tomsen


  • Beiträge: 8

  • Geschlecht: unbekannt
  • Geburtstag: 22 Mai 2020
  • Mal schun ob ein script hier reinzukopieren ist. Ich habe das Original für SL bischen überarbeitet. Hat auch privat und public Funktion zur Auswahl:

    //Seamed to be a script for SL in original.So Copper Tomsen played a little with it in april 2021 to make it work in OS :-)
    // BASIC RING BUTTON
    // by buttbadger Mirabeau

    // Usage: When someone touches the doorbell, it rings and the toucher's name will be said in chat.
    // When the owner touches it, they can ring the bell or choose a Public and Private setting. (Private by default)
    // Private setting will send the notification in private IM in localchat. Only you can read it.
    // Public setting will send the notification in localchat, visible for everybody in range.

    // Like,
    // This script is open source and free. It can't be resold as it is. You can put it in part of your sales
    // as long as you keep the script in fullperm.

    // The title to display above the button. just leave "" if you don't want any
    string ringpanel = "Touch me to ring";

    // The door bell sound. By default it take the first sound available in the prim


    // This is the end of the thing the button will say if someone rings. The name of the clicker will be at the beginning, then its key: Everyone in chat range will hear
    string ringnotice = "is ringing at the door!";

    // Set this to TRUE if you want the notice to display for everyone around and not just you
    integer publicshout = TRUE;

    // Some other junk
    integer antispam;
    key userkey;
    key owner;
    list menuitems;
    integer channel;
    integer listener;

    ringing()
    {
            llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1.0);
            //llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1.0); // Uncomment if sound is not enough loud
            //llPlaySound(llGetInventoryName(INVENTORY_SOUND,0), 1.0); // Uncomment if sound is not enough loud
            
            if (antispam == FALSE) // That way, the button can still ring but it won't spam you with IMs
            {
                antispam = TRUE;
                llSetTimerEvent(60.0);
                if (publicshout == FALSE) llOwnerSay((llDetectedName(0)) + " " + ringnotice);  // It will say "Display Name (user name) is ringing at your door!" by default
                else llSay(0,(llDetectedName(0)) + (string)userkey + "/inspect " + ringnotice);
            }
    }

    default
    {
        state_entry()
        {
            antispam = FALSE;
            owner = llGetOwner();
            llSetText(ringpanel, <1,1,1>, 1.5);
        }
         on_rez(integer num)
        {
            // Reset script when rezzed
            llResetScript();
        }
        touch_start(integer total_number)
        {
            userkey = llDetectedKey(0);
            if (userkey != owner)  ringing();
            else state ownermenu;
        {
                llSay(0, "Staff contacted, if available, will arrive shortly!");
                llInstantMessage(llGetOwner(), llDetectedName(0) + " rang the bell (floor 2) at " + llGetRegionName());
              }
         }
     
        
        timer()  // ends the antispam timer
        {
            llSetTimerEvent(0.0);
            antispam = FALSE;
        }
    }

    state ownermenu
    {
        state_entry()
        {
            if (publicshout == TRUE) menuitems = ["Private","Ring!","CANCEL"];
            else menuitems = ["Public","Ring!","CANCEL"];
            channel = (integer)llFrand(99999);
            listener = llListen(channel, "", owner, "");
            llDialog(owner, "Doorbell menu\n\nPublic/Private: Choose if you get the notifications in private, or said in local chat.\nRing: Ring the doorbell!", menuitems, channel);
            llSetTimerEvent(30.0);
        }
        
        listen (integer channel, string n, key i, string m)
        {
            if (m == "Public")
            {
                publicshout = TRUE;
                llOwnerSay("Doorbell ringer's name and key will be sent in public chat.");
                llSetTimerEvent(0.0);
                llListenRemove(listener);
                state default;
            }
        
            else if (m == "Private")
            {
                publicshout = FALSE;
                llOwnerSay("Doorbell ringer's name will be sent as private IM in chat.");
                llSetTimerEvent(0.0);
                llListenRemove(listener);
                state default;
            }
        
            else if (m == "Ring!")
            {
                ringing();
                llSetTimerEvent(0.0);
                llListenRemove(listener);
                state default;
            }
        
            else
            {
                llSetTimerEvent(0.0);
                llListenRemove(listener);
                state default;
            }
        }
        
        timer()
        {
            llSetTimerEvent(0.0);
            llListenRemove(listener);
            state default;
        }
    }

    Bitte Anmelden oder Registrieren um der Konversation beizutreten.

    Ladezeit der Seite: 0.047 Sekunden
    Powered by Kunena Forum

    Aktuell sind 76 Gäste und keine Mitglieder online


    swissgrid.opensim.ch

    © Swissgrid 2018-2022 Impressum:
     Admin: Night Raven    Sili Gal
         CH-8952 Schlieren/ZH