SHARE
TWEET

reset/output

a guest Jul 11th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer type = 0;
  2. say(string s){
  3.     if(type == 0  || type == 5){
  4.         llOwnerSay(s);
  5.         return;
  6.     }if(type == 1){
  7.         llSay(0,s);
  8.         return;
  9.     }if(type == 2){
  10.         llShout(0,s);
  11.         return;
  12.     }if(type == 3){
  13.         llSetText(s,<1,1,1>,1);
  14.         return;
  15.     }if(type == 4){
  16.         llWhisper(0,s);
  17.         return;
  18.     }
  19.     llOwnerSay(s);
  20. }
  21. reset_all(integer silent){
  22.     integer x = 0;
  23.     string mn = llGetScriptName();
  24.     integer num = llGetInventoryNumber(10);
  25.     if(!silent)say("Resetting "+(string)(num-1)+" script(s).");
  26.     for(;x<num;++x){
  27.         string n = llGetInventoryName(10,x);
  28.         if(!llGetScriptState(n))llSetScriptState(n,1);
  29.         if(n!=name){
  30.             if(silent && n == "2.)Input.lsl"){
  31.             }else{
  32.                 llResetOtherScript(n);
  33.             }
  34.         }
  35.     }
  36. }
  37. integer deleted;
  38.  
  39. integer chan0;
  40. integer chan1;
  41.  
  42. integer desire_chan;
  43.  
  44. string name;
  45.  
  46. key owner;
  47. default{
  48.     on_rez(integer r){
  49.         reset_all(1);
  50.     }
  51.     changed(integer c){
  52.         if(c & CHANGED_OWNER){
  53.             if(llGetInventoryType("2.)Input.lsl") & INVENTORY_SCRIPT){
  54.                 llSleep(.03);
  55.                 llResetOtherScript("2.)Input.lsl");
  56.             }
  57.             llResetScript();
  58.         }if(c & CHANGED_REGION){
  59.             reset_all(1);
  60.         }
  61.     }state_entry(){
  62.         owner = llGetOwner();
  63.         if(llGetInventoryType("//Eclipse.ntc")&INVENTORY_NOTECARD)llGiveInventory(owner,"//Eclipse.ntc");
  64.         name=llGetScriptName();
  65.         chan0 = -(((integer)("0x"+(string)owner)+4233)%DEBUG_CHANNEL);
  66.         chan1 = -(((integer)("0x"+(string)owner)+3266)%DEBUG_CHANNEL);
  67.         desire_chan = llListen(chan1,"","","");
  68.         llListenControl(desire_chan,0);
  69.     }link_message(integer s,integer n,string m,key i){
  70.         if(n == -560){
  71.             //llSay(0,m);
  72.             say(m);
  73.         }if(n == -420){
  74.             m = llToLower(m);
  75.             list parse = llParseString2List(m,[" "],[]);
  76.             string p0 = llList2String(parse,0);
  77.             string p1 = llList2String(parse,1);
  78.             string pall = llDumpList2String(llList2List(parse,2,-1)," ");
  79.             if(m == "reset all")reset_all(0);
  80.             if(m == ".rs all")reset_all(0);
  81.             if(p0 == "kill"){
  82.                 if(p1 == "all"){
  83.                     llListenControl(desire_chan,1);
  84.                     deleted = 0;
  85.                     llRegionSay(chan0,"kill all");
  86.                     say("Attempting to kill all objects in "+llGetRegionName()+". This may take a minute please be patient.");
  87.                     llSetTimerEvent(10);
  88.                     return;
  89.                 }
  90.                 if(p1 == "time"){
  91.                     llListenControl(desire_chan,1);
  92.                     deleted = 0;
  93.                     llRegionSay(chan0,"time_death"+pall);
  94.                     llSetTimerEvent((float)pall+5);
  95.                     say("Setting death time to \""+pall+"\".  This may take a minute please be patient.");
  96.                     return;
  97.                 }else{
  98.                     llListenControl(desire_chan,1);
  99.                     deleted = 0;
  100.                     llRegionSay(chan0,m);
  101.                     say("Attempting to delete all \""+llDumpList2String(llList2List(parse,1,-1)," ")+"(s)\" in "+llGetRegionName()+". This may take a minute please be patient.");
  102.                     llSetTimerEvent(10);
  103.                 }
  104.             }
  105.             if(m == "clean up"){
  106.                 llListenControl(desire_chan,1);
  107.                 deleted = 0;
  108.                 llRegionSay(chan0,"kill all");
  109.                 say("Attempting to kill all objects in "+llGetRegionName()+". This may take a minute please be patient.");
  110.                 llSetTimerEvent(10);
  111.                 return;
  112.             }
  113.             if(p0 == "output"){
  114.                 type = llListFindList(["owner say","say","shout","set text","whisper","owner say"],[llDumpList2String(llList2List(parse,1,-1)," ")]);
  115.                 if(type == 3){
  116.                     llMessageLinked(-1,-420,"text off","");
  117.                 }
  118.                 say("Ouput is now \""+llDumpList2String(llList2List(parse,1,-1)," ")+".\"");
  119.             }
  120.         }
  121.     }
  122.     listen(integer c,string n,key i,string m){
  123.         if(m == "DELETE"){
  124.             ++deleted;
  125.         }
  126.     }
  127.     timer(){
  128.         if(deleted > 0){
  129.             say("Removed "+(string)deleted+" prim(s) from "+llGetRegionName()+".");
  130.         }else{
  131.             say("Unable to remove anything from "+llGetRegionName());
  132.         }
  133.         llSetTimerEvent(0.0);
  134.         llListenControl(desire_chan,0);
  135.     }
  136. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top