Jump to content

Shatter Roundel

Resident
  • Posts

    10
  • Joined

  • Last visited

Reputation

7 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So i thought i would show what I came up with for this one Since llLinksetDataWrite is going to save my numbers as a string I figured I could just truncate the string kind of a highbred of Bleuhazenfurfle and Profaitchikenz Haiku it eliminates any of the math potential to mess with my math later on when I need to use the data float domTotalstr = existingNumber + parsedNumber; string str = (string)domTotalstr; integer decimalIndex = llSubStringIndex(str, "."); string formattedTotal = llGetSubString(str, 0, decimalIndex + 2); Not as "elegant" as I would have liked but it works and is easily repeatable, as always thank you for your inputs and time I hope maybe this helps someone in the furture
  2. Just a thought for you linkset datastore can contain up to 131072 bytes (128 KiB) of data llLinksetDataWrite(line,notecardinfo) and then llLinksetDataRead(line,notecardinfo) without the slow reading notetcard
  3. HIya all Hope everyone is having a great day I have been searching the forum and i have seen a few different solutions to this, i was just wondering if someone has figured out a more elegant way of trimming down those pesky extra zeros after the decimal point. I am just trying to strip down my domTotal so XX.0 instead of XX.000000 (XXbeing placeholder). I have seen a couple of ways including llDeleteSubstring and the like but as you can see i only have a couple of lines of codes, just would suck to double the amount of code for something like this. integer listenerChannel = 940; string aeD = "Shc"; string aeB = "aeBasecount"; default { state_entry() { llListen(listenerChannel, "", llGetOwner(), ""); // llOwnerSay("ShadowCave activated on channel " + (string)listenerChannel); } listen(integer channel, string name, key id, string message) { float parsedNumber = (float)message; string aeDVal = llLinksetDataRead(aeD); float existingNumber = (float)aeDVal; float domTotal = existingNumber + parsedNumber; llLinksetDataWrite(aeD, (string)domTotal); // Debugging owner says // llOwnerSay("ShadowCave: " + (string)domTotal); } } Anyhow thank you all for any advice and Thank you for your time.
  4. Well, once again you guys saved the day. Thank you all so very much. It is amazing when you stare at a script long enough that your brain turns into total mush, strange it does not seem to do that when i stare at anything else in the world. Oh well I guess Just to answer a couple of your questions though I hate being that guy who gets helped and doesn't actually answer the question, in hopes someone else might find this useful So first thing, the script will not be using the touch event, the only reason it is there was for my sanity while i was testing it. The script is supposed to fire one time ask the question "document" the answer and never use it again. However, in the middle of writing it all and debugging, I realized that maybe I should make it accessible again down the road because the real question is a gender question ... "Do you feel like a... King or Queen?" because I am of a certain age shall we say that to me was initially a straight forward question but then I thought about this day in age I should probably make it do that it could be changed again... cause you just never know. Long story short I was in the middle of testing thought of it and threw in the llListen event so that I would not forget.. 624 by the way is my birthday, simple placeholder number heheh. Anyhow so the key to the fix was a combo of the open_menu and debugging to realize where i screwed up. See my little monkey brain said "No wait I put the llListen in the script, I know I did" To which I then proceeded to realize it was a placeholder that had absolutely ZERO to do with what I was actually trying to achieve So anyone who is reading this in the distant future... check your llListen chan and event and for the love of all things DEBUG DEBUG DEBUG is your bestest friend. Thank you all once again for your help
  5. Anyone helping me here thank you so very much for your time So here is my question of the day (Yes it is starting to feel like this any more) Can I use llDialog to write a note to the prims Desc? If so what is wrong here? integer gDialogChannel = -1; integer dialogHandle; open_menu(key inputKey, string inputString, list inputList) { gDialogChannel = (integer)llFrand(DEBUG_CHANNEL)*-1; dialogHandle = llListen(gDialogChannel, "", inputKey, ""); llDialog(inputKey, inputString, inputList, gDialogChannel); llSetTimerEvent(30.0); } close_menu() { llSetTimerEvent(0.0); llListenRemove(dialogHandle); } default { touch_start(integer start_param) { gDialogChannel = (integer)("0x" + llGetSubString(llGetKey(), 0, 6)) % 2147483647; llDialog(llGetOwner(), "Is 2 plus 2?", ["4", "12"], gDialogChannel); } listen(integer channel, string name, key id, string message) { if (channel != gDialogChannel) return; close_menu(); // Check the player's response if (message == "4") // Set the prim description to "4" llSetObjectDesc("4"); else if (message == "12") { // Set the prim description to "12" llSetObjectDesc("12"); } close_menu(); // Register to listen on channel 0624 llListen(624, "", llGetOwner(), ""); } // Timer event to close the menu timer() { close_menu(); } } I have noticed the IF statement seems to work with or without the {} so I tried it both ways to see if one or the other would work, long story short i left it like that so you could see that i tried it. Also, I know llSetObjectDesc and llSetPrimitiveParams([PRIM_DESC, "12"]); both can write to the desc however llSetPrimitiveParams does seem to work better for me more often than not. however, neither of them works with llDialog, or at least that seems to be the problem. Thanks again for your time and efforts
  6. Hmm, that is crazy literally nothing of mine floating around here that listens to that channel but as soon as I went to a cleared sandbox it had no issues at all worked perfectly... I mean least I know now I am not losing my mind. I wonder if there is something in the Linden homes listening to that channel I wonder if it is just too close to often-used channels? I think I will change it up to be another channel altogether so my players do not have the issues. Thank you so much Qui and you may even have saved me a future bug report. Thank you again and thank you all for your assistance I was seriously questioning my sanity.
  7. Just to comment on everyone's responses: For me steps 6 and 4 are where it breaks it just keeps listening so when i type /12 test... my name would change to "test". I have not seen llListenControl thank you for that info i tried to turn it odd and on with that.. didn't work for me but I will totally use it for future scripts. Thank you Actually, this is brilliant hadn't thought of that, and is something I will use for some other parts of my HUD. However, for this to be honest I really do not need to reuse the channel I was just using the idea of reusing the channel as a way to explain it needing to turn off. I know it doesn't use a ton of resources to stay open listening forever but you know how it is, Always try to make the scripts be as efficient as possible. Yes, it is supposed to only be the owner that can trigger the /12 command, it is purely a cosmetic thing though for the HUD. Since it is a HUD it is the touch event that makes the most sense to trigger the event,, i guess there could be other ways but this seems the most intuitive way. Again thank you all for your responses I really appreciate it more than I can say! 😍
  8. I thank you all for your time and responses, for the life of me I can not figure this out. It just doesn't do what I need it to do but ultimately I guess I can leave it active. I can not tell if maybe it is the Region I am working from or what it is. I will bounce around some see if it sets correctly. I have hit this from every which way but loose. If anyone wants to throw a stick at this here is my final script. The way it is supposed to work User clicks on the button - This activates the listener The user has a couple of options to set their name on channel 12 When the user types a name shuts down the listener or the 30 second timer runs out it shuts down the listener The issue is the listener do not turn off, wait a couple of minutes click on anything do anything shy of a full object reset and you can always change the name without ever having to click on the button again. integer listenChannelForNickname = 12; integer sendChannel = 666; integer obscureChannel = -999; string textureOptions = "UUID_for_active_texture"; string textureIdle = "UUID_for_idle_texture"; integer listenHandle = -1; integer optionsActive = FALSE; default { state_entry() { listenHandle = llListen(listenChannelForNickname, "", llGetOwner(), ""); llListenControl(listenHandle, FALSE); llOwnerSay("Script started. Listener inactive."); } touch_start(integer total_number) { key userID = llDetectedKey(0); vector touchST = llDetectedTouchST(0); float u = touchST.x; float v = touchST.y; if (userID == llGetOwner()) { if (u >= 0.805888 && u <= 0.984350 && v >= 0.698508 && v <= 0.740167) { llOwnerSay("Nickname change requested. Listening for 30 seconds."); llListenControl(listenHandle, TRUE); llSetTimerEvent(30.0); } else if (u >= 0.739200 && u <= 0.783677 && v >= 0.808898 && v <= 0.848837) { if (optionsActive) { llSetTexture(textureIdle, 4); llMessageLinked(LINK_SET, obscureChannel, "ae_options_close", NULL_KEY); optionsActive = FALSE; } else { llSetTexture(textureOptions, 4); llMessageLinked(LINK_SET, obscureChannel, "ae_options", NULL_KEY); optionsActive = TRUE; } } } } listen(integer channel, string name, key id, string message) { if (channel == listenChannelForNickname && id == llGetOwner()) { llListenControl(listenHandle, FALSE); llSetTimerEvent(0.0); if (llToLower(message) == "reset") { message = llKey2Name(llGetOwner()); } llSay(sendChannel, "SetNickname: " + message); llMessageLinked(LINK_SET, obscureChannel, "idleoption," + textureOptions, NULL_KEY); llOwnerSay("Nickname set. Listener off."); } } timer() { llListenControl(listenHandle, FALSE); llSetTimerEvent(0.0); llOwnerSay("Timer elapsed. Listener off."); } } Maybe the script will be useful to someone else, I mean it works for me just not exactly how I want it to. I really do not have to turn it off so long as only the owner can make the changes Again Thank you all so much for the assist.
  9. No it does everything i am looking for the problem is if you want say 2 minutes and type /12 Superman and it changes the nickname. I only want it to change the nickname when the button is touched then you reset your name do whatever and then I want the script to stop listening to /12 other words i want to be able to reuse the /12 for other things to manually set And wow thanks for the fast reply I wasn't expecting anything until tomorrowLOL
  10. Wow ok i would think this would be a busier place. Anyway on the off chance, someone notices this post I was hoping someone could tell me why this script is not turning off the /12 listening event. It should have a 30 second timer and/or if the user changes their name it should turn off and stop listening. Or am totally not understanding the llListening. Tried to include as much documentation as i could integer listenChannelForNickname = 12; // Channel to listen for the nickname integer sendChannel = 9999; // Channel to send the nickname to the name script integer obscureChannel = -73259; // The obscure channel for internal communication string textureOptions = "e30f4002-5002-2f42-b2ae-25edbf5f7640"; // Texture UUID integer isListening = FALSE; // Flag to control the listening state integer listenHandle = -1; // Initialize with an invalid handle default { state_entry() { // The listener is not initialized here } touch_start(integer total_number) { key userID = llDetectedKey(0); // Check if the toucher is the owner if (userID == llGetOwner()) { vector touchST = llDetectedTouchST(0); float u = touchST.x; float v = touchST.y; // Check if the touch is within the button's UV coordinates if (u >= 0.805888 && u <= 0.984350 && v >= 0.698508 && v <= 0.740167) { llOwnerSay("Please type in chat /12 YourNewNickname.\nOr type /12 Reset to reset your name."); if (!isListening) { listenHandle = llListen(listenChannelForNickname, "", llGetOwner(), ""); isListening = TRUE; llSetTimerEvent(30.0); } } } } listen(integer channel, string name, key id, string message) { if (channel == listenChannelForNickname && id == llGetOwner() && isListening) { // Process the message if (llToLower(message) == "reset") { string originalName = llKey2Name(llGetOwner()); llSay(sendChannel, "SetNickname: " + originalName); } else { llSay(sendChannel, "SetNickname: " + message); } llMessageLinked(LINK_SET, obscureChannel, "idleoption," + textureOptions, NULL_KEY); // Notify owner and stop listening and timer llOwnerSay("Nickname set. No longer listening."); // Stop listening and timer, and ignore any further messages llListenRemove(listenHandle); llSetTimerEvent(0.0); isListening = FALSE; listenHandle = -1; } } timer() { if (isListening) { // Notify owner and stop listening and timer llOwnerSay("I am not listening anymore."); // Stop listening and timer llListenRemove(listenHandle); llSetTimerEvent(0.0); isListening = FALSE; listenHandle = -1; } } } Thank you for your time and efforts I do appreciate any assistance with this. Sorta Banging my head on the wall
×
×
  • Create New...