Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hart Larsson - 2017
- //
- //--------------------Introduction------------------------------
- //
- // PXL SmartTexture HUD Configuration file
- //
- // Licencing
- // Please DO NOT distribuite an editable/viewable version of this script!
- // The concept and code are hereby released is not ON Public Domain
- // All the code is copyright of hart Larsson
- // Please dont modify, resell or reverse engineering.
- //=================================================================
- // Configuration editable Parameters for [PXL] ST_root_ HUD v3.3
- //=================================================================
- // Write here your LICENSE CODE without spaces between = and ; (now is zero for default)
- integer LicCode=21624659;
- // Write the Product Name to control without spaces between "" (ONLY LETTERS and NUMBERS)
- // Name is case sensitive.
- string ProductName="FMLRamen";
- // (1|0 : ACTIVE | DEACTIVE) Enabling or disabling the Owner Startup message when attached
- integer OwnerMessages=1;
- // write between [ ] the list of the textures connected to all HUD buttons.
- // is possible for a single HUD button to send multiple texture change to differents prims
- //
- // The syntax:
- // button_name_List|name_of_the_destination_prims_to_retexture|UUID_key_of_the_texture_to_send|faces
- // Button_name_List can be a single name or a list of button separate by a minus sign "-" like: B1-B2-...-Bn
- // Name of destination prims can be single one or a list separated by minus sign "-" like: P1-P2-...-Pn
- // To specify all prims to retexture write ALL_PRIMS
- // for all faces retexturization please write ALL (optional)
- // for specify a list of face of a a prim use this syntax face1-face2-faceN where face1 and so on are numeric value from 0 to 5
- // all face numbers are separated by a minus sign "-"
- // remember that at the end of the all lines except the last texture line is needed a , char
- list Textures = [" Black|FMLRamen|3ac3797a-7c5e-3c6c-5490-d8e31767cb82|3-2-0 "];
- // the communication range is the distance between your HUD and your product/s
- //
- // Value | Range in Meters | common use
- // 0 10 attachments
- // 1 20 Rezzed products
- // 2 100 Rezzed Products
- // 3 Region Whide Sim Wide theme
- //
- // please read carefully the manual about the use
- integer CommRange = 2;
- //==============================================================
- // END OF PARAMETERS, DO NOT TOUCH ANY OTHER LINES UNDER THIS
- //==============================================================
- //-------------------------------------------------
- StreamTextures(string ButtonName) {
- integer len = llGetListLength( Textures );
- string risultato ="";
- integer c = 0;
- if ( len > 0 ) {
- integer i;
- for( i = 0; i < len; i++ )
- {
- list parsedrecord = llParseString2List(llList2String(Textures, i),["|"],[]);
- list ButtonID = llParseString2List(llList2String(parsedrecord,0) ,["-"],[]);
- string DestPrim = llList2String(parsedrecord,1);
- string TextUUID = llList2String(parsedrecord,2);
- string Faces = llList2String(parsedrecord,3);
- if(~llListFindList(ButtonID, (list)ButtonName))
- {
- risultato += DestPrim +"|"+
- TextUUID +"|"+Faces + ",";
- ++c;
- }
- if (c >= 5 ) {
- risultato = llDeleteSubString(risultato,-1,-1);
- llMessageLinked(LINK_THIS,
- 2,
- Encrypt("FOUNDTEXT#"+ risultato ),
- (string)llGetOwner()
- );
- risultato = "";
- c=0;
- }
- } // for
- if (risultato != "" ) {
- risultato = llDeleteSubString(risultato,-1,-1);
- llMessageLinked(LINK_THIS,
- 2,
- Encrypt("FOUNDTEXT#"+ risultato ),
- (string)llGetOwner()
- );
- }
- } // len=0
- }
- //------------------------------------------------
- // Encrypt/DeCrypt
- //------------------------------------------------
- string cryptokey = "";
- //------------------------------------------------
- string Encrypt(string s1){
- return llXorBase64StringsCorrect(llStringToBase64(s1), llStringToBase64(cryptokey));
- }
- string Decrypt(string s1){
- return llBase64ToString( llXorBase64StringsCorrect(s1, llStringToBase64(cryptokey)) );
- }
- default
- {
- //------------------- REZZING -----------------------
- on_rez(integer param)
- {
- llResetScript();
- }
- //------------------- ENTRY -----------------------
- state_entry() {
- cryptokey = (string)LicCode+ProductName;
- if (OwnerMessages) llOwnerSay("SmartTexture Config, Free Memory: "+(string)llGetFreeMemory()+"KiB");
- }
- //------------------- LINKED -----------------------
- link_message(integer sender_number, integer number, string message, key id)
- {
- if (id == llGetOwner() && number == 1) {
- list lstMessageParsed = llParseString2List(message,["#"],[]);
- //-------------- send Config to HUD core
- if(llList2String(lstMessageParsed,0) == "LOAD")
- {
- llMessageLinked(LINK_THIS,
- 1,
- "CONFIG#"+
- (string)LicCode+"#"+
- ProductName+"#"+
- (string)OwnerMessages+"#"+
- (string)CommRange,
- (string)llGetOwner()
- );
- }
- if(llList2String(lstMessageParsed,0) == "SEARCHTEXT")
- {
- StreamTextures( llList2String(lstMessageParsed,1) );
- }
- } // id=1
- } // linked end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement