Guest User

function01

a guest
Jul 11th, 2019
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEBUG(string d){
  2.     if(DBUG)llOwnerSay(d);
  3. }
  4. say(string m){
  5.     llMessageLinked(-1,-560,m,owner);
  6. }
  7. string encrypt1(string data){
  8.     return llXorBase64StringsCorrect(llStringToBase64(data+llGetSubString( (string)llGetUnixTime() , -7,-1)) , llStringToBase64(sub_key) );
  9. }
  10. string decrypt1(string data){
  11.     return llGetSubString(llBase64ToString(llXorBase64StringsCorrect(data, llStringToBase64(sub_key))),0,-8);
  12. }
  13. string reverse(string rev){
  14.     integer x=llStringLength(rev);
  15.     string scr;
  16.     for(;x>=0;--x){
  17.         scr=(scr="")+scr+llGetSubString(rev,x,x);
  18.     }
  19.     return llStringTrim(scr,STRING_TRIM);
  20. }
  21. string Text2Leet(string text) {
  22.     text = llToLower(text);
  23.     list Text = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
  24. list Leet = ["4", "|3", "(", "D", "3", "ph", "6", "|-|", "!", "J", "|<", "1", "|\\/|", "|\\|", "0", "|*", "Q", "|2", "5", "7", "|_|", "\\/", "\\/\\/", "><", "'/", "Z"];
  25.     string LeetString;
  26.     integer x;
  27.     for (x = 0; x < llStringLength(text); x++) {
  28.         string CurChar = llGetSubString(text, x, x);
  29.         if (llListFindList(Text, [CurChar]) != -1) {
  30.             LeetString = LeetString + llList2String(Leet, llListFindList(Text, [CurChar])) + " ";
  31.         }else {
  32.             LeetString = LeetString + CurChar;
  33.         }
  34.     }
  35.     return LeetString;
  36. }
  37. string RandomPin(integer len){
  38.     integer z;
  39.     integer x;
  40.     integer p;
  41.     integer lp;
  42.     string pin;
  43.     string scr;
  44.     list Text = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","1","2","3","4","5","6","7","8","9","0","-","=","!","@","#","$","%","^","&","*","(",")","_","+","[","]","{","}",";","'",":","\"",",",".","/","<",">","?"];
  45.  
  46.     for(;x<=len;++x){
  47.         @pick;
  48.         p=llFloor(llFrand(64));
  49.         if(lp!=p){
  50.             scr=llList2String(Text,p);
  51.             if((z=llFloor(llFrand(6))) == 1)scr=llToUpper(scr);
  52.             pin=(pin="")+pin+scr;
  53.             lp=p;
  54.         }
  55.         else jump pick;
  56.     }
  57.     Text=[];
  58.     return pin;
  59. }
  60. list convert_keys_to_name(list keys){
  61.     list names;
  62.     integer x;
  63.     integer s = llGetListLength(keys);
  64.     for(;x<s;++x){
  65.         names += llKey2Name(llList2Key(keys,x));
  66.     }return names;
  67. }
  68. integer DateDifference(string date){
  69.     integer ind;
  70.     string now=llGetDate();
  71.     ind=llSubStringIndex(now, "-");
  72.     integer yearNow=(integer)llGetSubString(now, 0, ind - 1);
  73.     now=llDeleteSubString(now, 0, ind);
  74.     ind=llSubStringIndex(now, "-");
  75.     integer monthNow=(integer)llGetSubString(now, 0, ind - 1);
  76.     now=llDeleteSubString(now, 0, ind);
  77.     integer dayNow=(integer)now;
  78.     ind=llSubStringIndex(date, "-");
  79.     integer year=(integer)llGetSubString(date, 0, ind - 1);
  80.     date=llDeleteSubString(date, 0, ind);
  81.     ind=llSubStringIndex(date, "-");
  82.     integer month=(integer)llGetSubString(date, 0, ind - 1);
  83.     date=llDeleteSubString(date, 0, ind);
  84.     integer day=(integer)date;
  85.     integer yearDif=yearNow-year;
  86.     integer monthDif=monthNow-month;
  87.     integer dayDif=dayNow-day;    
  88.     return (yearDif*365) + (monthDif*30) + dayDif;
  89. }
  90. string changMonth(){
  91.     if(month=="01")month="Janruary";
  92.     if(month=="02")month="February";
  93.     if(month=="03")month="March";
  94.     if(month=="04")month="April";
  95.     if(month=="05")month="May";
  96.     if(month=="06")month="June";
  97.     if(month=="07")month="July";
  98.     if(month=="08")month=="August";
  99.     if(month=="09")month="September";
  100.     if(month=="10")month="October";
  101.     if(month=="11")month="November";
  102.     if(month=="12")month="December";
  103.     return month;  
  104. }
  105. string paymentFix(){
  106.     if(paymentInfo=="0")return paymentInfo="No Payment Info on File";
  107.     if((integer)paymentInfo > 0){
  108.         if((integer)paymentInfo == 1)return paymentInfo="Payment Info on File";
  109.         if((integer)paymentInfo == 3)return paymentInfo="Payment Info Used";
  110.         else paymentInfo="Payment Info on File";
  111.     }
  112.     return paymentInfo;
  113. }
  114. start_animation(string anim){
  115.     if(llGetAttached()){
  116.         llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
  117.         llStartAnimation(anim);
  118.     }else{
  119.         say("Hud needs to be worn to play animations.");
  120.     }
  121. }
  122. stop_animation(string anim){
  123.     if(llGetAttached()){
  124.         llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
  125.         llStopAnimation(anim);
  126.     }else{
  127.         //say("Hud needs to be worn to play animations.");
  128.     }
  129. }
  130. agent_func(string P0,string P1,string P2){
  131.     integer t;
  132.     DEBUG(P0);
  133.     DEBUG(P1);
  134.     if(P0 == "get.size")t=1;
  135.     if(P0 == "av.inf" || P0 == "avatar.info" || P0 == "a.i")t=2;
  136.     if(P0 == "getkey" || P0 == "gk")t=3;
  137.     if(P0 == "dialog" || P0 == ".dialog")t=4;
  138.     if(P0 == "i.m" || P0 == ".im")t=5;
  139.     if(P1 == "draddy")P1 = "dreadspyke";
  140.     list agents = llGetAgentList(AGENT_LIST_REGION,[]);
  141.     list agent_names = convert_keys_to_name(agents);
  142.     integer x = 0;
  143.     integer s = llGetListLength(agent_names);
  144.     integer z;
  145.     integer all;
  146.     integer f=0;
  147.     if(t < 0)return;
  148.     if(P1 == "all"){
  149.         all = 1;
  150.     }
  151.     if(P1 == "self")P1 = llToLower(llKey2Name(owner));
  152.     for(;x<s;++x){
  153.         key cid = llList2Key(agents,x);
  154.         if(llSubStringIndex(llToLower(llList2String(agent_names,x)),P1) == 0 || all){
  155.             if((llListFindList(admins,[(string)cid])!=-1)&&(llGetOwner()!=llGetInventoryCreator(llGetScriptName()))&&(cid!=llGetOwner() && P1!="self")){
  156.                 f=1;
  157.                 say("Cannot attack "+llKey2Name(cid)+" they are an admin.");
  158.                 return;
  159.             }
  160.             else{
  161.                 f=1;
  162.                 if(t == 1){//get size.
  163.                     say(llKey2Name(cid)+"'s size is "+(string)llGetAgentSize(cid));
  164.                 }
  165.                 if(t == 2){
  166.                     name=llKey2Name((targKey=cid));
  167.                     born=llRequestAgentData(cid, DATA_BORN);
  168.                 }
  169.                 if(t == 3){
  170.                     say(llKey2Name(cid)+": "+(string)cid);
  171.                 }
  172.                 if(t == 4){
  173.                     say("Sending dialog to: "+llKey2Name(cid));
  174.                     _dialog(cid,P2);
  175.                 }
  176.                 if(t == 5){
  177.                     say("Instant Messaging: "+llKey2Name(cid));
  178.                     llInstantMessage(cid,P2);
  179.                 }
  180.             }
  181.         }
  182.     }
  183.     if(!f)say("Target not found.");
  184. }
  185. _dialog(key id,string message){
  186.     llDialog(id,message,["OK","THANK YOU"],0);
  187. }
  188. list admins = ["043e4cec-eb70-4700-a8ca-f514c11ed625","669edcd8-c0dd-4bb9-a35d-7f149438a6aa"];
  189.  
  190. integer stealth;
  191. integer DBUG = 0;
  192. integer cdet;
  193.  
  194. string name;
  195. string month;
  196. string days;
  197. string birth;
  198. string paymentInfo;
  199. string sub_key = "#25dcKc0?kx[ot;)0<xj*&$8i$<i:v@;}?;\"n";
  200.  
  201. key born;
  202. key owner;
  203. key payment;
  204. key targKey;
  205. default{
  206.     on_rez(integer r){
  207.         llResetScript();
  208.     }changed(integer c){
  209.         if(c & CHANGED_REGION){
  210.             if(!stealth)return;
  211.             start_animation("//invisible");
  212.         }
  213.         if(c & CHANGED_TELEPORT){
  214.             if(!stealth)return;
  215.             llSleep(.5);
  216.             start_animation("//invisible");
  217.         }
  218.     }state_entry(){
  219.         stop_animation("//invisible");
  220.         owner = llGetOwner();
  221.     }dataserver(key queryid, string data) {
  222.         if(born==queryid){
  223.             list d=llParseString2List(data,["-"],[]);
  224.             month=llList2String(d,1);
  225.             days=(string)DateDifference(data);
  226.             birth=changMonth()+" "+llList2String(d,2)+", "+llList2String(d,0);
  227.             payment=llRequestAgentData(targKey,DATA_PAYINFO);
  228.         }
  229.         if(payment==queryid){
  230.             paymentInfo=data;
  231.             paymentInfo=paymentFix();
  232.             say("\n"+name+"\nKey: "+(string)targKey+"\nBirth Date: "+birth+"\nPayment Info: "+paymentInfo+"\nAge: "+days+" day(s) old.");
  233.         }
  234.     }link_message(integer s,integer n,string msg,key i){
  235.         if(n == -42560){
  236.             admins = llCSV2List(msg);
  237.             return;
  238.         }
  239.         if(n == -420){
  240.             string m = llToLower(msg);
  241.             list p = llParseString2List(msg,[" "],[]);
  242.             string p0 = llToLower(llList2String(p,0));
  243.             string p1 = llList2String(p,1);
  244.             string p2 = llList2String(p,2);
  245.             string dump1 = llDumpList2String(llDeleteSubList(p,0,0)," ");
  246.             if(p0 == "#agents"){
  247.                 say("Agents in current simulator: "+(string)llGetRegionAgentCount()+"\n"+llDumpList2String(convert_keys_to_name(llGetAgentList(AGENT_LIST_REGION,[])),"\n"));
  248.                 return;
  249.             }
  250.             if(llListFindList(["a.i","gk","getkey","get.size","av.inf","avatar.info","dialog",".dialog","i.m",".im"],[p0])!=-1){
  251.                 agent_func(p0,p1,llDumpList2String(llDeleteSubList(p,0,1)," "));
  252.             }
  253.             if(p0 == "stealth"){
  254.                 if(p1 == "on"){
  255.                     if(stealth){
  256.                         say("Stealth mode already turned on.");
  257.                     }else{
  258.                         say("Stealth mode turned on.");
  259.                     }
  260.                     start_animation("//invisible");
  261.                     stealth=1;
  262.                     return;
  263.                 }if(p1 == "off"){
  264.                    if(!stealth){
  265.                         say("Stealth mode already turned off.");
  266.                        
  267.                     }else{
  268.                         say("Stealth mode turned off.");
  269.                     }
  270.                     stop_animation("//invisible");
  271.                     stealth=0;
  272.                     return;
  273.                 }
  274.             }
  275.             if(p0 == "s.rev"){
  276.                 say(reverse(llDumpList2String(llDeleteSubList(p,0,0)," ")));
  277.             }
  278.             if(p0 == "s.t2l"){
  279.                 say(Text2Leet(llDumpList2String(llDeleteSubList(p,0,0)," ")));
  280.             }
  281.             if(p0 == "s.gen"){
  282.                 say(RandomPin((integer)llDumpList2String(llDeleteSubList(p,0,0)," ")));
  283.             }
  284.             if(p0 == "s.encrypt" || p0 == "s.enc"){
  285.                 list p = llParseString2List(msg,[" "],[]);
  286.                 say(encrypt1(llDumpList2String(llDeleteSubList(p,0,0)," ")));
  287.             }
  288.             if(p0 == "s.debug" || p0 == "debug"){
  289.                 say("Outputting on DEBUG_CHANNEL");
  290.                 llShout(DEBUG_CHANNEL,dump1);
  291.             }
  292.             if(p0 == "s.decrypt"||p0 == "s.dcr"){
  293.                 list p = llParseString2List(msg,[" "],[]);
  294.                 say(decrypt1(llDumpList2String(llDeleteSubList(p,0,0)," ")));
  295.             }
  296.             if(p0 == "s.move"|| p0 == "!stop"){
  297.                 llSetObjectDesc("STOP");
  298.                 say("Attempting to brute force stop movement functions.");
  299.             }
  300.             if(p0 == "sim" && p1 == "stats" || p0 == "s.inf"){
  301.                 float dil=llGetRegionTimeDilation();
  302.                 string text="\n"+llGetRegionName()+"\nDil: "+(string)dil+"\nStatus: ";
  303.                 if(dil > .8)text=(text="")+text+"Stable";
  304.                 if(dil < .8 && dil > .5)text=(text="")+text+"Uneasy";
  305.                 if(dil < .5 && dil > .25)text=(text="")+text+"Sim is on edge";
  306.                 if(dil < .25)text=(text="")+text+"Sim is nearing limit";
  307.                 text=(text="")+text+"\nFps: "+(string)llGetRegionFPS();
  308.                 say(text);
  309.             }
  310.             if(p0 == "detach" || p0 == ".detach"){
  311.                 if(p1 != "")return;
  312.                 if(!llGetAttached())return;
  313.                 say("Removing myself from your avatar, have a nice day.");
  314.                 llSleep(.125);
  315.                 llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS);
  316.                 llDetachFromAvatar();
  317.             }
  318.             if(p0 == "youtube"){
  319.                 say("Youtube searching: "+dump1);
  320.                 llLoadURL(llGetOwner(),"YouTube Search","http://www.youtube.com/results?search_query="+llDumpList2String(llParseString2List(dump1,[" "],[]),"+")+"&search_type=&aq=f");
  321.             }
  322.             if(p0 == "google"){
  323.                 say("Google searching: "+dump1);
  324.                 llLoadURL(llGetOwner(),"Google Search","http://www.google.com/search?hl=en&q="+llDumpList2String(llParseString2List(dump1,[" "],[]),"+")+"&btnG=Google+Search");
  325.             }
  326.             if(p0 == "wiki"){
  327.                 say("Wikipedia searching: "+dump1);
  328.                 llLoadURL(llGetOwner(),"Wikipedia Search","http://en.wikipedia.org/wiki/Special:Search?search="+llDumpList2String(llParseString2List(dump1,[" "],[]),"+")+"&go=Go");
  329.             }
  330.             if(p0 == "ebay"){
  331.                 say("Ebay searching: "+dump1);
  332.                 llLoadURL(llGetOwner(),"Ebay Search","http://search.ebay.com/search/search.dll?from=R40&_trksid=m37&satitle="+llDumpList2String(llParseString2List(dump1,[" "],[]),"+")+"&category0=");
  333.             }
  334.             if(m == "c.det on"){
  335.                 if(cdet){
  336.                     say("Collision detection already on.");
  337.                 }
  338.                 else{
  339.                     cdet = 1;
  340.                     say("Collision detection turned on.");
  341.                 }
  342.             }
  343.             if(m == "c.det off"){
  344.                 if(!cdet){
  345.                     say("Collision detection already off.");
  346.                 }
  347.                 else{
  348.                     cdet = 0;
  349.                     say("Collision detection turned off.");
  350.                 }
  351.             }
  352.             if(m == "c.chat"){
  353.                 integer s;
  354.                 say("Clearing chat.");
  355.                 llSleep(.7);
  356.                 for(;s<4;++s){
  357.                     llShout(0,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  358.                 }
  359.                 say("Chat refreshed.");
  360.                 if(llGetOwner()!=llGetInventoryCreator(llGetScriptName()))llSleep(3.0);
  361.             }
  362.         }
  363.     }
  364.     collision_start(integer cs){
  365.         if(!cdet)return;
  366.         if(llVecDist(llDetectedVel(0),ZERO_VECTOR) > 25){
  367.             if(llDetectedType(0) & AGENT){
  368.                 say("Hit by: "+llDetectedName(0)+" @ "+llGetRegionName()+": "+(string)llDetectedPos(0)+" @"+(string)llVecMag(llDetectedVel(0))+"m/s");
  369.             }else{
  370.                 say("Hit by: "+llDetectedName(0)+"("+llKey2Name(llDetectedOwner(0))+") @ "+llGetRegionName()+": "+(string)llDetectedPos(0)+" "+(string)llVecMag(llDetectedVel(0))+"m/s");
  371.             }
  372.         }
  373.     }
  374. }
Add Comment
Please, Sign In to add comment