Jump to content

Talitha Midal

Resident
  • Posts

    21
  • Joined

  • Last visited

Posts posted by Talitha Midal

  1. Hey everyone.  This is how I wrote my script, I have tried it several times and it just isn't working.  It doesn't even show the pointy finger as the specific avatar hovers over it.  It is really odd!  What am I missing? lol  It has to be something so obvious...  I'd be so grateful for any further help...

    string item = "Photo1";
    key id = "xxx-xxx-xxx-xxx";
    string name = "Jo Bloggs";

    default
    {
        touch_start(integer total_number)
        {  
            llGiveInventory(id, item);
            llInstantMessage(id, "Here is a photo.");  

        }
    }

  2. Hi Dora


    Thank you for your reply :)  I have the key for the avatar.  I have set up the touch_start event.  Put in place the llGiveInventory & llInstantMessage functions in place.  I even put some variables at the top because I was thinking I would need to store the key Id up there somehow... I'm missing a link.  I'm not sure what...or how to get the key ID into the script so that it works...

     

    string message = "Here is a photo.";
    string item = "Photo1";
    key id = "XXX-XXX-XXX-XXX";
    string name = "Jo Bloggs";


    default
    {
        touch_start(integer total_number)
        {
            llGiveInventory(llDetectedKey("XXX-XXX-XXX-XXX"), item);
            llInstantMessage((string)name, message);  

        }
    }

  3. Hi. 

    Despite dipping my fingers into scripting every so often, I am still very new to it.  I was trying to make a script that when you touch a box it will Instant Message and give an item in its inventory to a specified avatar (either via avatar name or their key ID).

    I have been playing with llDetected Key(0) and trying to set key ID and string name variables but I haven't made a script set for a specific avatar before.  Could anyone leave me any tips or point me in the right direction?

    Many thanks :)

     

     

  4. Oh! I am so so sorry... The prim I had it on was a flat square and I hadn't realised that the surface it was working on was therefore not visible. After your last post, I went Inworld and expanded the cube and found that it is all fine. Thank you so much for highlighting that point and sorry again for having wasted anyone's time... Ooops!

  5. The * * around that section of script were to highlight the section that I hadn't been able to add in, as it keeps telling me I have an error. The part beneath that section is the script as I have it currently - saved successfully but not working.

     

    list textures = ["d495d72a-b17f-3042-c326-5e0b143acda1",
    "1f2989c3-08df-e376-ee74-7ee625fe30ef",
    "c6ce3ff0-e468-7b7c-8275-ff04b49ffef6"];

    integer textures_number;
    integer current_index;

    default
    {state_entry()
        {
            llSetTimerEvent(30);
          textures_number = llGetListLength(textures);
        }
        timer()

    {
        llSetTexture(llList2String(textures,current_index),0);
          if(++current_index >= textures_number)
            current_index = 0;
        }

    }

  6. Hi. I am trying to add a timer element to a texture change script I have. So that rather than being a touch change, it becomes a change every Xseconds. The script below saved successfully but doesn't work. This section of script* hasn't been added in yet but when I try to place it... the whole script complains and won't save. I have played with different ways but now I am unsure what I am doing wrong. Can anyone help?

    * {
          textures_number = llGetListLength(textures);
        }*

     

     

    list textures = ["d495d72a-b17f-3042-c326-5e0b143acda1",
    "1f2989c3-08df-e376-ee74-7ee625fe30ef",
    "c6ce3ff0-e468-7b7c-8275-ff04b49ffef6"];

    integer textures_number;
    integer current_index;

    default
    {state_entry()
        {
            llSetTimerEvent(30);
          textures_number = llGetListLength(textures);
        }
        timer()

    {
        llSetTexture(llList2String(textures,current_index),0);
          if(++current_index >= textures_number)
            current_index = 0;
        }

    }

  7. Hi

    I found a free use mailbox script online and have been tinkering with it inworld. It works well but I am not very good at reading script yet. It is early learning days still.

    I am not sure whether it is possible to change it to be multiple owner/manager so that I can set an access list of people who can pick up/read/delete the notecards. If anyone could give me some pointers... it might be that I need to start from scratch. I saw the ID == llgetowner and wondered if I could put in av keys there somehow?? Bit lost honestly!

    Thanks, Tali

    list lMail = [];
    // column 1 = notecard name, column 2 = read by user
    integer     MAIL_UNREADED = 0;
    integer     MAIL_READED = 1;
    integer     DIALOG_CHANNEL = 49383;
    list        DIALOG_CHOICE =
                    ["Unread",
                     "Read",
                     "Delete"];
    integer nLastCardCount = 0;
    integer nLastItemCount = 0;

    TxtRefresh()
    {
        // show the unreadable notecard
        integer nTotalCard = 0;
        integer nNotReaded = 0;
        integer nCount = 0;
        for (nCount = 0; nCount < llGetListLength(lMail); nCount += 2)
        {
            if (llList2Integer(lMail, nCount + 1) == MAIL_UNREADED)
                nNotReaded += 1;
            nTotalCard += 1;
        }

        // total string
        string cPost = (string)nTotalCard + " card";
        if (nTotalCard > 1) cPost += "s";
        cPost += " posted";

           // unreaded string
        string cUnreaded = (string)nNotReaded + " unread";
        llSetText("Suggestion Box!\n" + cPost + "\n" + cUnreaded, <.95, .75, 0>, 1);
    }

    default
    {
        state_entry()
        {
           // Allowing dropping of object
           llAllowInventoryDrop(TRUE);
           llListen(DIALOG_CHANNEL, "", NULL_KEY, "");
           nLastCardCount = llGetInventoryNumber(INVENTORY_ALL);
           nLastItemCount = llGetInventoryNumber(INVENTORY_NOTECARD);

           // Auto complete list
           integer nCardCount = llGetInventoryNumber(INVENTORY_NOTECARD);
           integer n_CurObj = 0;
           string c_Name = "NotEmpty";
           while (c_Name != "")
           {
                c_Name = llGetInventoryName(INVENTORY_NOTECARD, n_CurObj);
                n_CurObj += 1;
                if (c_Name != "")
                {
                    lMail += [c_Name];
                    lMail += MAIL_UNREADED;
                }
            }
            TxtRefresh();
        }

        touch_start(integer total_number)
        {
            llSay(0, "Drop a notecard to be sent to MY OWNER.");
    //---- Change MY OWNER above to suit your likes and needs.   //
            // if owner
            key id = llDetectedKey(0);
            if (id == llGetOwner())
            {
                // Show a dialog
                llDialog(id, "What do you want to do ?", DIALOG_CHOICE,
                  DIALOG_CHANNEL);
            }
        }

        listen(integer channel, string name, key id, string message)
        {
            if (llGetOwner() == id && llListFindList(DIALOG_CHOICE,
               [message]) != -1)
            {
                integer i;
                string cName;
                list lRemove;
                integer nStatus;
                for (i = 0; i < llGetListLength(lMail); i += 2)
                {
                    cName = llList2String(lMail, i);
                    nStatus = llList2Integer(lMail, i + 1);
                    if (message == llList2String(DIALOG_CHOICE, 0)
                       && nStatus == MAIL_UNREADED)
                    {
                        // open un-readed
                        llGiveInventory(id, cName);
                        // mark for readed
                        lMail = llListReplaceList(lMail, [MAIL_READED],
                            i + 1, i + 1);
                    }
                    if (message == llList2String(DIALOG_CHOICE, 1)
                       && nStatus == MAIL_READED)
                    {
                        // open readed
                        llGiveInventory(id, cName);
                    }
                    if (message == llList2String(DIALOG_CHOICE, 2)
                       && nStatus == MAIL_READED)
                    {
                        // delete readed
                        llSay(0, cName);
                        llRemoveInventory(cName);
                        lRemove += i;
                    }
                }
                // remove from the list
                if (llGetListLength(lRemove) > 0)
                {
                    integer k;
                    for (k = 0; k < llGetListLength(lRemove); k++)
                    {
                        i = llList2Integer(lRemove, k);
                        lMail = llDeleteSubList(lMail, i, i+1);
                    }
                }
                TxtRefresh();
            }
        }

        changed(integer change)
        {
            // dont accept other than a notecard
            integer nItemCount = llGetInventoryNumber(INVENTORY_ALL);
            if (nItemCount < 2)
            {
                // clear the list
                lMail = [];
            }

            if (nItemCount != nLastItemCount)
            {
                // delete other item type than notecard
                string cName = "NotEmpty";
                integer nCurObj = 0;
                integer nObjType = INVENTORY_NONE;
                list lRemove = [];
                while (cName != "")
                {
                    cName = llGetInventoryName(INVENTORY_ALL, nCurObj);
                    nCurObj += 1;
                    nObjType = llGetInventoryType(cName);
                    if (nObjType != INVENTORY_NOTECARD)
                    {
                        // add for deletion, its not a notecard
                        lRemove += cName;
                    }
                }

                // delete other object than notecard
                integer nD = 0;
                for (nD = 0; nD < llGetListLength(lRemove); nD += 1)
                {
                    // dont remove this script !
                    cName = llList2String(lRemove, nD);
                    if (cName != llGetScriptName() && cName != "")
                    {
                        llSay(0, "Sorry but " + cName + " is not a notecard.");
                        llRemoveInventory(cName);
                    }
                }

                // search for a new notecard
                integer n_CurObj = 0;
                string c_Name = "NotEmpty";
                while (c_Name != "")
                {
                    c_Name = llGetInventoryName(INVENTORY_NOTECARD, n_CurObj);
                    llSay(0, c_Name);
                    n_CurObj += 1;
                    // search for this card
                    if (llListFindList(lMail, [c_Name]) == -1 && c_Name != "")
                    {
                        // ok its a new card
                        lMail += [c_Name];
                        lMail += MAIL_UNREADED;
                        llSay(0, c_Name + " added to the mailbox.");
                    }
                }
            }
            nLastItemCount = llGetInventoryNumber(INVENTORY_ALL);
            nLastCardCount = llGetInventoryNumber(INVENTORY_NOTECARD);
            // refresh the text
            TxtRefresh();
        }
    }

     

  8. Thanks for the help.

    I think I might have been having inworld issues as I got stuck for ages trying to re-open the script. I have cleaned it up now and it is working again :)

    The script did have the UUIDs of the textures in inworld, so that wasn't the problem. Just SL.

  9. I should have known it would be a rogue bracket, now I feel silly. LOL.

    You mention indenting brackets and I have noticed how scripters do that. But I wasn't sure when to indent and when not to, as some of the brackets seem in line with each other.

     

    (I seem to be having inworld issues now trying to open the object and the script I am working on)

  10. I've been tinkering around with the script I set out to create in this thread and have hit a stumbling block. I wanted to see if I could make it so that only I, as owner, could change the texture. This came about when I realised that if I wanted to control it, rather than visitors changing the texture all the time, I needed to add something.  I visited the College of Scripting and did some wiki searching etc. I got this far. It accepts the script and saves it but then nothing happens, no texture changing anymore. I think I am missing a chunk but am not sure what. Can anyone help me along?

     

    list textures = ["123"];

    integer textures_number;
    integer current_index;

    default
    {
        state_entry()
        {
          textures_number = llGetListLength(textures);
        }

        touch_start(integer detected_number)
        {if(llDetectedKey(0) == llGetOwner())
              {llSetTexture(llList2String(textures,current_index),0);
          if(++current_index >= textures_number)
            current_index = 0;
        }
    }
    }

  11. Thanks for your responses.

    I am a bit confused to be honest. I tried Ela's sample script to see if I could get my head around it but it didn't work either :/

    I have used this one in the past but this was to texture all faces and only has two textures to change between. I couldn't work out how to add more textures to it.

    Scripting seems very complicated!

     

    string texture1 = "cea52b00-76e6-aa12-782d-8e7b358a68e8";
    string texture2= "c5a81d0e-c425-2b07-577b-f1bf5bb5d1a0";
    float time = 0.0;
    integer side = ALL_SIDES;
     
     
    integer currentstate;
    switch(string texture)
    {
        llSetTexture(texture, side);
        currentstate = ~currentstate;
        llSleep(time);
    }
    default
    {
        touch_start(integer total_number)
        {
            if(currentstate)
                switch(texture1);
            else
                switch(texture2);
        }
    }

  12. Hello. I am just playing around with a script and there are no errors. I'm struggling as I don't know why it isn't working.

    I was hoping it would scroll through my list of texture UUIDs within the script on the top face of a cylinder whenever it was touched. Even better would be to have an owner only option but that is a little above me at the moment. Baby steps -

     

    If anyone could offer a suggestion I would be very thankful...

     

    list textures = ["b9e0fda4-7778-30f5-e666-aa4d649827eb",
    "d275783b-21ea-91ca-a613-c860ac009e28",
    "245c2a5b-5983-84e0-ee31-fb9ec5f0bfef",
    "d5d4bbfc-1fac-9b69-b2f7-ae3a5575ac96"];

    default
    {
        touch_start(integer detected_number)
    {
        llSetTexture("textures",0);
    }
    }

×
×
  • Create New...