Sunbleached Posted August 24, 2019 Share Posted August 24, 2019 (edited) Hello! I am trying to make light script with the menu so that it activates on the chat command, but something does not work. where I was wrong, tell me please! vector LIGHT_COLOR = < 1.0, 1.0, 1.0 > ; //Light color integer LIGHT_PRIM = LINK_THIS; //LINK_SET or prim number integer LIGHT_FACE = 0; //light face <<<<<<<<<<< list MENU_MAIN = ["MIN","MID","MAX","ON","OFF","DELETE"]; integer menu_handler; integer menu_channel; menu(key user,string title,list buttons) { llListen(10,"","",""); llListenRemove(menu_handler); menu_channel = (integer)(llFrand(99999.0) * -1); menu_handler = llListen(menu_channel,"","",""); llDialog(user,title,buttons,menu_channel); llSetTimerEvent(30.0); //how long to wait for user to press a button before giving up and closing listen } default { state_entry() { llListen(10,"","",""); } listen(integer channel,string name,key id,string msg) { if(msg=="glow") { menu(llDetectedKey(0), "\nText for Menu.", MENU_MAIN); } if (channel == menu_channel) { llListenRemove(menu_handler); //close listen llSetTimerEvent(0); //stop timeout timer if (msg == "MIN") { llSay(0, "Min Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.25, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.25 // START INTENSITY , 5.0 // START RADIUS , 1.0 // START FALLOFF ]); } else if (msg == "MID") { llSay(0, "Mid Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 0.50, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 0.5 // START INTENSITY , 10.0 // START RADIUS , 0.5 // START FALLOFF ]); } else if (msg == "MAX") { llSay(0, "Max Light"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (msg == "ON") { llSay(0, "Light is ON"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, LIGHT_FACE, 1.00, PRIM_POINT_LIGHT, TRUE, LIGHT_COLOR // START COLOR , 1.0 // START INTENSITY , 20.0 // START RADIUS , 0.0 // START FALLOFF ]); } else if (msg == "OFF") { llSay(0, "Light is OFF"); llSetLinkPrimitiveParamsFast(LIGHT_PRIM, [PRIM_GLOW, ALL_SIDES, FALSE, PRIM_POINT_LIGHT, FALSE, ZERO_VECTOR // COLOR , 0.0 // INTENSITY , 0.0 // RADIUS , 2.0 // FALLOFF ]); } else if (msg == "DELETE") { llSay(0, "Script Deleted"); llRemoveInventory(llGetScriptName()); } //else if (msg == "Button") //{ //do something //} }} timer() //VERY IMPORTANT menu timeout { llListenRemove(menu_handler); //close listen llSetTimerEvent(0); //stop timeout timer } } Edited August 24, 2019 by Sunbleached Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 24, 2019 Share Posted August 24, 2019 A listen event cannot "detect" anything. You may only use llDetectedKey() in touch*, sensor*, and collision* events. 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted August 24, 2019 Author Share Posted August 24, 2019 10 minutes ago, Rolig Loon said: A listen event cannot "detect" anything. You may only use llDetectedKey() in touch*, sensor*, and collision* events. Hi! Thanks for your answer! So how do i call menu in this case? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 24, 2019 Share Posted August 24, 2019 1 hour ago, Sunbleached said: So how do i call menu in this case? Think carefully. You already know the UUID of the person who sent the message, don't you? 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted August 24, 2019 Author Share Posted August 24, 2019 38 minutes ago, Rolig Loon said: Think carefully. You already know the UUID of the person who sent the message, don't you? Yes, so if i just remove llDetectedKey() it says "function call mismatches"... Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 24, 2019 Share Posted August 24, 2019 Yes, so don't do that. I'm not going to tell you the answer. This is one you can figure out easily if you stop and think about it. Where do you already know who sent the message? 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted August 24, 2019 Author Share Posted August 24, 2019 4 minutes ago, Rolig Loon said: Yes, so don't do that. I'm not going to tell you the answer. This is one you can figure out easily if you stop and think about it. Where do you already know who sent the message? menu(key user,string title,list buttons)? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 24, 2019 Share Posted August 24, 2019 (edited) 11 minutes ago, Sunbleached said: menu(key user,string title,list buttons)? No, that's the routine that you are sending the information. When you are receiving the message in the listen event, how do you know who sent it? Edited August 24, 2019 by Rolig Loon 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted August 24, 2019 Author Share Posted August 24, 2019 4 minutes ago, Rolig Loon said: No, that's the routine where you are sending the information. When you are receiving the message in the listen event, how do you know who sent it? key id Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 24, 2019 Share Posted August 24, 2019 Bingo. Now see what happens. Trust your ability to solve a problem like this. You can usually do it. 😎 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted August 24, 2019 Author Share Posted August 24, 2019 (edited) 20 minutes ago, Rolig Loon said: Bingo. Now see what happens. Trust your ability to solve a problem like this. You can usually do it. 😎 menu(llGetOwnerKey(id), "\nText for Menu.", MENU_MAIN); Thank you! it works now! Edited August 24, 2019 by Sunbleached 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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