Jump to content

OMG! Wow...llGetNotecardLine() works with a KEY even if not in the prim's inventory! But..


Love Zhaoying
 Share

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

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

Recommended Posts

Ok, so I won't go into why the subject line is such an awesome discovery for me.

Here's the "But..":  How can I check if a value is a valid key vs. Inventory item (in the prim)?

If I check with llGetInventoryType(using a key) it returns INVENTORY_NONE even though llGetNotecardLine() works.

I realize there are considerations for the asset permissions: the Notecard must have similar permissions to the script and object it is in..so I can't read a "full perms" notecard with a "no copy/no mod" script (unless I own both).

Here is my question put another way:

What I want to do is this in pseudocode:

if (notecardname appears to be a key) then

  read notecard line; // <== This does not result in an error even if the key is not a valid key..but it WORKS even if not in the prim's inventory.

else if (llGetInventoryType(notecardname)==INVENTORY_NOTE) // <== This only works if a name is passed, if you try a key OR an name not in inventory, then you get INVENTORY_NONE

  read notecard line;

else

  llOwnerSay("Notecard not found!"+notecardname);

 *EDIT* Yes, I know a notecard gets a new key/UUID every time it is edited.

Link to comment
Share on other sites

What is the question? You already know everything :)

Inventory functions are for inventory objects only and don't work for asset-uuid's.

If you want - for example - let your customers change settings by editing a notecard in their inventory and pass the uuid to the script - that will work. If they get the wrong uuid the script will throw an error. That will teach 'em. :D

Link to comment
Share on other sites

The real question is in two parts, I think:

a) Is there a way to check if I have what looks like a valid key, for a notecard that is not in inventory??

b) If the notecard read fails by UUID, is there any way at all to check for an error due to read failling (besides setting a timer and assuming timer going off meant that the read failed)?

 

Link to comment
Share on other sites

In answer to your first question, while LSL can tell you if something is a possible uuid  there's no way to test if it actually belongs to anything, and certainly not whether it's the uuid of a notecard or an avatar.

So I guess you're correct and the only way to tell if the uuid is that of a notecard is to set a timer and see if you get a response from the dataserver.

As you've probably realised, the notecard's uuid changes each time it's edited, so while the script can read a notecard in your inventory (as opposed to the prim's inventory) if it knows the uuid, if you ever edit the notecard, then that will break the script.

Link to comment
Share on other sites

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