Jump to content

Recent New LSL Functions / Changes - "Spring 2023 Scripting Summary"


Love Zhaoying
 Share

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

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

Recommended Posts

3 minutes ago, Quistess Alpha said:

I missed or forgot about the new list functions. It's nice to have a good overview of all the changes!

Not to mention the "replace substring" function.  Needed for so many years, that it will be a "difficult" adjustment for some of us (royal "we") to actually use it.

Link to comment
Share on other sites

5 minutes ago, Love Zhaoying said:

Not to mention the "replace substring" function.  Needed for so many years, that it will be a "difficult" adjustment for some of us (royal "we") to actually use it.

Oh yeah, much cleaner than parseString2List with the "search" as a separator then dumpList2String with "replace" as the separator!

Still doesn't help with double replacement though. (Fixing "Roses are blue, violets are red." takes 3 replace operations)

Edited by Quistess Alpha
Link to comment
Share on other sites

Crypto functions are a nice addition. A few years ago, i wanted to use JWT for communicating between an inworld script and my server. I had to give up this idea because lsl didn't provide a HMAC function. This would be possible now.

Furhtermore, llHMAC gives us a standard and straightfoward way to hash a string with a secret.

About llReplaceSubstring, the question is mainly why this was not added already 20 years ago :D

About string search, still waiting for a search with regex. Regex have been introduced in the LSD functions with llLinksetDataFindKeys so i hope we can expect some llSearchRegex, llReplaceRegex, etc... functions soon!

Edited by Aglaia
  • Like 1
Link to comment
Share on other sites

11 hours ago, Quistess Alpha said:

Still doesn't help with double replacement though. (Fixing "Roses are blue, violets are red." takes 3 replace operations)

* thinks up a complex solution to tokenize and parse using multiple nested schemas *

Link to comment
Share on other sites

  

On 5/9/2023 at 8:23 AM, Love Zhaoying said:

* thinks up a complex solution to tokenize and parse using multiple nested schemas *

* grabs a bucket of blue paint and heads for the rose garden *

Edited by Bugs Larnia
  • Like 1
Link to comment
Share on other sites

On 5/8/2023 at 1:38 PM, Love Zhaoying said:

Not to mention the "replace substring" function.  Needed for so many years, that it will be a "difficult" adjustment for some of us (royal "we") to actually use it.

I typically inserted my own replace substring function whenever I needed it lol. having a built in function is nice though. less to put in the script!

string omReplaceSubString(string msg, string search, string replace) {
   integer i = llSubStringIndex(msg, search);
   for(i>-1; i != -1; i=llSubStringIndex(msg, search)) {
      msg = llDeleteSubString(msg, i, i + (llStringLength(search)-1));
      msg = llInsertString(msg, i, replace);
   }
   return msg;
}

Edit: Only thing I didn't handle was the number of times to replace, I never thought that far outside the box nor ever really had too lol.

Edited by alexx Ohmai
  • Like 1
Link to comment
Share on other sites

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