Jump to content

Check if UUID


UbiquitousStudio
 Share

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

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

Recommended Posts

Hello I am trying to grab a UUID, I made a text dialog and the person can input the uuid they want to assign. I am just trying to make sure it's a UUID, I just don't know the best way to go about it. Here is a bit of script

 

default
{
    state_entry()
    {
        integer channel = -13572468;
        gListener = llListen( channel, "", "", "");
        llTextBox(ownerkey, "\nEnter the UUID of the avatar.", channel);
    }

    touch_start(integer total_number)
    {
        
    }
    
    listen(integer channel, string name, key id, string message)
    {
    
   // Want to check if message was uuid here.
        
    }
}

I could do llgetsubstring, and check if there is a - on the 9th letter, but I don't know if that's how all UUID's are or not. So I want to post here to be better safe then sorry.

Thanks!

Link to comment
Share on other sites

Yes, the 9th character is always a "-".  I think it is also always true that avatar UUIDs have a "4" as the 15th character.  If that is true, and if only avatar UUIDs have a "4" in that position, you should be able to verify that a particular UUID belongs to an avatar.

If you don't care whether it's an avatar's UUID but will just be satisfied that it's a valid UUID, you can always write

message = (key)message;if (message){    //This is a valid UUID}else{    message = NULL_KEY;}
Link to comment
Share on other sites

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