Jump to content

Lost On Notecard Changes


Nova Enchantment
 Share

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

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

Recommended Posts

So I have googled this for hours and I just can't seem to find it. I know it can be done but I'm not sure where to start on it. I have my full script all ready set up just need a way to do this. So What I want to happen is for the script to reset only if the Notecard changes. So if I drop an item into the object I don't want it to reset ever time its changes Only when the notecard is updated. How would I go about that?

Link to comment
Share on other sites

It goes something like this:

key notecard_key;

default
{
    state_entry ()
    {
        notecard_key = llGetInventoryKey ("My notecard");
        // read notecard data
    }

    changed (integer changes)
    {
        if (changes & CHANGED_INVENTORY)
        {
            key new_notecard_key = llGetInventoryKey ("My notecard");
            if (new_notecard_key != notecard_key)
            {
                notecard_key = new_notecard_key;
                // read new notecard data
            }
        }
    }
}

 

Edited by KT Kingsley
Oops, forgot to save the new key
Link to comment
Share on other sites

You can't really check a certain notecard unless you check its number of lines, and each lines values,

but this might be kinda close....


integer invCount;
default
{
    state_entry ()
    {  invCount =  llGetInventoryNumber( INVENTORY_ALL );    // get new count on reset  
    }
    changed (integer changes)
    {
        if (changes & CHANGED_INVENTORY)
        {
            if(  llGetInventoryNumber( INVENTORY_ALL ) == invCount )  // if inv hasn't changed, its an update
            { llOwnerSay("NC update");
              llResetScript();              
            }          
        }
    }
}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1331 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...