Advertisement
Guest User

Untitled

a guest
Feb 9th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Hart Larsson - 2017
  2. //
  3. //--------------------Introduction------------------------------
  4. //
  5. // PXL SmartTexture HUD Configuration file
  6. //
  7. // Licencing
  8. // Please DO NOT distribuite an editable/viewable version of this script!
  9. // The concept and code are hereby released is not ON Public Domain
  10. // All the code is copyright of hart Larsson
  11. // Please dont modify, resell or reverse engineering.
  12.  
  13. //=================================================================
  14. //   Configuration editable Parameters for [PXL] ST_root_ HUD v3.3
  15. //=================================================================
  16.  
  17. // Write here your LICENSE CODE without spaces between = and ; (now is zero for default)
  18.  
  19. integer LicCode=21624659;
  20.  
  21. // Write the Product Name to control without spaces between "" (ONLY LETTERS and NUMBERS)
  22. // Name is case sensitive.
  23.  
  24. string ProductName="FMLRamen";
  25.  
  26. // (1|0 : ACTIVE | DEACTIVE) Enabling or disabling the Owner Startup message when attached
  27.  
  28. integer OwnerMessages=1;
  29.  
  30. // write between [ ] the list of the textures connected to all HUD buttons.
  31. // is possible for a single HUD button to send multiple texture change to differents prims
  32. //
  33. // The syntax:
  34. // button_name_List|name_of_the_destination_prims_to_retexture|UUID_key_of_the_texture_to_send|faces
  35. // Button_name_List can be a single name or a list of button separate by a minus sign "-" like: B1-B2-...-Bn
  36. // Name of destination prims can be single one or a list separated by minus sign "-" like: P1-P2-...-Pn
  37. // To specify all prims to retexture write ALL_PRIMS
  38. // for all faces retexturization please write ALL (optional)
  39. // 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
  40. // all face numbers are separated by a minus sign "-"
  41. // remember that at the end of the all lines except the last texture line is needed a , char
  42.  
  43. list Textures = [" Black|FMLRamen|3ac3797a-7c5e-3c6c-5490-d8e31767cb82|3-2-0 "];
  44.  
  45.  
  46.  
  47. // the communication range is the distance between your HUD and your product/s
  48. //
  49. // Value    |   Range in Meters     |  common use
  50. //  0           10                      attachments
  51. //  1           20                      Rezzed products
  52. //  2           100                     Rezzed Products
  53. //  3           Region Whide            Sim Wide theme
  54. //
  55. // please read carefully the manual about the use
  56.  
  57. integer CommRange = 2;
  58.  
  59.  
  60.  
  61. //==============================================================
  62. //  END OF PARAMETERS, DO NOT TOUCH ANY OTHER LINES UNDER THIS
  63. //==============================================================
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. //-------------------------------------------------
  152. StreamTextures(string ButtonName) {
  153.     integer len = llGetListLength( Textures );
  154.     string risultato ="";
  155.     integer c = 0;
  156.  
  157.     if ( len > 0 ) {
  158.  
  159.         integer i;
  160.         for( i = 0; i < len; i++ )
  161.         {            
  162.             list parsedrecord = llParseString2List(llList2String(Textures, i),["|"],[]);              
  163.             list ButtonID = llParseString2List(llList2String(parsedrecord,0) ,["-"],[]);  
  164.             string DestPrim = llList2String(parsedrecord,1);
  165.             string TextUUID = llList2String(parsedrecord,2);
  166.             string Faces = llList2String(parsedrecord,3);
  167.                                        
  168.             if(~llListFindList(ButtonID, (list)ButtonName))  
  169.             {
  170.                 risultato += DestPrim +"|"+
  171.                 TextUUID +"|"+Faces + ",";
  172.                 ++c;
  173.             }
  174.            
  175.             if (c >= 5 ) {
  176.                  risultato = llDeleteSubString(risultato,-1,-1);
  177.                  llMessageLinked(LINK_THIS,
  178.                                 2,
  179.                                 Encrypt("FOUNDTEXT#"+ risultato ),
  180.                                 (string)llGetOwner()
  181.                                 );            
  182.                 risultato = "";
  183.                 c=0;  
  184.             }
  185.         } // for
  186.  
  187.          if (risultato != "" ) {
  188.              risultato = llDeleteSubString(risultato,-1,-1);
  189.              llMessageLinked(LINK_THIS,
  190.                             2,
  191.                             Encrypt("FOUNDTEXT#"+ risultato ),
  192.                             (string)llGetOwner()
  193.                             );    
  194.         }  
  195.     } // len=0
  196. }
  197.  
  198. //------------------------------------------------
  199. // Encrypt/DeCrypt
  200. //------------------------------------------------
  201. string cryptokey = "";
  202. //------------------------------------------------
  203.  
  204. string Encrypt(string s1){
  205.     return llXorBase64StringsCorrect(llStringToBase64(s1), llStringToBase64(cryptokey));
  206. }
  207.  
  208. string Decrypt(string s1){
  209.     return llBase64ToString( llXorBase64StringsCorrect(s1, llStringToBase64(cryptokey)) );
  210. }
  211.  
  212.  
  213.  
  214. default
  215. {
  216.     //------------------- REZZING -----------------------
  217.  
  218.     on_rez(integer param)
  219.     {
  220.         llResetScript();
  221.     }
  222.  
  223.  
  224.     //------------------- ENTRY -----------------------
  225.  
  226.     state_entry() {
  227.        
  228.          cryptokey = (string)LicCode+ProductName;
  229.          if (OwnerMessages) llOwnerSay("SmartTexture Config, Free Memory: "+(string)llGetFreeMemory()+"KiB");
  230.  
  231.     }
  232.  
  233.     //------------------- LINKED -----------------------
  234.  
  235.  
  236.  
  237.     link_message(integer sender_number, integer number, string message, key id)
  238.     {
  239.  
  240.         if (id == llGetOwner() && number == 1) {
  241.  
  242.             list lstMessageParsed = llParseString2List(message,["#"],[]);
  243.  
  244.            
  245.             //-------------- send Config to HUD core
  246.            
  247.             if(llList2String(lstMessageParsed,0) == "LOAD")
  248.                 {
  249.                 llMessageLinked(LINK_THIS,
  250.                                 1,
  251.                                 "CONFIG#"+
  252.                                 (string)LicCode+"#"+
  253.                                 ProductName+"#"+
  254.                                 (string)OwnerMessages+"#"+
  255.                                 (string)CommRange,  
  256.                                 (string)llGetOwner()
  257.                                 );
  258.                 }
  259.            
  260.             if(llList2String(lstMessageParsed,0) == "SEARCHTEXT")
  261.             {
  262.                 StreamTextures( llList2String(lstMessageParsed,1) );
  263.             }
  264.                      
  265.         }  // id=1                            
  266.     } // linked end
  267.    
  268.    
  269. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement