Jump to content

What's Wrong with this Picture(script)


Tabris Daxter
 Share

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

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

Recommended Posts

Hey all,

the script following is an ALPHA version but I'm trying to make an Online detector.

Eventually it will be pulling the keys from a database looping through the keys and changing the status on the database.

the problem i think is in the dataserver event. i want it to get the name if the user is online but for debug purposes display the display name if offline.

key Data;
key Name;
key Display;
key Akey; // = "3ca3de18-e809-4d5d-a2fc-9336bd54688a";

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
    }

    touch_start(integer total_number)
    {
        Akey = llGetOwner();
        llSay(0, "Getting Agent Status");
        //Data = llRequestAgentData("3ca3de18-e809-4d5d-a2fc-9336bd54688a",DATA_ONLINE);
        Data = llRequestAgentData(Akey,DATA_ONLINE);
    }
    
    dataserver(key qID, string msg)
    {
        integer Status;
        //Display = llRequestDisplayName(Akey);
        if (qID == Data)
        {   
            if (msg == "1")
            {
                Status = 1;
                Name = llRequestUsername(Akey);
            }
            else if (msg == "0")
            {
                Status = 0;
                Name = llRequestUsername(Akey);
            }
            llSay(0,(string)Status);
        }
        else if (qID == Name)
        {
            if(Status == 1)
            {
                llSay(0, msg + " Is Online");
            }
            else if(Status == 0)
            {
                llSay(0, msg + " Is Offline");
            }
        }
    }
}

 help appreciated

Link to comment
Share on other sites

The LSL function:  llRequestAgentData(Akey,DATA_ONLINE); has been... neutered.

It should always return FALSE for anything except the script owners UUID. So your script here will likely serve no useful function.

---

But with help on your scripting problem, you're using a local variable outside of its logical namespace. Status won't ever be set to a value during else if(qID == name), because Status is always re-initialised at the start of dataserver (setting 'integer Status')

Solution is to hold Status in a global variable (outside of 'default') and ensure that it is reset to -1 before you request a new status (this way a failed dataserver won't leave an inaccurate status).

Link to comment
Share on other sites


Freya Mokusei wrote:

Thanks for this, too. Perhaps LL rolled back their decision to remove True Online Status from LSL. Is always tough getting accurate information about these things.

 The latest news, I think, is still Oz Linden's comment on SVC-4823 (Feb 29th)

 

  • Thank you for the excellent descriptions of problems with this proposed change.
  • We have decided to defer any change to llRequestAgentData until the important issues raised here have been addressed, especially those regarding delivery to off line users. It is very likely that any scripted object using this method to query agent presence will need to be updated when we do make changes, but we will make every effort to provide ample notice and to ensure that reasonable methods to solve the use cases described here are available.
  • Interested users are encouraged to Watch this issue and the LSL Scripting Forum for updates.
  • Note that usage of llRequestAgentData or any other mechanism to circumvent privacy protections as a viewer component is still prohibited by the Policy on Third Party Viewers.
  • Like 1
Link to comment
Share on other sites

the idea behind this script is as a centralised "server".

pinging each player then updating it on a website so the other players can see who is online and where they are (seperate script in the HUD. ie, player TP's and it shows last known location at region level not actual position)

but this script is in a location (home base) and "pulls down" a list of players checks the status then changes the status based on the result.

Link to comment
Share on other sites

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