Jump to content

Notecard to menu to channel command


Odetten
 Share

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

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

Recommended Posts

I need some help please. I have found a script which builds a menu from a notecard.  This I have made to work so that it gives me the option to press the button and a line appears in the local chat.

The reason for this is that I have a star telescope system that you have to enter '/11 M2  into local chat - /11 being the channel and M2 referring to a star map I wish the scope to point to. 

When I do this manually it works.

What I want to do is use my menu with the buttons.  So I press the button labelled M2 and it sends the instruction on chan 11 to the scope which then moves round to point at the star I selected, in this case M2 of course.

it is this last link I am struggling with, this is the line I am using at the moment for it to appear in local but nothing happens I assume because there is no physical enter key press. 

[M 2-35]  -  (button title)
M2=say  0 .11 M2
M3=say  0 /11 M3 
M5=say 0 /11 M5 
M13=say 0 /11 M13
M15=say 0 /11 M15

 

Is there any advice I can be given please.

 

The script I am using is by Kephra Nurmi as it seemed the closest to what I needed.


 
Link to comment
Share on other sites

Maybe something like this:

default
{
    touch_start (integer total_number)
    {
        llDialog (llDetectedKey (0), "Select a target:", ["M2", "M3", "M5", "M13", "M15"], 11);
    }
}

This sends a dialog to whoever clicks the object the script is in with the heading "Select a target:" and the buttons M2 - M15. Whichever button is clicked has its text chatted on channel 11 as if it were coming from the person who clicked it.

If you've already got a menu with the correct buttons I think you only need to ensure that the result goes out on channel 11, which you can do by checking the channel specified in the llDialog statement. If your menu is being created by a general purpose script, there's probably somewhere you can specify the output channel; perhaps a line in the notecard it's reading.

So you want the menu to output just the text "M2", and set channel 11 in the script function parameters (possiby pre-defined in a setting of some sort). Using "/11" to specify a chat channel only works, I think, in the viewer chat bar.

Edited by KT Kingsley
Link to comment
Share on other sites

As a new project, there's two things that might come up: handling a menu with more than twelve buttons, in which case it'll need "pages" you can switch between, and reading data from a notecard.

Both of these things are doable, of course, but they're a bit like getting thrown in the deep end if you're not familiar with LSL scripting.

Link to comment
Share on other sites

1 minute ago, bobsknief Orsini said:

I don't know that script.
But does "M2=say  0 .11 M2"  mean say on channel 0 the message after the . ?
If that is the case try "M2=say  11.M2"
If that is not the case then cant do much without seeing some code.

From what the OP said about using "/11 M2" in local chat successfully, I think the idea is to just chat "M2" on channel 11 from a menu. The "." is, I think, a typo for "/".

Link to comment
Share on other sites

well it works!

I took your code and incorporated it and it now fires up the telescope. I decided to set the 8 groups of star clusters into their own buttons on a hud you you add before using the thing and it is truly perfect. So I thank you for you help it set me on the right track to success.

 

And sorry I made a mistake that should have been say 0  /11 M2 with the slash not the stop. my typo.  

 

xx

Edited by Odetten
Link to comment
Share on other sites

1 hour ago, KT Kingsley said:

From what the OP said about using "/11 M2" in local chat successfully, I think the idea is to just chat "M2" on channel 11 from a menu. The "." is, I think, a typo for "/".

For clarity, it seems that the /# command is a purely viewer-side feature.

While a dialog button is spoken as the avatar, a button labeled "/1 test" will cause you to say "/1 test" on the dialog's channel. Not "test" or on any other channel.

Link to comment
Share on other sites

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