Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string server = "https://www.auratrails.eu/";
- string passPhrase = "this is wrong";
- key creatorid="18875f5d-0de5-4eb3-a527-361a69431d24";
- key sellerid="56c30c2a-9c30-49a1-8cd3-424c74006d79";
- key usbstick="cf920f3c-d525-455f-a0ce-605c6b3b48db";
- string usbstickdate="2014-01-07T03:17:52.393113Z";
- string soundpack;
- key ReceiverKey;
- string ReceiverName;
- key responseId;
- integer gchannel;
- do_dialog()
- {
- gchannel = 0x80000000 | (integer)llFrand(65536) | ((integer)llFrand(65536) << 16);
- 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);
- }
- llFade(integer linknumber, float AlphaStart, float AlphaEnd, integer faces, float speed)
- {
- if(AlphaStart<AlphaEnd)
- {
- for(;AlphaStart<AlphaEnd;)
- {
- AlphaStart+=speed;
- llSetAlpha(AlphaStart, faces);
- }
- return;
- }
- else if(AlphaStart>AlphaEnd)
- {
- for(;AlphaStart>AlphaEnd;)
- {
- AlphaStart-=speed;
- llSetAlpha(AlphaStart, faces);
- }
- return;
- }
- }
- HTTP_Send(string phpscript, list headernames, list headervalues, list postnames, list postvalues, integer replymaxlength)
- {
- //messageRecieved = FALSE;
- //responseId = NULL_KEY;
- list HTTP_Params =
- [
- HTTP_METHOD, "POST",
- HTTP_MIMETYPE, "application/x-www-form-urlencoded",
- HTTP_VERIFY_CERT, TRUE,
- HTTP_VERBOSE_THROTTLE, FALSE
- ];
- if(replymaxlength > 0)
- {
- HTTP_Params += [HTTP_BODY_MAXLENGTH, replymaxlength];
- }
- headernames += ["Password","Time"];
- headervalues += [passPhrase, (string)llGetUnixTime()];
- integer hcount;
- for(;hcount < llGetListLength(headernames);++hcount)
- {
- HTTP_Params += [HTTP_CUSTOM_HEADER, llList2String(headernames, hcount), llList2String(headervalues, hcount)];
- }
- string poststring;
- integer pcount;
- for(;pcount < llGetListLength(postnames);++pcount)
- {
- if(pcount > 0) poststring += "&";
- poststring += llList2String(postnames, pcount) + "=" + llList2String(postvalues, pcount);
- }
- responseId = llHTTPRequest(server + phpscript,HTTP_Params, poststring);
- }
- default
- {
- touch_start(integer num)
- {
- if (llDetectedKey(0) == llGetOwner()) {
- HTTP_Send(
- "SLAPI/Ambiance3/register.php",
- ["ReceiverKey","ReceiverName","Packname","Extrabuttons"],
- [ReceiverKey,ReceiverName,soundpack,"NULL"],
- [],
- [], 8192);
- }
- }
- on_rez(integer num)
- {
- llResetScript();
- }
- state_entry()
- {
- llSetText("", <1,1,1>, 1.0);
- // llFade(1, 0.0,1.0,ALL_SIDES,0.0005);
- ReceiverKey=llGetOwner();
- ReceiverName=llKey2Name(llGetOwner());
- string input =llGetObjectName();
- soundpack = llGetSubString(input,llSubStringIndex(input,"(")+1, llSubStringIndex(input,")")-1);
- list sec_details = llGetObjectDetails(llGetKey(), ([OBJECT_CREATOR, OBJECT_CREATION_TIME]));
- key this_creator=llList2String(sec_details, 0);
- string this_creation_time=llList2String(sec_details, 1);
- if (this_creator!=usbstick || this_creation_time!=usbstickdate) {
- llOwnerSay("An error occured. Please contact secondlife:///app/agent/" + (string)creatorid + "/about for assistance.");
- llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about ran into object security issues with the " + soundpack + " installer!");
- llRemoveInventory(llGetScriptName());
- llSleep(20);
- }
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.", <1,1,1>, 1.0);
- llOwnerSay("Installing " + soundpack + " to all your DMS Moored Ambiance Systems.");
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♪♪♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♪♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♪♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♪♪♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♪♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♪♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♪♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♪♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♪♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♫♪]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[♫♫♫♫♫♫♫♫♫♫]", <1,1,1>, 1.0);
- llSleep(0.3);
- llSetText("Installing: " + soundpack + " to all your DMS Moored Ambiance Systems.\n\n[**** DONE! ****]", <1,1,1>, 1.0);
- HTTP_Send(
- "SLAPI/Ambiance3/register.php",
- ["ReceiverKey","ReceiverName","Packname","Extrabuttons"],
- [ReceiverKey,ReceiverName,soundpack,"NULL"],
- [],
- [], 8192);
- }
- http_response(key responseid, integer status, list metadata, string body)
- {
- if(responseId == responseid)
- {
- string shortbody =llGetSubString(body, 0, 6);
- // llOwnerSay(shortbody);
- // llOwnerSay(body);
- if (status==200 && shortbody=="Success")
- {
- llSetText("", <1,1,1>, 1.0);
- llOwnerSay("Your " + soundpack + " moored ambiance sound-pack has been succesfully registered for all your DMS Moored Ambiance sound systems to use.");
- llOwnerSay("To use this soundpack, press the [reload] button in your Ambiance menu, or re-rez your boat.");
- llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about has just installed the " + soundpack +" sound-pack.");
- do_dialog();
- if(llGetOwner()!=creatorid && llGetOwner()!=sellerid) {
- llSetText("Unpacked and installed succesfully! - Empty", <1,1,1>, 1.0);
- if(llGetAttached()) {
- llOwnerSay("This sound package has been unpacked succesfully, you can delete me now.");
- llSetText("", <1,1,1>, 1.0);
- llFade(1, 1.0,0.0, ALL_SIDES, 0.0001);
- llRemoveInventory(llGetScriptName());
- }
- else
- {
- llOwnerSay("This sound package has been unpacked succesfully, deleting myself.");
- llFade(1, 1.0,0.0, ALL_SIDES, 0.0001);
- llDie();
- }
- }
- }
- else
- {
- llSetText("Error", <1,1,1>, 1.0);
- llOwnerSay("An error occured. Please contact secondlife:///app/agent/" + (string)creatorid + "/about for assistance or click me to try again.");
- llInstantMessage(creatorid, "secondlife:///app/agent/" + (string)llGetOwner() + "/about ran into a !status=200 error when installing: " + soundpack +" sound-pack.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement