Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string EncryptFindID (string FindTheID) //When directly using llFindNotecardTextSync, we need to (re)encrypt the string so it can find it in the encrypted notecard
- {
- string FindIDEncrypted = llStringToBase64(FindTheID); //Convert the text into base64
- integer FindIDLength = llStringLength(FindIDEncrypted) - 1; //llGetSubString's index starts from 0, rather than 1, so we want to subtract 1 from the length to use the correct index number
- string FindEqual = llGetSubString(FindIDEncrypted, FindIDLength - 1, FindIDLength); //Find the last two characters in the encrypted string
- string FindSecondEqual = llGetSubString(FindIDEncrypted, FindIDLength, FindIDLength); //Find the last character in the encrypted string
- if(FindSecondEqual == "=") //If the last character is an equal sign
- {
- string FindIDEncryptedClipped = llGetSubString(FindIDEncrypted, 0, FindIDLength - 2); //Go from index 0 up to and including the index of the second to last character; this ensures that the last character is properly clipped from the from the main string; for example, if the string were 5 characters long and we wanted to cut off the last character in the string, we'd do 5-2 to get 3, which is the second to last index when counting from 0-4
- if(FindEqual == "==") //If the last two characters are a double equal sign
- {
- FindIDEncryptedClipped = llGetSubString(FindIDEncrypted, 0, FindIDLength - 3); //Go from index 0 up to and including the third to last character to clip the last two characters off from the string
- FindIDEncryptedClipped = "◆" + FindIDEncryptedClipped; //Add the delimiter to the string, as we're looking for the string at the head of the notecard line
- return FindIDEncryptedClipped; //Return the encrypted string with delimiter for the llFindNotecardSync to look for
- }
- else
- {
- FindIDEncryptedClipped = "◆" + FindIDEncryptedClipped; //Add the delimiter to the string, as we're looking for the string at the head of the notecard line
- return FindIDEncryptedClipped; //Return the encrypted string with delimiter for the llFindNotecardSync to look for
- }
- }
- else
- {
- FindIDEncrypted = "◆" + FindIDEncrypted; //Add the delimiter to the string, as we're looking for the string at the head of the notecard line
- return FindIDEncrypted; //Return the encrypted string with delimiter for the llFindNotecardSync to look for
- }
- }
Add Comment
Please, Sign In to add comment