Jump to content

EztliLyre

Resident
  • Posts

    4
  • Joined

  • Last visited

Posts posted by EztliLyre

  1. i found the problem and i feel like a massive derp now xD in this part:

               llMessageLinked(LINK_SET,0,"arousalSetText|"+tostring+"|"+"1"+"|"+nameo+" is booping their "+partnamea,"");            llMessageLinked(LINK_SET,0,"caeilarousalup|"+tostring+"|"+arousala+""+paparta,"");

    tostring is a variable i set to the person who is doing the clicking which is why it worked if i clicked it but not if someone else clicked it , to fix this i made another string variable called yournamea which is set as this:

                key yourname = llGetOwner();            string yournamea = (string) yourname;

    and i changed the final code to:

                if (llDetectedKey(0) == llGetOwner()) {            llMessageLinked(LINK_SET,0,"arousalSetText|"+yournamea+"|"+"1"+"|"+nameo+" is booping their "+partnamea,"");            llMessageLinked(LINK_SET,0,"caeilarousalup|"+yournamea+"|"+arousala+""+paparta,"");            }

    and now it finally works :3 thanks for trying to help by the way ^ 3 ^ its appreciated

  2. ive created a touch script that works 100% but the problem is it only works for me, if someone else clicks on something my characters wearing that has a touch script it doesnt work for them? been going over my code for a day and cant figure it out. did i do something wrong in my code? sorry if someone has already made a post on this when i searched i didnt see one. its gonna be a plugin for PA by caeil

    string configurationNotecardName = "config";
    key notecardQueryId;
    integer line;
     
    string papart;
    string partname;
    string arousal;
    string partnamea;
    string paparta;
    string arousala;
    key target;
    string tostring ;
    key yourname;
    string namea;
    string nameo;
    
    init()
    {
    //  reset configuration values to default
        papart = "noanim";
        partname = "mysterious object";
        arousal = "10";
     
    //  make sure the file exists and is a notecard
        if(llGetInventoryType(configurationNotecardName) != INVENTORY_NOTECARD)
        {
        //  notify owner of missing file
            llOwnerSay("Missing inventory notecard: " + configurationNotecardName);
        //  don't do anything else
            return;
        }
     
    //  initialize to start reading from first line (which is 0)
        line = 0;
        notecardQueryId = llGetNotecardLine(configurationNotecardName, line);
    }
     
    processConfiguration(string data)
    {
    //  if we are at the end of the file
        if(data == EOF)
        {
        //  notify the owner
            llOwnerSay("We are done reading the configuration");
     
        //  notify what was read
            llOwnerSay("The avatar papart is: " + papart);
            llOwnerSay("The partname is: " + partname);
            llOwnerSay("The arousal amount is: " + arousal);
     
        //  do not do anything else
            return;
        }
     
    //  if we are not working with a blank line
        if(data != "")
        {
        //  if the line does not begin with a comment
            if(llSubStringIndex(data, "#") != 0)
            {
            //  find first equal sign
                integer i = llSubStringIndex(data, "=");
     
            //  if line contains equal sign
                if(i != -1)
                {
                //  get name of name/value pair
                    string name = llGetSubString(data, 0, i - 1);
     
                //  get value of name/value pair
                    string value = llGetSubString(data, i + 1, -1);
     
                //  trim name
                    list temp = llParseString2List(name, [" "], []);
                    name = llDumpList2String(temp, " ");
     
                //  make name lowercase (case insensitive)
                    name = llToLower(name);
     
                //  trim value
                    temp = llParseString2List(value, [" "], []);
                    value = llDumpList2String(temp, " ");
     
                //  name
                    if(name == "papart")
                        papart = value;
     
                //  color
                    else if(name == "partname")
                        partname = value;
     
                     else if(name == "arousal")
                        arousal = value;
                //  unknown name
                    else
                        llOwnerSay("Unknown configuration value: " + name + " on line " + (string)line);
     
                }
            //  line does not contain equal sign
                else
                {
                    llOwnerSay("Configuration could not be read on line " + (string)line);
                }
            }
        }
     
    //  read the next line
        notecardQueryId = llGetNotecardLine(configurationNotecardName, ++line);
    }
    
    default
    {
            on_rez(integer start_param)
        {
            init();
        }
     
        changed(integer change)
        {
            if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
                init();
        }
     
        state_entry()
        {
            llSetTouchText("Boop!");
            init();
        }
     
        dataserver(key request_id, string data)
        {
            if(request_id == notecardQueryId)
                processConfiguration(data);
        }
         touch_start(integer total_number)
         {
             string partnamea = partname;
             string paparta = papart;
             string arousala = arousal;
                key target = llDetectedKey(0);
                string tostring = (string) target;
                key yourname = llGetOwner();
                string namea = llGetDisplayName(yourname);
                string nameo = llGetDisplayName(target);
                
                if (llDetectedKey(0) == llGetOwner()) {
                llMessageLinked(LINK_SET,0,"arousalSetText|"+tostring+"|"+"1"+"|"+nameo+" is booping their "+partnamea,"");
                llMessageLinked(LINK_SET,0,"caeilarousalup|"+tostring+"|"+arousala+""+paparta,"");
                }
                else {
                llMessageLinked(LINK_SET,0,"arousalSetText|"+tostring+"|"+"1"+"|"+namea+" is having their "+partnamea+" booped by "+nameo,"");
                llMessageLinked(LINK_SET,0,"caeilarousalup|"+tostring+"|"+arousala+""+paparta,"");
                }
        }
    }

     

  3. thanks for the help guys im gonna try this stuff, as for the "etc" part i was using a template code i found which was working perfeclty fine but as you said it doesnt make me say stuff it makes the object say stuff.

    an idea i just had is maybe make some kind of relay script in something that wont detatch that will hear a command from the removed object then relay it to the other stuff?

  4. ive been fiddling with this for a while never done coding on second life before. im trying to get this script to run when i take off and put on a object which it does but its supposed to then make me say a chat command in channel 5 to make another script do things

     

    default
    {
        attach(key attached)
        {
            
            if (attached == NULL_KEY)  // object has been detached
            {
                llSay(5,"soft");
                // etc.
            }
            else   // object has been //attached//
            {
                llSay(5,"hide");
                // etc.
            }
            
        }
    }

     

    basically what it should do is when object is attached make me say /5 hide and when object is detached make me say /5 soft

×
×
  • Create New...