Jump to content

Looking For Simple Script


Nikole Messmer
 Share

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

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

Recommended Posts

I'm making an info board for a live singer and want to allow others to touch a button on the board which pops up a message box they can type a song request into that will then appear on the singer's screen as a blue dialog. I've poked around the LSL library but it seems a lot of them are limited to 20m distance or I'm looking at the wrong things. Can someone help?

 

thanks 

Link to comment
Share on other sites

10 minutes ago, Quistessa said:

If the singer and the button, or the button and the toucher are more than 20m apart you'll probably need some clever solutions.

well the board is sitting right next to the singer on-stage. the concern is for people more than 20m from the stage. unless maybe it gives a warning when they try to do it and it says they're too far away. that would probably work too. 

Link to comment
Share on other sites

The wiki is a bit confusing on what the distance limits are, but I did a teensy bit of testing and this seems like it might work, assuming the owner of the button is the singer:

integer gChannelTextbox=100;
uNotifyOwner(key From,string Notice)
{
    string text =
        "secondlife:///app/agent/"+(string)From+"/inspect"+
        " has sent you a message:\n"+
        Notice;
    //use one or both of the following 2 lines:
    llDialog(llGetOwner(),text,["OK"],-1);
    //llOwnerSay(Text);
}
default
{
    state_entry()
    {   llListen(gChannelTextbox,"",NULL_KEY,"");
    }
    touch_start(integer total_number)
    {
        llTextBox(llDetectedKey(0),
            "Send a message to "+"secondlife:///app/agent/"+(string)llGetOwner()+"/inspect .",
            gChannelTextbox);
    }
    listen(integer Channel,string Name,key ID,string Text)
    {
        uNotifyOwner(ID,Text);
    }
}

 

Edited by Quistessa
c type syntax highlighting, and a typo fix
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Quistessa said:

The wiki is a bit confusing on what the distance limits are, but I did a teensy bit of testing and this seems like it might work, assuming the owner of the button is the singer:


integer gChannelTextbox=100;
uNotifyOwner(key From,string Notice)
{
    string text =
        "secondlife:///app/agent/"+(string)From+"/inspect"+
        " has sent you a message:\n"+
        Notice;
    //use one or both of the following 2 lines:
    llDialog(llGetOwner(),text,["OK"],-1);
    //llOwnerSay(Text);
}
default
{
    state_entry()
    {   llListen(gChannelTextbox,"",NULL_KEY,"");
    }
    touch_start(integer total_number)
    {
        llTextBox(llDetectedKey(0),
            "Send a message to "+"secondlife:///app/agent/"+(string)llGetOwner()+"/inspect .",
            gChannelTextbox);
    }
    listen(integer Channel,string Name,key ID,string Text)
    {
        uNotifyOwner(ID,Text);
    }
}

 

outstanding! thank you so much! I'll give this a try tonight!

Link to comment
Share on other sites

I was just thinking that if you got a lot of requests at once, you would only be able to see the latest one by default with this method, because your viewer normally limits you to one dialog box per object. This would require some testing, but I think you could get around this by going into your debug settings (under the advanced menu) and changing ScriptDialogLimitations  to 1, then modifying the script a little so each request sends you a dialog for a different channel like so:

integer gChannelTextbox=100;
integer gChannelThrowaway=-200;
uNotifyOwner(key From,string Notice)
{
    string text =
        "secondlife:///app/agent/"+(string)From+"/inspect"+
        " has sent you a message:\n"+
        Notice;
    //use one or both of the following 2 lines:
    llDialog(llGetOwner(),text,["OK"],--gChannelThrowaway);
    //llOwnerSay(Text);
}
default
{
    state_entry()
    {   llListen(gChannelTextbox,"",NULL_KEY,"");
    }
    touch_start(integer total_number)
    {
        llTextBox(llDetectedKey(0),
            "Send a message to "+"secondlife:///app/agent/"+(string)llGetOwner()+"/inspect .",
            gChannelTextbox);
    }
    listen(integer Channel,string Name,key ID,string Text)
    {
        uNotifyOwner(ID,Text);
    }
}

That might be worth looking into.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 3/15/2021 at 8:01 PM, Quistessa said:

I was just thinking that if you got a lot of requests at once, you would only be able to see the latest one by default with this method, because your viewer normally limits you to one dialog box per object. This would require some testing, but I think you could get around this by going into your debug settings (under the advanced menu) and changing ScriptDialogLimitations  to 1, then modifying the script a little so each request sends you a dialog for a different channel like so:


integer gChannelTextbox=100;
integer gChannelThrowaway=-200;
uNotifyOwner(key From,string Notice)
{
    string text =
        "secondlife:///app/agent/"+(string)From+"/inspect"+
        " has sent you a message:\n"+
        Notice;
    //use one or both of the following 2 lines:
    llDialog(llGetOwner(),text,["OK"],--gChannelThrowaway);
    //llOwnerSay(Text);
}
default
{
    state_entry()
    {   llListen(gChannelTextbox,"",NULL_KEY,"");
    }
    touch_start(integer total_number)
    {
        llTextBox(llDetectedKey(0),
            "Send a message to "+"secondlife:///app/agent/"+(string)llGetOwner()+"/inspect .",
            gChannelTextbox);
    }
    listen(integer Channel,string Name,key ID,string Text)
    {
        uNotifyOwner(ID,Text);
    }
}

That might be worth looking into.

This script is 100% perfect! Actually ended up being even better than anticipated since she can move the dialog boxes around on her screen and the old one did not. Thank you SO much again ❤️

Link to comment
Share on other sites

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