Jump to content

Bones Outlander

Resident
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Bones Outlander

  1. I've just returned from 3 weeks overseas, but it looks like my update server started receiving requests again on 27th December. So not sure what was broken, but it seems to be fine again now.
  2. Is that just a matter of changing the URL in the LSL script? If so, then yes I have tried with https://
  3. Disabling Yoast makes no difference, I still get a 404 Page not found error. (See attached entry from my WordPress logs.) If I click on the link in the logs, the URL opens fine, it's only the HTTP Get for SL that gets the 404. I'm sure it's probably a WordPress issue, I just need to find a way around it somehow. Although it is odd that it used to work and just stopped recently.
  4. No, that is the correct domain. I'm hosting the file on a website I own/manage.
  5. Hi, I use this PHP script (found in the script library years ago) hosted on my internet hosting service to provide the current URL for my in-world update server. <?php $answer = "7a3c8787-5e71-a19f-a1b9-7958c8fc898c"; $xml = '<?xml version="1.0" encoding="ISO-8859-1"?>|' . strval($answer) . '|'; header('Content-type: text/xml'); echo($xml); ?> And I call this via these specific line of LSL code in my objects. string outgoing_url = "http://www.lccb.org.au/bonesdesigns/avi-hud/update-relay.php"; kManualUpdateReq = llHTTPRequest(outgoing_url, [HTTP_METHOD, "GET"], ""); If I access the update-relay.php URL via a web browser on my desktop I get this response from the server: <?xml version="1.0" encoding="ISO-8859-1"?>|7a3c8787-5e71-a19f-a1b9-7958c8fc898c| Which is exactly what I'm expecting, BUT when my objects access the same URL from SL using the code above I get this returned: <!doctype html> <html lang="en-AU"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script> <meta name='robots' content='noindex, follow' /> <!-- This site is optimized with the Yoast SEO plugin v19.13 - https://yoast.com/wordpress/plugins/seo/ --> <title>Page not found - LCCB</title> <meta property="og:locale" content="en_US" /> <meta property="og:title" content="Page not found - LCCB" /> <meta property="og:site_name" content="LCCB" /> <script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://www.lccb.org.au/#website","url":"https://www.lccb.org.au/","name":"LCCB","description":"The Lane Cove Concert Band","publisher":{"@id":"https://www.lccb.org.au/#organization"},"potentialAction":[{"@type": This was all working fine up until recently (I don't know the exact time it broke I'm afraid), but can anybody suggest what might be going on please? Thanks Bones
  6. I'm trying to work out the best way of generating a string of a variable length of a single characters (let's say an *). So basically I want to pass a variable into a function and that function returns a string of that number of characters . So if i passed in 10 my string would be "**********" In some languages str="*" * 8 would return "********", but not LSL. Is the only way to loop around adding one character each time, or is there a more efficient way of dong this? Thanks
  7. I've been running the script with the 12000 memory limit now for 8 hours and it seems pretty stable. The available memory reported with the hello message fluctuates between around 11500 and 14300 (depending on the number of recorded lines being reported) but memory doesn't seem to be getting any lower over time, so that's a good sign.
  8. Thanks Wulfie, I think you may well be right, I'd better start reading up on Linkset Data, although there are bound to be a few "undocumented features" in that too!
  9. Changing the timer back to .075 and I do get a crash. [19:29] History Tester 6k: started [19:29] History Tester 6k: Hello from the History Server Script, Free Memory: 49678 / Lines recorded: 99 [19:29] History Tester 6k: Hello from the History Server Script, Free Memory: 40278 / Lines recorded: 199 [19:29] History Tester 6k: Hello from the History Server Script, Free Memory: 30878 / Lines recorded: 299 [19:30] History Tester 6k: Hello from the History Server Script, Free Memory: 21160 / Lines recorded: 399 [19:30] Avi-HUD+ 3.05: Tamara status changed to online on Sat 11/12/2022 at 7:30 pm. Previous logout was on Sat 11/12/2022 at 4:15 am. (15 hours and 14 minutes ago) [19:30] History Tester 6k: prune start:5932 561 [19:30] History Tester 6k: prune end:306 541 [19:30] History Tester 6k: prune start:106 542 [19:30] History Tester 6k: prune end:1788 522 [19:30] History Tester 6k: prune start:1788 523 [19:30] History Tester 6k: prune end:3270 503 [19:30] History Tester 6k: prune start:3270 504 [19:30] History Tester 6k: prune end:12944 484 [19:30] History Tester 6k: Hello from the History Server Script, Free Memory: 8094 / Lines recorded: 538 [19:30] History Tester 6k: prune start:5932 561 [19:30] History Tester 6k: prune end:306 541 [19:30] History Tester 6k: prune start:106 542 [19:30] History Tester 6k: prune end:1788 522 [19:30] History Tester 6k: prune start:1788 523 [19:30] History Tester 6k: prune end:3270 503 [19:30] History Tester 6k: prune start:3270 504 [19:30] History Tester 6k: prune end:12944 484 [19:30] History Tester 6k: Hello from the History Server Script, Free Memory: 9974 / Lines recorded: 518 [19:30] History Tester 6k: prune start:5932 561 And it crashed at the prune. Adding in a llSleep (I tried .001, .5 and 1) immediately after the llSetMemoryLimit(memlimit) line seems to stop the crash at the .075 timer value, but it still does 4 prunes before the memory is released back over 6000 bytes. I was expecting the sleep to allow the memory to free up in one pass.
  10. OK, so this is interesting .... I think. I ran with the 6000 threshold, removing 79 entries in a prune, and adding 1 entry per second. I don't get a crash, but it runs several prunes before the memory frees up. In fact the memory free drops from 5932 to 306 after removing 20 lines (80 entries)! Here are my two scripts // main script integer toggle = FALSE; integer count; default { touch_start(integer total_number) { if(toggle = !toggle) { llOwnerSay("started"); count = 0; llSetTimerEvent(1.0); } else { llOwnerSay("stopped"); llSetTimerEvent(0.0); llMessageLinked(LINK_THIS, 99, "", ""); } } timer() { count++; if(count%100 ==0) { llMessageLinked(LINK_THIS, 99, "", ""); } llMessageLinked(LINK_THIS, 2, "Fenix Eldritch,1,"+(string)llGetUnixTime(), ""); } } // History Logger list lHistory; integer iZoneOffset; integer count; default { state_entry() { } link_message(integer sender_num, integer num, string str, key id) { if (num == 2){ if ( llGetFreeMemory() < 6000) { count = llGetListLength(lHistory)/4; llOwnerSay("prune start:"+(string)llGetFreeMemory()+" "+(string)count); lHistory = llDeleteSubList(lHistory,0,79); // Remove the oldest entry from history integer memlimit = llGetMemoryLimit(); // how much are we allowed? llSetMemoryLimit(memlimit-1); // reduce by 1 to force GC llSetMemoryLimit(memlimit); // set it back count = llGetListLength(lHistory)/4; llOwnerSay("prune end:"+(string)llGetFreeMemory()+" "+(string)count); } string sLoginLogout; list lTemp = llParseString2List(str,[","],[]); integer iTimestamp=llGetUnixTime() + iZoneOffset; string sVar1 = llList2String(lTemp,0); // Avatar Name integer iVar2 = llList2Integer(lTemp,1); // Status (1=online 0=offline) integer iPrevUnixTime = llList2Integer(lTemp,2) + iZoneOffset; // Last login/logout adjusted to Time Zone lHistory = lHistory + [iTimestamp] + [sVar1] + [iVar2] + [iPrevUnixTime]; count = llGetListLength(lHistory)/4; llSetText((string)count,<1,1,1>,1.0); } else if (num == 11){ // Receive Zone Time Offset in seconds, including DST adjustment iZoneOffset = (integer)str; } else if (num==99){ // Receive Hello request (to test which scripts have died) integer iLength = llGetListLength(lHistory)/4; llOwnerSay("Hello from the History Server Script, Free Memory: " +(string)llGetFreeMemory() + " / Lines recorded: " + (string)iLength); } } } And the output [17:04] History Tester 6k: started [17:06] History Tester 6k: Hello from the History Server Script, Free Memory: 49678 / Lines recorded: 99 [17:08] History Tester 6k: Hello from the History Server Script, Free Memory: 40278 / Lines recorded: 199 [17:09] History Tester 6k: Hello from the History Server Script, Free Memory: 30878 / Lines recorded: 299 [17:11] History Tester 6k: Hello from the History Server Script, Free Memory: 21160 / Lines recorded: 399 [17:13] History Tester 6k: Hello from the History Server Script, Free Memory: 11760 / Lines recorded: 499 [17:14] History Tester 6k: prune start:5932 561 [17:14] History Tester 6k: prune end:306 541 [17:14] History Tester 6k: prune start:106 542 [17:14] History Tester 6k: prune end:1788 522 [17:14] History Tester 6k: prune start:1788 523 [17:14] History Tester 6k: prune end:3270 503 [17:14] History Tester 6k: prune start:3270 504 [17:14] History Tester 6k: prune end:12944 484 [17:14] History Tester 6k: Hello from the History Server Script, Free Memory: 9880 / Lines recorded: 519 [17:15] History Tester 6k: prune start:5932 561 [17:15] History Tester 6k: prune end:306 541 [17:15] History Tester 6k: prune start:106 542 [17:15] History Tester 6k: prune end:1788 522 [17:15] History Tester 6k: prune start:1788 523 [17:15] History Tester 6k: prune end:3270 503 [17:15] History Tester 6k: prune start:3270 504 [17:15] History Tester 6k: prune end:12944 484 [17:16] History Tester 6k: Hello from the History Server Script, Free Memory: 8000 / Lines recorded: 539 [17:16] History Tester 6k: prune start:5932 561 [17:16] History Tester 6k: prune end:306 541 [17:16] History Tester 6k: prune start:106 542 [17:16] History Tester 6k: prune end:1788 522 [17:16] History Tester 6k: prune start:1788 523 [17:16] History Tester 6k: prune end:3270 503 [17:16] History Tester 6k: prune start:3270 504 [17:16] History Tester 6k: prune end:12944 484 [17:18] History Tester 6k: Hello from the History Server Script, Free Memory: 6120 / Lines recorded: 559 [17:18] History Tester 6k: prune start:5932 561 [17:18] History Tester 6k: prune end:306 541 [17:18] History Tester 6k: prune start:106 542 [17:18] History Tester 6k: prune end:1788 522 [17:18] History Tester 6k: prune start:1788 523 [17:18] History Tester 6k: prune end:3270 503 [17:18] History Tester 6k: prune start:3270 504 [17:18] History Tester 6k: prune end:12944 484 [17:19] History Tester 6k: prune start:5932 561 [17:19] History Tester 6k: prune end:306 541 [17:19] History Tester 6k: prune start:106 542 [17:19] History Tester 6k: prune end:1788 522 [17:19] History Tester 6k: prune start:1788 523 [17:19] History Tester 6k: prune end:3270 503 [17:19] History Tester 6k: prune start:3270 504 [17:19] History Tester 6k: prune end:12944 484 [17:19] History Tester 6k: Hello from the History Server Script, Free Memory: 11760 / Lines recorded: 499 [17:20] History Tester 6k: prune start:5932 561 [17:20] History Tester 6k: prune end:306 541 [17:20] History Tester 6k: prune start:106 542 [17:20] History Tester 6k: prune end:1788 522 [17:20] History Tester 6k: prune start:1788 523 [17:20] History Tester 6k: prune end:3270 503 [17:20] History Tester 6k: prune start:3270 504 [17:20] History Tester 6k: prune end:12944 484 [17:20] History Tester 6k: stopped [17:20] History Tester 6k: Hello from the History Server Script, Free Memory: 12512 / Lines recorded: 491
  11. I was using the line as per your message above: lHistory = llDeleteSubList(lHistory,0,79); I think this is also related to the speed in which the data is coming through, maybe if the logger script is having to buffer a few lines it overflows before the pruning can happen.
  12. Thank you everybody for your responses. @Fenix Eldritchthank you so much for going to the trouble of testing this. I have setup the same test as you, but even deleting 20 list entries at a time I get a crash at the 6000 limit, and even at 10000. I had to go to 12000 before the crash stopped. At 12000 I can delete 1 list entry at a time without a crash, but get your point that that is a forcing a lot of cleaning up, so will stick with the 20 entries. I'll do some more testing here and see if I find anything else useful.
  13. Hi, I have a history logging script that receives data (Avatar name, Status - a 0 or 1 and a UnixTime Timestamp) from another script via a link_message and stores the data in a list. Once llGetFreeMemory reports less that 6000 bytes, for each new data message received I delete the oldest entry from the list. But for some reason the script slowly keeps eating up memory until I get a stack heap error. I know all link_messages get processed by all scripts, but any messages I pass to scripts are less than 500 bytes so I've allowed 6000 bytes as a buffer. I recently added the llSetMemoryLimit lines to try to force a memory cleanup but that didn't resolve the issue and eventually I get a stack-heap error (can take several days or even weeks). Here is a simplified version of my script that exhibits the issue, am I doing something wrong in here somewhere? Many thanks Bones // History Logger list lHistory; integer iZoneOffset; default { state_entry() { } link_message(integer sender_num, integer num, string str, key id) { if (num == 2){ if ( llGetFreeMemory() < 6000) { lHistory = llDeleteSubList(lHistory,0,3); // Remove the oldest entry from history integer memlimit = llGetMemoryLimit(); // how much are we allowed? llSetMemoryLimit(memlimit-1); // reduce by 1 to force GC llSetMemoryLimit(memlimit); // set it back } list lTemp = llParseString2List(str,[","],[]); integer iTimestamp=llGetUnixTime() + iZoneOffset; string sVar1 = llList2String(lTemp,0); // Avatar Name integer iVar2 = llList2Integer(lTemp,1); // Status (1=online 0=offline) integer iPrevUnixTime = llList2Integer(lTemp,2) + iZoneOffset; // Last login/logout adjusted to Time Zone lHistory = lHistory + [iTimestamp] + [sVar1] + [iVar2] + [iPrevUnixTime]; } else if (num == 11){ // Receive Zone Time Offset in seconds, including DST adjustment iZoneOffset = (integer)str; } else if (num==99){ // Receive Hello request (to test which scripts have died) integer iLength = llGetListLength(lHistory)/4; llOwnerSay("Hello from the History Server Script, Free Memory: " +(string)llGetFreeMemory() + " / Lines recorded: " + (string)iLength); } } }
  14. Hmm, I take it all back! I can't send from Outlook again, even using the format above but if I reply to an email the script sends me in Outlook it goes through, go figure! Does anybody use outlook to send emails into SL successfully?
  15. Thanks Qie, You are correct it works from the Gmail web client/account, I only tested was using a Gmail account sending via the Windows 10 mail client and also from an outlook.com account. EDIT: The formats below don't seem to work on Outlook at all now, so not sure what's going on! So it seems Microsoft doesn't like the address 00e432f6-fa97-5889-90c5-a3b7c2b3895a@lsl.secondlife.com So I tested this address from a Microsoft account/email client and this DOES work. Email Tester <00e432f6-fa97-5889-90c5-a3b7c2b3895a@lsl.secondlife.com> But this DOES NOT work <00e432f6-fa97-5889-90c5-a3b7c2b3895a@lsl.secondlife.com> So it seems to be safe, use an address that has the format Name <key@lsl.secondlife.com> format as this worked with Gmail and Microsoft accounts/clients.
  16. Hi, I am trying to test sending an email to a script in SL, but the emails I send are never received. I have checked the key I'm sending to and it is correct and have tried for 2 different regions. Is anybody else seeing issues receiving external emails, internal emails seem to be working fine. Here's my test script, which is the example script for llGetNextEmail, so it should work. default { state_entry() { llOwnerSay("My email address is: " + (string)llGetKey() + "@lsl.secondlife.com"); llSetTimerEvent(15.0); } timer() { llOwnerSay("Checking for mail"); //Check for emails llGetNextEmail("", ""); } email(string time, string address, string subj, string message, integer num_left) { llOwnerSay("I got an email: " + subj + "\n" + message); } }
  17. Thanks for the replies everybody, I guess I was trying to understand why I was having the issues I was having, and of course have now been given some ideas on better ways to do things. I certainly don't need the precision of the Timestamp, but was using a script I found to convert the Timestamp into a more user-friendly format for display (Wednesday 10/5/2022 at 3:06 am) which at the time (10 years ago) there didn't seem to be a script to do the same for UnixTime. There probably is now, so I'll have a look as writing one myself is beyond my ability! Cheers
  18. Thanks for the responses, KT and Rolig. Stamp2UnixInt was just what I needed!
  19. Hi, Is there an easy way to calculate the number of days between two llGetTimestamp() values? I'm thinking I'll need to convert the timestamps to UnixTime and then get the difference in seconds between the two values and then divide that to get the # of days. Is that the best way? Thanks
  20. Arghh, this is so frustrating! I have modified my script to use the changed format as above and now with the notecard with only name and uuid it loads 77 Avatars before hitting the memory limit set, but when using the same code and IDENTICAL notecard (so names and UUIDs are all the same) but just adding the timestamps it only loads 73! The idea of the notecard with the timestamps is that it's a backup so if the scripts need to be reset or there is an updated script, the history can be reloaded. Hard to reload if the backup only restores 73 of the 77 Avatars. I might just have to go back to hard coding an Avatar limit of say 60 and be done with it!
  21. Probably not, at the time when I wrote my scripts I used the timestamp as I didn't know any better, and to change it all now to unix time is quite a lot of work for probably not a huge benefit.
  22. I guess there is no way around this then? It's tricky as I didn't want to hard code a limit on the number of avatars as the length of the names impacts the number that can be loaded, so wanted to use a memory limit rather than a hard number limit. But I can't afford to have people load 100 names from the notecard initially and then when they do a backup (that's when the timestamps are added) not be able to load them all afterwards. So based on the comment above from Frionil if I change if (sLastLogout == "") sLastLogout = sDefaultTimestamp; if (sLastLogin == "") sLastLogin = sDefaultTimestamp; to if (sLastLogout == "") sLastLogout = "1970-01-01T00:00:00.000000" + "Z"; if (sLastLogin == "") sLastLogin = "1970-01-01T00:00:00.000000" + "Z"; That makes both load the same number of names, which I guess is the best I can achieve.
  23. Thank you so much for taking the time to write your code Wulfie. I ran your script in a new object with my two different notecards and see the same results I am seeing with my script. The notecard with just name,uuid loads 380 avatars, but the one with the full data only loads 190 before it hits the memory limit, so once again that's half the avatars. I just don't understand why!???
  24. Hi, I'm really struggling with a memory issue and I'm hoping somebody here might be able to help please. Sorry if this is a bit long, but I want to try to provide as much information as I can to help. I have an online indicator script that reads a list of avatars from a settings notecard and loads them into some lists before then continuing on to monitor the list of avatars for changes in login/logout status. The notecard has a line per avatar and can be in two formats. Avatar=Bones,5a5a7269-1de2-4b1f-815a-01c92991661e Which is just the Name, UID (obviously) or Avatar=Bones,5a5a7269-1de2-4b1f-815a-01c92991661e,1970-01-01T00:00:00.000000Z,2022-09-27T12:02:20.423842Z Which is the Name, UUID, Last Login Timestamp, Last Logout Timestamp When I read in each line, if the last login or logout timestamps are not provided in the notecard I put a default value (1970-01-01T00:00:00.000000Z) into the list so I don't run out of memory later when the data in the lists gets updated. The script loads avatars until llGetFreememory() <= 5000, then it stops loading. Now, my issue is this: If my notecard has all the avatars= lines with just the Name, UUID I can load 117 avatars, BUT if my notecard has Name,UUID,Login,Logout then I can only load 58 avatars before I hit the memory limit. WHY??? In both cases the lists are being populated with the same number of bytes of data as I put the default values in if they are not in the notecard but for some reason the memory is being used up faster when the data is provided in the notecard. I'm probably missing something really simple, but I've stared at this code for ages and just can't see it! So if anybody can suggest how I can fix this, I'd be most appreciative. Bones Here is the part of the script that reads in the notecard lines, I added the llOwnerSay line to show what was being written to the lists and the free memory after each avatar, and although both notecard formats show the same data being added to the lists, the free memory drops to 5000 in half the number of avatars when the full data is read from the notecard! dataserver(key kQueryid, string sData) { if (kQueryid == kDataRequestID) { if (sData != EOF) { integer iDataReq = FALSE; if( StringLeftICompare( "Avatar=", sData ) ){ if(llGetFreeMemory() <= 5000){ llOwnerSay("You have reached your Avatar limit."); } else { iAvatarCount += 1; llSetText("LOADING\n(Avatars - " + (string)iAvatarCount + ")",vTextColor,fAlpha); list lTemp = llParseString2List(llStringTrim(sData,STRING_TRIM),["Avatar","avatar","AVATAR","=",","],[]); sAviName=llStringTrim(llList2String(lTemp,0),STRING_TRIM); sKeyID=llStringTrim(llList2String(lTemp,1),STRING_TRIM); //Get Lastlogout timestamp from settings card (if available) otherwise set to default value of sLogInOutFiller string sAvi_lastlogout=llStringTrim(llList2String(lTemp,2),STRING_TRIM); if (sAvi_lastlogout=="") sAvi_lastlogout="1970-01-01T00:00:00.000000Z"; //Get Lastlogin timestamp from settings card (if available) otherwise set to default value of sLogInOutFiller string sAvi_lastlogin=llStringTrim(llList2String(lTemp,3),STRING_TRIM); if (sAvi_lastlogin=="") sAvi_lastlogin="1970-01-01T00:00:00.000000Z"; lAvi_name = lAvi_name + [sAviName]; lAvi_lastlogout = lAvi_lastlogout + [sAvi_lastlogout]; lAvi_lastlogin = lAvi_lastlogin + [sAvi_lastlogin]; lAvi_location = lAvi_location + [sLocationFiller]; lAvi_keyid = lAvi_keyid + [sKeyID]; // Put in for testing only llOwnerSay((string)iAvatarCount + ": " + sAviName + " , " + sAvi_lastlogout + " , " + sAvi_lastlogin + " : " + (string)llGetFreeMemory()); // Remove after Testing } } if (iDataReq !=TRUE){ iLineCounter +=1; kDataRequestID = llGetNotecardLine(sCONFIG_CARD, iLineCounter); } } else { if (llGetListLength(lAvi_name) == 0){ llOwnerSay("No Avatars loaded from config file, voice control only"); iCard_loaded = FALSE; } else { llOwnerSay((string)llGetListLength(lAvi_name) + " avatars loaded."); } iCard_loaded = TRUE; } } }
×
×
  • Create New...