Advertisement
ExcaliburNUMNUM

CBX Sign MENU

Oct 19th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 11.69 KB | None | 0 0
  1. //V8.3.2 -fixed bridge; fixed material not asking correctly.
  2. //Maybe Check to see if we even have a sign in the inventory kinda important.
  3. //some unused code is for future script expansion.
  4.  
  5. &question = "TYPE OF SIGN";
  6. PROMPT(&signname,"$$[[LIFT,DOOR,BRIDGE,TRANSMITTER/RECIEVER]]",%&question%,true); //Initial prompt to determine type of sign to use.
  7.  
  8. //DOOR SIGN ****************** ****************** ****************** ******************
  9. //DOOR SIGN ****************** ****************** ****************** ******************
  10. IF(%&signname%="DOOR");
  11.  
  12.     &doormaterialprompt = "DOOR Material, BLOCK ID?";
  13.     PROMPT(&doormaterial,"$$[[SET BLOCK ID,ALREADY SET]]",%&doormaterialprompt%,true); //This sign uses materials, choose new block ID?
  14.  
  15.     IF(%&doormaterial%="SET BLOCK ID");
  16.         &question = "TYPE OF MATERIAL";
  17.         PROMPT(&blockid,"$$i:d",%&question%,true); //Initial prompt to determine type of material to use.
  18.         SPLIT(":",%&blockid%,&blockidmatrix[]);  //splits i:d into a matrix so i can seperate the ID.
  19.         //SET(&blockid,%&blockidmatrix[0]%); //unnessasary right now.
  20.         SET(#blockidcolor,%&blockidmatrix[1]%);  //sets block ID color.  
  21.         #signblockmaterial = ITEMID(%&blockidmatrix[0]%); //sets block material var.
  22.     ENDIF;
  23.  
  24.     &doorwidthprompt = "Door Width? 1-11";
  25.     PROMPT(#doorwidth,"$$[[1,2,3,4,5,6,7,8,9,10,11]]",%&doorwidthprompt%,true); //How wide will the door be?
  26.     &doorheightprompt = "Door Height? 1-30";
  27.     PROMPT(&doorheight,"$$[[1,2,3,4,5,6,7,8,9,10,11,?]]",%&doorheightprompt%,true); //How Tall will the door be?
  28.     &dooroffsetprompt = "Door Vertical Offset? (-10)-10";
  29.     PROMPT(&dooroffset,"$$[[1,2,3,4,5,6,7,8,9,10,?]]",%&dooroffsetprompt%,true); //Offset from Sign block?
  30.  
  31.     IF(%&doorheight%="?");
  32.         &howwide = "How TALL should the door be?";
  33.         PROMPT(#doorheight,"$$?",%&howwide%,true);  //Prompt for How tall the door should be.
  34.         IF((%#doorheight% >= 1) && (%#doorheight% <= 30)); //Verify the height is within parameters.
  35.         ELSE;
  36.             LOG(ERROR out of parameters try again.);
  37.             STOP;
  38.         ENDIF;
  39.     ELSE;
  40.         SET(#doorheight,%&doorheight%); //set the door height var.
  41.     ENDIF;
  42.  
  43.     IF(%&dooroffset%="?");
  44.         &howoffset = "Vertical OFFSET? (-10)-10";
  45.         PROMPT(#dooroffset,"$$?",%&howoffset%,true);  //Prompt for the doors offset from the sign block.
  46.         IF((%#dooroffset% >= -10) && (%#dooroffset% <= 10));  //Verify the offset is within parameters.
  47.         ELSE;
  48.             LOG(ERROR out of parameters try again.);
  49.             STOP;
  50.         ENDIF;
  51.     ELSE;
  52.         SET(#dooroffset,%&dooroffset%); //set dooroffset var.
  53.     ENDIF;
  54.  
  55.     KEYDOWN(42); //must use shift to place on a chest or on another sign. which is why this command is here.
  56.     WAIT(5t);   //wait inserted for lag issues.
  57.     PLACESIGN(,[MCX208],%#signblockmaterial%:%#blockidcolor%,%#doorwidth%:%#doorheight%:%#dooroffset%); //IF using the MENU, and material txt files.
  58.     KEYUP(42);  //wait inserted for lag issues.
  59. //DOOR SIGN ****************** ****************** ****************** ******************
  60. //DOOR SIGN ****************** ****************** ****************** ******************
  61.  
  62.  
  63. //BRIDGE SIGN ****************** ****************** ****************** ******************
  64. //BRIDGE SIGN ****************** ****************** ****************** ******************
  65. //I'm not going to comment the Bridge sign code as its very similear to the DOOR sign.
  66. ELSEIF(%&signname%="BRIDGE");
  67.  
  68.     &bridgematerial = "Bridge Material, BLOCK ID?";
  69.     PROMPT(&bridgematerial,"$$[[SET BLOCK ID,ALREADY SET]]",%&doormaterialprompt%,true);
  70.  
  71.     IF(%&bridgematerial%="SET BLOCK ID");
  72.         &question = "TYPE OF MATERIAL";
  73.         PROMPT(&blockid,"$$i:d",%&question%,true); //Initial prompt to determine type of material to use.
  74.         SPLIT(":",%&blockid%,&blockidmatrix[]);  //splits i:d into a matrix so i can seperate the ID.
  75.         SET(&blockid,%&blockidmatrix[0]%); //unnessasary right now.
  76.         SET(#blockidcolor,%&blockidmatrix[1]%);  //sets block ID color.  
  77.         #signblockmaterial = ITEMID(%&blockidmatrix[0]%); //sets block material var.
  78.     ENDIF;
  79.  
  80.     &bridgewidthprompt = "Bridge Width? 1-11";
  81.     PROMPT(#bridgewidth,"$$[[1,2,3,4,5,6,7,8,9,10,11]]",%&bridgewidthprompt%,true);
  82.     &bridgelengthprompt = "Bridge Length? 1-30";
  83.     PROMPT(&bridgelength,"$$[[1,2,3,4,5,6,7,8,9,10,11,30,?]]",%&bridgelengthprompt%,true);
  84.     &bridgeoffsetprompt = "Bridge Vertical Offset? (-10)-10";
  85.     PROMPT(&bridgeoffset,"$$[[-1,1,2,3,4,5,6,7,8,9,10,?]]",%&bridgeoffsetprompt%,true);
  86.  
  87.  
  88.     IF(%&bridgelength%="?");
  89.         &howlong = "How LONG should the bridge be?";
  90.         PROMPT(#bridgelength,"$$?",%&howlong%,true);
  91.         IF((%#bridgelength% >= 1) && (%#bridgelength% <= 30));
  92.         ELSE;
  93.             LOG(ERROR out of parameters try again.);
  94.             STOP;
  95.         ENDIF;
  96.     ELSE;
  97.         SET(#bridgelength,%&bridgelength%);
  98.     ENDIF;
  99.  
  100.     IF(%&bridgeoffset%="?");
  101.         &howoffset = "Vertical OFFSET? (-10)-10";
  102.         PROMPT(#bridgeoffset,"$$?",%&howoffset%,true);
  103.         IF((%#bridgeoffset% >= -10) && (%#bridgeoffset% <= 10));
  104.         ELSE;
  105.             LOG(ERROR out of parameters try again.);
  106.             STOP;
  107.         ENDIF;
  108.     ELSE;
  109.         SET(#bridgeoffset,%&bridgeoffset%);
  110.     ENDIF;
  111.  
  112.     KEYDOWN(42); //must use shift to place on a chest or on another sign. which is why this command is here.
  113.     WAIT(5t);   //wait inserted for lag issues.
  114.     PLACESIGN(,[MCX207],%#signblockmaterial%:%#blockidcolor%,%#bridgewidth%:%#bridgelength%:%#bridgeoffset%); //Bridge
  115.     KEYUP(42);  //wait inserted for lag issues.
  116.  
  117. //BRIDGE SIGN ****************** ****************** ****************** ******************
  118. //BRIDGE SIGN ****************** ****************** ****************** ******************
  119.  
  120.  
  121. //LIFT SIGN ****************** ****************** ****************** ******************
  122. //LIFT SIGN ****************** ****************** ****************** ******************
  123. ELSEIF(%&signname%="LIFT");
  124.  
  125.     &liftcurrentfloorprompt = "Current floor name, 0-15Char";
  126.     PROMPT(&liftcurrentfloor,"$$?",%&liftcurrentfloorprompt%,true);   // Current floor name, this will show up in chat when you use a lift to this floor.
  127.     &liftdirectionprompt = "up or down when right clicking the sign?";
  128.     PROMPT(&liftdirection,"$$[[Lift,Lift Up,Lift Down]]",%&liftdirectionprompt%,true); //Lift Sign Text, what do you want the lift to do.
  129.     &liftanytext1 = "Any text, eg.where the lift goes to, 0-15Char";
  130.     PROMPT(&liftanytext1,"$$?",%&liftanytext1%,true);   //Line 3 any text
  131.     &liftanytext2 = "Any text,can be any text wanted on the sign, 0-15Char";
  132.     PROMPT(&liftanytext2,"$$?",%&liftanytext2%,true);   //Line 4 any text
  133.  
  134.  
  135.         IFMATCHES(%&liftcurrentfloor%,"^.{0,15}$",);    //Line 1, Filter to be sure entered text is within sign parameters.
  136.             //LOG(MATCH!!!);
  137.         ELSE;
  138.             LOG(ERROR out of parameters try again.);
  139.             STOP;
  140.         ENDIF;
  141.         IFMATCHES(%&liftanytext1%,"^.{0,15}$",);        //Line 3, Filter to be sure entered text is within sign parameters.
  142.             //LOG(MATCH!!!);
  143.         ELSE;
  144.             LOG(ERROR out of parameters try again.);
  145.             STOP;
  146.         ENDIF;
  147.         IFMATCHES(%&liftanytext2%,"^.{0,15}$",);        //Line 4, Filter to be sure entered text is within sign parameters.
  148.             //LOG(MATCH!!!);
  149.         ELSE;
  150.             LOG(ERROR out of parameters try again.);
  151.             STOP;
  152.         ENDIF;
  153.  
  154.  
  155.     KEYDOWN(42); //must use shift to place on a chest or on another sign. which is why this command is here.
  156.     WAIT(5t);   //wait inserted for lag issues.
  157.     PLACESIGN(%&liftcurrentfloor%,[%&liftdirection%],%&liftanytext1%,%&liftanytext2%); //place Craftbook Extra Lift Sign.
  158.     KEYUP(42);  //wait inserted for lag issues.
  159. //LIFT SIGN ****************** ****************** ****************** ******************
  160. //LIFT SIGN ****************** ****************** ****************** ******************
  161.  
  162.  
  163. //TRANSMITTER SIGN ****************** ****************** ****************** ******************
  164. //TRANSMITTER SIGN ****************** ****************** ****************** ******************
  165. ELSEIF(%&signname%="TRANSMITTER/RECIEVER");
  166.  
  167.  
  168.  
  169.     &transmitorrecieveprompt = "Transmit or Recieve sign?";
  170.     PROMPT(&transmitorrecieve,"$$[[Transmitter,Reciever]]",%&transmitorrecieveprompt%,true);
  171.  
  172.     &transmitterbandprompt = "Transmitter/Reciever BAND ID?";
  173.     PROMPT(&transmitterbandset,"$$[[SET BAND,ALREADY SET,Previous BANDS BELOW,%&transmitterband0%,%&transmitterband1%,%&transmitterband2%,%&transmitterband3%]]",%&transmitterbandprompt%,true);
  174.  
  175.         IF(%&transmitorrecieve%="Transmitter");    //Line 2, Filter to be sure entered text is within sign parameters.
  176.             SET(&transmittertype,"MC1110");
  177.         ELSEIF(%&transmitorrecieve%="Reciever");
  178.             SET(&transmittertype,"MC0111");
  179.         ELSE;
  180.             LOG(ERROR out of parameters try again.);
  181.             STOP;
  182.         ENDIF;
  183.        
  184.         IF(%&transmitterbandset%="SET BAND");
  185.             &bandprompt = "Band Name for Transmitter Linking, 0-15Char";
  186.             PROMPT(&transmitterband,"$$?",%&bandprompt%,true);
  187.                         IFMATCHES(%&transmitterband%,"\$",);    //Line 3, Filter to be sure entered text is within sign parameters.
  188.                         LOG(Using $ BREAKS the script.);
  189.                         UNSET(&transmitterband);
  190.                         SET(&transmitterband,%&transmitterband0%);
  191.                         ENDIF;
  192.            
  193.             &transmitterbandarray[4]="%&transmitterbandarray[3]%";
  194.             &transmitterbandarray[3]="%&transmitterbandarray[2]%";
  195.             &transmitterbandarray[2]="%&transmitterbandarray[1]%";
  196.             &transmitterbandarray[1]="%&transmitterbandarray[0]%";
  197.             &transmitterbandarray[0]="%&transmitterband%";
  198.  
  199.             SET(&transmitterband0,%&transmitterbandarray[0]%);
  200.             SET(&transmitterband1,%&transmitterbandarray[1]%);
  201.             SET(&transmitterband2,%&transmitterbandarray[2]%);
  202.             SET(&transmitterband3,%&transmitterbandarray[3]%);
  203.             SET(&transmitterband4,%&transmitterbandarray[4]%);
  204.  
  205.         ELSEIF(%&transmitterbandset%="ALREADY SET");
  206.         ELSEIF(%&transmitterbandset%=%&transmitterband0%);
  207.             &transmitterband=%&transmitterband0%;
  208.         ELSEIF(%&transmitterbandset%=%&transmitterband1%);
  209.             &transmitterband=%&transmitterband1%;
  210.         ELSEIF(%&transmitterbandset%=%&transmitterband2%);
  211.             &transmitterband=%&transmitterband2%;
  212.         ELSEIF(%&transmitterbandset%=%&transmitterband3%);
  213.             &transmitterband=%&transmitterband3%;
  214.         ELSE;        
  215.             LOG(NO MATCH!! ERROR out of parameters try again.);
  216.             STOP;
  217.         ENDIF;
  218.  
  219.         IFMATCHES(%&transmitterband%,"^.{0,15}$",);//Line 3, Filter to be sure entered text is within sign parameters.
  220.         ELSE;
  221.             LOG(ERROR out of parameters try again.);
  222.             STOP;
  223.         ENDIF;
  224.         IFMATCHES(%&transmitteranytext4%,"^.{0,15}$",);//Line 4, Filter to be sure entered text is within sign parameters.
  225.         ELSE;
  226.             LOG(ERROR out of parameters try again.);
  227.             STOP;
  228.         ENDIF;
  229.  
  230.     KEYDOWN(42);
  231.     WAIT(5t);   //wait inserted for lag issues.
  232.     PLACESIGN(,[%&transmittertype%],%&transmitterband%,%&transmitteranytext4%); //place Craftbook Extra Tramsmitter Sign.
  233.     KEYUP(42);
  234. //TRANSMITTER SIGN ****************** ****************** ****************** ******************
  235. //TRANSMITTER SIGN ****************** ****************** ****************** ******************
  236.  
  237. ELSE;
  238. LOG(I do Nothing Bruah);
  239. ENDIF;
  240. STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement