Jump to content

Ariu Arai

Resident
  • Posts

    143
  • Joined

  • Last visited

Everything posted by Ariu Arai

  1. Does it need to be a HUD? If not, just create an object that is attached to "Avatar Center", then use llSetText to create the title. If you'll only have two titles, you may not even need to use a script. Just upload a texture with the text and apply it to a rectangular prim.
  2. Modulus will also create a math error. if(dividend % divisor == 0)//Division must create an complete number. Check both variables for 0 before continuing.
  3. http://wiki.secondlife.com/wiki/LlPushObject Keep in mind that most sims and parcels have push disabled. In that case, you can only use it on others if you own the land, or use it on yourself.
  4. Just make sure that the object has modify rights. Otherwise you have to use llAllowInventoryDrop(TRUE) to enable adding inventory. However this makes the object public access. So you need to turn that off after the animations are added. Otherwise anyone could drop items into the HUD's inventory.
  5. Attachments inherit the group of the wearer at the time it was attached. Manually changing the group of the attachment usually does not work. Reattaching is the only reliable way to change it.
  6. llSetBuoyancy(1.0); 1.0 = Normal gravity 2.0 = Upwards gravity (You fall upwards) -1.0 = 2x downwards gravity. Etc...
  7. One doesn't have to use the LSL Preprocessor in order to use constants. It's still possible to just use normal integer variables, they just aren't.... Constant. But still, this uses less memory and has better performance than strings. integer const_command_add = 1; integer const_command_remove = 2; integer const_command_do_things = 3;
  8. First, I recommend using the integer/number parameter of llMessageLink to indicate the messages "command". This is more efficient (Since we're only comparing integers and not strings) and uses less memory (Since we don't have to store any extra string values to compare against). If you want better readability, use the LSL Preprocessor so you can define constants. //Sender script llMessageLinked(LINK_THIS, 1, "John Doe", "");//Number param "1" could be used to add avatars. Then the message param contains only the avatar name. //Receiver script below link_message(integer prim, integer num, string msg, key id) { if(num == 1) { //Add } else if(num == 2) { //Remove } else if(num == 3) { //Do the thing, etc... } } LSL has built-in CSV functions. They are llCSV2List("foo,bar") and llList2CSV(["foo", "bar"]). These should fit your needs. llMessageLinked(LINK_THIS, 1, llList2CSV("John Doe,Foo Bar"), ""); link_message(integer prim, integer num, string msg, key id) { if(num == 1) { list new_avs = llCSV2List(msg); //Loop through and add new avs to the list. } } PS: I recommend using avatar UUID's and not names. Avatar names can be changed, so they are not a reliable identifier.
  9. If all you're doing is hosting some text files, I'd definitely recommend just using Amazon S3. https://aws.amazon.com/s3/ Also, SSL/HTTPS is super easy to setup if you have Apache. The Let's Encrypt cert bot does everything for you.
  10. Example: httpCheck = llHTTPRequest("http://warlocc-den.com:1234/sl/online.txt",[],""); You can of course use whichever port number suits your needs. You won't even need to modify your web server, just change the port forwarding settings on your router.
  11. You could try using a different port than 80, 443 or 8080. Those are common web server ports, so your ISP probably interferes with those when it's an incoming connection.
  12. Looks like a self-hosted server. I would recommend getting a professionally hosted server instead. Residential internet usually has very limited uplink capacity, and some ISP's like to try to de-prioritize incoming connections. $5/mo can get you a shared virtual server with most hosting providers. I've personally used Linode and Interserver in the past and had good experiences with them. If you are only hosting text documents (No PHP, databases, etc.), you could even use something like Amazon Web Services S3. That would be cheaper, and would save you the hassle of having to keep a server updated. Note: You may not see any issues with the connection since it's being routed locally. When we test it ourselves, we see the slowness and occasional time out.
  13. llGetUnixTime is easier to implement as it doesn't require parsing a string. The example below sets an integer variable to the time that the script will do its thing (IE: Delete/detach the product). You would probably want to check the time in the on_rez event, but keep in mind that on_rez triggers before changed does. changed(integer change) { if(change & CHANGED_OWNER)//New owner, set a new time limit. { time_limit = llGetUnixTime() + 300;//300 seconds = 5 minutes. } } timer() { if(llGetUnixTime() > time_limit) { //Do stuff here. } }
  14. I can definitely find llListSortStrided being useful, though honestly I'd much rather have nested lists. Though JSON has added that ability, it's just a bit slow.
  15. Qie got most of them. Though it is possible for scripts near a sim border to communicate with scripts on the other side of the border. This is obviously a very narrow use case scenario. There are some "Data Server" services that you can buy from other residents (Look for them on the marketplace). This will let your script store key-value pairs on their database. This means you could use llRequestURL/llRequestSecureURL, then store the resulting URL on that database and have the other script pull that same value.
  16. It would help if you posted the script. We don't need the whole script, just the relevant bits. We definitely want to know what the HTTP return code is. IIRC, a 503 code usually indicates the request timed out, or the sim wasn't able to reach the server. Have you checked your webserver logs for errors? If you run a ping test on it, do you ever get any failed pings? This could indicate network issues, as ping is an ICMP request, which bypasses the webserver.
  17. Unless you'll be running this functions hundreds of times a second, I doubt it will cause any amount of lag. Since it sounds like you may be using key values, you could look into using JSON. It's usually slower than native list operations, but it uses less bytecode and can make things like nested lists easier to implement.
  18. llGetTime will do the job. Just keep in mind that's the time the script started running. You could also do... on_rez(integer start) { rez_time = llGetUnixTime(); }
  19. If you can control both sides of the HTTP request (The sender and receiver). Make the sender either use llEscapeURL or llStringToBase64. Then on the other end, llUnescapeURL or llBase64ToString. One thing to keep in mind about Base64 is that it uses = and / characters, so it's best not to use it in the query string.
  20. This will do the trick. llGiveInventoryList doesn't support no-copy items, which is kind of annoying. Instead, a separate list will need to be build for the no-copy items and they will need to be given to the owner individually using llGiveInventory. I removed the for loop for the touch event as it's not needed. default { touch_start(integer num) { if(llDetectedKey(0) == llGetOwner()) { integer InvenNumber = llGetInventoryNumber(INVENTORY_ALL); list copy_list = []; list no_copy_list = []; integer count = llGetInventoryNumber(INVENTORY_ALL); while(~--count) { string name = llGetInventoryName(INVENTORY_ALL, count); if(name != llGetScriptName()) { integer perms = llGetInventoryPermMask(name, MASK_OWNER); if(perms & PERM_COPY) { copy_list += name; } else { no_copy_list += name; } } } if(copy_list != []) { llGiveInventoryList(llGetOwner(), llGetObjectName(), copy_list); } count = llGetListLength(no_copy_list); while(~--count) { llGiveInventory(llGetOwner(), llList2String(no_copy_list, count)); } } } }
  21. LSL does not properly handle vectors, rotations and keys when they're pulled from lists that were parsed from strings. You need to first type cast them into the appropriate variable. default { state_entry() { list foo = [1, "1", <1.0, 2.0, 3.0>, "<1.0, 2.0, 3.0>"]; string bar = llDumpList2String(foo, "/"); list baz = llParseStringKeepNulls(bar, ["/"], []); //Integers and floats will be properly parsed, even if they were strings. //Vectors, rotations and keys will not. llOwnerSay(llList2CSV(baz) + " || " + (string)llList2Integer(baz, 0) + " || " + (string)llList2Integer(baz, 1) + " || " + (string)llList2Vector(baz, 2) + " || " + (string)llList2Vector(baz, 3)); vector stringified_vector = (vector)llList2String(baz, 2);//In the original list, this was a vector type vector stringified_vector_2 = (vector)llList2String(baz, 3);//This one was just a string. llOwnerSay((string)stringified_vector + " || " + (string)stringified_vector_2);//But to LSL, they're now both just strings and can be typecasted exactly the same. } } So in summary. In order to use a vector, rotation or key from a parsed list. Pull it out using llList2String, then typecast it into what you need.
  22. I second this. Use the brackets to generate a clickable link. Also, be sure to use llEscapeURL for the URL parameters to ensure that special characters in them don't corrupt the link. In the example below, I also used llRegionSayTo. This will send a message privately to the persons chat. (I'm assuming this will be used in a store, and be clicked by customers; In other words, not the script owner). string animations = getAnimations(); llRegionSayTo(llDetectedKey(0), 0, "Try Me On. Click [https://www.xest.com/trymeon.php?t=" + llEscapeURL(llGetObjectName()) + "&a=" + llEscapeURL(animations) + " here]");
  23. Just have the pay amounts disabled until the object is clicked, then set the prices based on the ID of the agent that clicked it. There is OBJECT_SELECT_COUNT in llGetObjectDetails. This tells you how many people have the object selected, but there's no way to find out who's doing it. The object does stay selected while the pay window is open though. So you could put in a timer event that checks the selected count and if no one has clicked the object recently but have it selected, say something in chat to "Click the object before paying".
  24. 1) I can't say... You'll need to do a "Find" using a text editor to find where that text is coming from. 2) Have the LSL script send the URL to the server. Store the URL in a database on your server. If you have no database, store it in a static variable or a text file. 3) Yes. In your original script, the "some string" part of the HTTP request is the body of the request. That's where your POST data goes.
  25. Yes, port 12046. Most servers are not configured to block any outgoing traffic, so the issue likely isn't the firewall. It could be your webserver or PHP config though. It's been a long time since I've used PHP, but I do recall that it needed a package installed in order to make outgoing HTTP requests.
×
×
  • Create New...