Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string server = "https://www.auratrails.eu/";
  2. string passPhrase = "this is wrong";
  3. key creatorid="18875f5d-0de5-4eb3-a527-361a69431d24";
  4. key sellerid="56c30c2a-9c30-49a1-8cd3-424c74006d79";
  5. key usbstick="cf920f3c-d525-455f-a0ce-605c6b3b48db";
  6. string usbstickdate="2014-01-07T03:17:52.393113Z";
  7.  
  8. string soundpack;
  9. key ReceiverKey;
  10. string ReceiverName;
  11. key responseId;
  12.  
  13. integer gchannel;
  14.  
  15. do_dialog()
  16.     {
  17.         gchannel = 0x80000000 | (integer)llFrand(65536) | ((integer)llFrand(65536) << 16);
  18.  
  19.         llDialog(ReceiverKey, "\nThank you for your purchase.\n"+ soundpack + " has been registered to all your DMS Moored Ambiance enabled vessels.\nTo see the new sound-packs in the [Sounds] menu, please hit [Reload] in your DMS Moored Ambiance menu or re-rez your vessel.\n\nThis usb-stick will self destruct now.", ["Understand" ] , gchannel);
  20.        
  21. }
  22.  
  23. llFade(integer linknumber, float AlphaStart, float AlphaEnd, integer faces, float speed)
  24. {
  25.     if(AlphaStart<AlphaEnd)
  26.     {
  27.         for(;AlphaStart<AlphaEnd;)
  28.         {
  29.             AlphaStart+=speed;
  30.             llSetAlpha(AlphaStart, faces);
  31.         }
  32.         return;
  33.     }
  34.     else if(AlphaStart>AlphaEnd)
  35.     {
  36.         for(;AlphaStart>AlphaEnd;)
  37.         {
  38.             AlphaStart-=speed;
  39.             llSetAlpha(AlphaStart, faces);
  40.         }
  41.         return;
  42.     }
  43. }
  44.  
  45. HTTP_Send(string phpscript, list headernames, list headervalues, list postnames, list postvalues, integer replymaxlength)
  46. {
  47.     //messageRecieved = FALSE;
  48.     //responseId = NULL_KEY;
  49.     list HTTP_Params =
  50.     [
  51.         HTTP_METHOD, "POST",
  52.         HTTP_MIMETYPE, "application/x-www-form-urlencoded",
  53.         HTTP_VERIFY_CERT, TRUE,
  54.         HTTP_VERBOSE_THROTTLE, FALSE
  55.     ];
  56.  
  57.     if(replymaxlength > 0)
  58.     {
  59.         HTTP_Params += [HTTP_BODY_MAXLENGTH, replymaxlength];
  60.     }
  61.     headernames += ["Password","Time"];
  62.     headervalues += [passPhrase, (string)llGetUnixTime()];
  63.    
  64.  
  65.  
  66.  
  67.     integer hcount;
  68.     for(;hcount < llGetListLength(headernames);++hcount)
  69.     {
  70.         HTTP_Params +=  [HTTP_CUSTOM_HEADER, llList2String(headernames, hcount), llList2String(headervalues, hcount)];
  71.     }
  72.     string poststring;
  73.     integer pcount;
  74.     for(;pcount < llGetListLength(postnames);++pcount)
  75.     {
  76.         if(pcount > 0) poststring += "&";
  77.         poststring +=  llList2String(postnames, pcount) + "=" + llList2String(postvalues, pcount);
  78.     }
  79.     responseId = llHTTPRequest(server + phpscript,HTTP_Params, poststring);
  80. }
  81.  
  82.  
  83.  
  84. default
  85. {
  86.  
  87.     touch_start(integer num)
  88.     {
  89.         if (llDetectedKey(0) == llGetOwner()) {
  90.                 HTTP_Send(
  91.                     "SLAPI/Ambiance3/register.php",
  92.                     ["ReceiverKey","ReceiverName","Packname","Extrabuttons"],
  93.                     [ReceiverKey,ReceiverName,soundpack,"NULL"],
  94.                     [],
  95.                     [], 8192);        
  96.             }
  97.        
  98.     }
  99.     on_rez(integer num)
  100.     {
  101.         llResetScript();
  102.     }
  103.     state_entry()
  104.     {
  105.         llSetText("", <1,1,1>, 1.0);      
  106. //        llFade(1, 0.0,1.0,ALL_SIDES,0.0005);
  107.         ReceiverKey=llGetOwner();
  108.         ReceiverName=llKey2Name(llGetOwner());
  109.        
  110.         string input =llGetObjectName();
  111.         soundpack = llGetSubString(input,llSubStringIndex(input,"(")+1, llSubStringIndex(input,")")-1);
  112.  
  113.         list sec_details = llGetObjectDetails(llGetKey(), ([OBJECT_CREATOR, OBJECT_CREATION_TIME]));
  114.         key this_creator=llList2String(sec_details, 0);
  115.         string this_creation_time=llList2String(sec_details, 1);
  116.        
  117.         if (this_creator!=usbstick || this_creation_time!=usbstickdate) {
  118.         llOwnerSay("An error occured. Please contact secondlife:///app/agent/" + (string)creatorid + "/about for assistance.");
  119.         llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about ran into object security issues with the " + soundpack + " installer!");
  120. llRemoveInventory(llGetScriptName());
  121. llSleep(20);
  122.             }      
  123.        
  124.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.", <1,1,1>, 1.0);
  125.         llOwnerSay("Installing " + soundpack + " to all your DMS Moored Ambiance Systems.");
  126.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♪♪♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
  127.         llSleep(0.3);
  128.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♪♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);        
  129.         llSleep(0.3);
  130.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
  131.         llSleep(0.3);
  132.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
  133.         llSleep(0.3);
  134.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♪♪♪♪♪♪]", <1,1,1>, 1.0);
  135.         llSleep(0.3);
  136.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♪♪♪♪♪]", <1,1,1>, 1.0);
  137.         llSleep(0.3);
  138.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♪♪♪♪]", <1,1,1>, 1.0);
  139.         llSleep(0.3);
  140.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♪♪♪]", <1,1,1>, 1.0);
  141.         llSleep(0.3);
  142.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♪♪]", <1,1,1>, 1.0);      
  143.         llSleep(0.3);
  144.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♫♪]", <1,1,1>, 1.0);
  145.         llSleep(0.3);
  146.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♫♫]", <1,1,1>, 1.0);
  147.         llSleep(0.3);
  148.         llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[**** DONE! ****]", <1,1,1>, 1.0);
  149.  
  150.                 HTTP_Send(
  151.                     "SLAPI/Ambiance3/register.php",
  152.                     ["ReceiverKey","ReceiverName","Packname","Extrabuttons"],
  153.                     [ReceiverKey,ReceiverName,soundpack,"NULL"],
  154.                     [],
  155.                     [], 8192);
  156.  
  157.     }
  158.     http_response(key responseid, integer status, list metadata, string body)
  159.     {
  160.         if(responseId == responseid)
  161.         {
  162.             string shortbody =llGetSubString(body, 0, 6);
  163. //            llOwnerSay(shortbody);
  164. //            llOwnerSay(body);
  165.             if (status==200 && shortbody=="Success")
  166.  
  167.             {
  168.                     llSetText("", <1,1,1>, 1.0);
  169.                     llOwnerSay("Your " + soundpack + " moored ambiance sound-pack has been succesfully registered for all your DMS Moored Ambiance sound systems to use.");
  170.                     llOwnerSay("To use this soundpack, press the [reload] button in your Ambiance menu, or re-rez your boat.");
  171.                     llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about has just installed the " + soundpack +" sound-pack.");
  172.  
  173.                     do_dialog();
  174.  
  175.                     if(llGetOwner()!=creatorid && llGetOwner()!=sellerid) {
  176.                     llSetText("Unpacked and installed succesfully! - Empty", <1,1,1>, 1.0);
  177.                     if(llGetAttached()) {
  178.                         llOwnerSay("This sound package has been unpacked succesfully, you can delete me now.");                        
  179.                        llSetText("", <1,1,1>, 1.0);
  180.                         llFade(1, 1.0,0.0, ALL_SIDES, 0.0001);                          
  181.                         llRemoveInventory(llGetScriptName());
  182.                     }
  183.                     else
  184.                     {
  185.                         llOwnerSay("This sound package has been unpacked succesfully, deleting myself.");
  186.                         llFade(1, 1.0,0.0, ALL_SIDES, 0.0001);
  187.                         llDie();
  188.                     }
  189.                     }
  190.             }
  191.             else
  192.             {
  193.                 llSetText("Error", <1,1,1>, 1.0);                
  194.                 llOwnerSay("An error occured. Please contact secondlife:///app/agent/" + (string)creatorid + "/about for assistance or click me to try again.");
  195.                 llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about ran into a !status=200 error when installing: " + soundpack +" sound-pack.");
  196.             }
  197.         }
  198.     }
  199. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement