Jump to content

tracking who is typing in chat range


tugrot
 Share

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

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

Recommended Posts

hello im still pretty new. and i mostly just do RP stuff

what i am trying to do is make a script that posts the names of those around within the chat range to a wearable prim.

That way we know if a person is active or if they are waiting for their turn and just lost where in the turn order they are in.

Something simple like that what I have so far is this.  but it does not seem to be working what am I doing wrong?
 

 default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
  
timer() {
            if (llGetAgentInfo(llGetOwner()) & AGENT_TYPING)
            {
                    llSetAlpha(1.0, ALL_SIDES);
            }
            else
            {
                    llSetAlpha(1.0, ALL_SIDES);
            }
        }
}

Link to comment
Share on other sites

You are asking whether the wearer of the item (so thats you) is typing or not and in both cases you make the worn item visible!

you need to look at llGetAgentList to for this to get a list of avatars in the sim, filter  it on range and then decide whether they are typing. When they do you need to look at llOwnerSay to report the results to the wearer.

Contact me when you need more help

Marvin

  • Like 1
Link to comment
Share on other sites

22 minutes ago, tugrot said:

 default

{
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
  
timer() {
            if (llGetAgentInfo(llGetOwner()) & AGENT_TYPING)
            {
                    llSetAlpha(1.0, ALL_SIDES);
            }
            else
            {
                    llSetAlpha(1.0, ALL_SIDES);
            }
        }
}

in this script circumstance the alpha parameter needs to be toggled between 0 and 1
 

timer()
{
   integer isTyping = (llGetAgentInfo(llOwner() & AGENT_TYPING) == AGENT_TYPING;
   
   // if agent is typing then isTyping will be TRUE
   // if agent is not typing then isTyping will be FALSE

   // when isTyping == TRUE set alpha parameter to 0
   // when isTyping == FALSE set alpha parameter to 1
   // we do this by flipping the isTyping boolean value with the ! operator

   llSetAlpha(!isTyping, ALL_SIDES);
}

 

a note:

as you into roleplay then most people into roleplay use a TPV rather than the Linden Viewer, and in most TPVs like Firestorm, Catznip. etc there is a Preferences setting to display a "Typing..." text message above the person's head when they are typing. This message also displays in the IM box

so you might want to go down this path rather than script a method to do this

  • Like 1
Link to comment
Share on other sites

Marvin Benelli thank you, it was to display on the prim the list of names of those within chat range. the prim was to be worn by a person or likely may be at a location if nothing else. 

48 minutes ago, Marvin Benelli said:

You are asking whether the wearer of the item (so thats you) is typing or not and in both cases you make the worn item visible!

you need to look at llGetAgentList to for this to get a list of avatars in the sim, filter  it on range and then decide whether they are typing. When they do you need to look at llOwnerSay to report the results to the wearer.

Contact me when you need more help

Marvin

 

elleevelyn thank you for the input but not everyone will turn on such a function i just wanted something simple to let "us" the Rpers know if we need to remind or poke someone should they forget it is their turn to post. 

31 minutes ago, elleevelyn said:

in this script circumstance the alpha parameter needs to be toggled between 0 and 1
 

timer()
{
   integer isTyping = (llGetAgentInfo(llOwner() & AGENT_TYPING) == AGENT_TYPING;
   
   // if agent is typing then isTyping will be TRUE
   // if agent is not typing then isTyping will be FALSE

   // when isTyping == TRUE set alpha parameter to 0
   // when isTyping == FALSE set alpha parameter to 1
   // we do this by flipping the isTyping boolean value with the ! operator

   llSetAlpha(!isTyping, ALL_SIDES);
}

 

a note:

as you into roleplay then most people into roleplay use a TPV rather than the Linden Viewer, and in most TPVs like Firestorm, Catznip. etc there is a Preferences setting to display a "Typing..." text message above the person's head when they are typing. This message also displays in the IM box

so you might want to go down this path rather than script a method to do this

 

Link to comment
Share on other sites

12 hours ago, elleevelyn said:

Displaying a list of who is typing is quite a bit more involved

not really?

default
{   state_entry()
    {   llSensorRepeat("","",AGENT_BY_USERNAME,20.0,PI,5.0);
    }
    sensor(integer n)
    {   string text;
        while(~--n)
        {   key ID = llDetectedKey(n);
            integer typing = llGetAgentInfo(ID)&AGENT_TYPING;
            text = llDetectedName(n)+"\n"+text; // preppend because we're reading in reverse order of distance, want closest first.
            if(typing)
            {   text= "TYPING: "+text;
            }
        }
        llSetText(text,<0,1,0>,1.0);
    }
    no_sensor()
    {  llSetText("",<0,1,0>,0.0);
    }
}

Sensor only works for up to 16 (or is it 32?) people, and usually sorts by distance order. for more people or alphabetical order, would need to use llGetAgentList.

Edited by Quistess Alpha
  • Thanks 1
Link to comment
Share on other sites

16 hours ago, Quistess Alpha said:

not really?

yes really

meaning relative to the script OP posted, there is quite a bit more involved

it might de pretty trivial for you and me to write up OP's requirement, but i think it is non-trivial to OP given what they asked about and the script they posted

 

  • Like 1
Link to comment
Share on other sites

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