Nike622000

Feuerwerk

Jan 5th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.11 KB | None | 0 0
  1. shell.run("config")
  2. mon = peripheral.wrap(monSide)
  3. mon.setTextScale(.5)
  4.  
  5. local xMax,yMax = mon.getSize()
  6.  
  7. function Background(col)
  8.   mon.setBackgroundColor(col)
  9.   for xPos = 1,xMax do
  10.     for yPos = 1,yMax do
  11.       mon.setCursorPos(xPos,yPos)
  12.       mon.write(" ")
  13.     end
  14.   end
  15. end
  16.  
  17. function JoJa(xPos,yPos)
  18.   mon.setCursorPos(xPos,yPos)
  19.   mon.setBackgroundColor(colors.gray)
  20.   mon.setTextColor(colors.cyan)
  21.   mon.write("Jo")
  22.   mon.setTextColor(colors.orange)
  23.   mon.write("Ja ")
  24.   mon.setTextColor(colors.lightGray)
  25.   mon.write("Productions")
  26.   mon.setTextColor(colors.white)
  27. end
  28.  
  29. function overlay(xP,yP,txt)
  30.   mon.setCursorPos(xP,yP)
  31.   mon.write(txt)
  32. end
  33.  
  34. vorschau = false
  35. function Bt(xP1,yP1,xP2,yP2,txt1,col)
  36.   mon.setBackgroundColor(col)
  37.   for xPos = xP1,xP2 do
  38.     for yPos = yP1,yP2 do
  39.       mon.setCursorPos(xPos,yPos)
  40.       mon.write(" ")
  41.     end
  42.   end
  43.   mon.setCursorPos((xP1+((xP2-xP1)/2))-#txt1/2,(yP1+(yP2-yP1)/2))
  44.   mon.write(txt1)
  45. end  
  46.  
  47. function Background(col)
  48.   mon.setBackgroundColor(col)
  49.   for xPos = 1,xMax do
  50.     for yPos = 1,yMax do
  51.       mon.setCursorPos(xPos,yPos)
  52.       mon.write(" ")
  53.     end
  54.   end
  55. end
  56.  
  57. function JoJa(xPos,yPos)
  58.   mon.setCursorPos(xPos,yPos)
  59.   mon.setBackgroundColor(colors.gray)
  60.   mon.setTextColor(colors.cyan)
  61.   mon.write("Jo")
  62.   mon.setTextColor(colors.orange)
  63.   mon.write("Ja ")
  64.   mon.setTextColor(colors.lightGray)
  65.   mon.write("Productions")
  66.   mon.setTextColor(colors.white)
  67. end
  68.  
  69. function overlay(xP,yP,txt)
  70.   mon.setCursorPos(xP,yP)
  71.   mon.write(txt)
  72. end
  73.  
  74. function Bt(xP1,yP1,xP2,yP2,txt1,col)
  75.   mon.setBackgroundColor(col)
  76.   for xPos = xP1,xP2 do
  77.     for yPos = yP1,yP2 do
  78.       mon.setCursorPos(xPos,yPos)
  79.       mon.write(" ")
  80.     end
  81.   end
  82.   mon.setCursorPos((xP1+((xP2-xP1)/2))-#txt1/2,(yP1+(yP2-yP1)/2))
  83.   mon.write(txt1)
  84. end  
  85.  
  86. function createArray()
  87. Button    = {}
  88. --Effekte
  89. --Button    = (xP1,yP1,xP2,yP2)
  90.   Button[1] = {7,6,21,6,  "Diamond"      ,colors.cyan,     false,"Effects" ,colors.white}
  91.   Button[2] = {7,8,21,8,  "Glowstone"    ,colors.red,      false,"Effects" ,colors.orange}
  92. --Shape  
  93.   Button[3] = {7,17,21,17,"Gold Nugget"  ,colors.orange,   false,"Shape" ,colors.magenta}
  94.   Button[4] = {7,19,21,19,"Fire Charge"  ,colors.red,     false,"Shape"  ,colors.lightBlue}
  95.   Button[5] = {7,21,21,21,"Feather"      ,colors.lightGray,false,"Shape" ,colors.yellow}
  96. --Farben1
  97.   Button[6] = {27, 6,41, 6,"White"       ,colors.lightGray,false,"Color" ,colors.white}
  98.   Button[7] = {27, 8,41, 8,"Orange"      ,colors.orange,   false,"Color" ,colors.orange}  
  99.   Button[8] = {27,10,41,10,"Magenta"     ,colors.magenta,  false,"Color" ,colors.magenta}  
  100.   Button[9] = {27,12,41,12,"light Blue"  ,colors.lightBlue,false,"Color" ,colors.lightBlue}  
  101.   Button[10]= {27,14,41,14,"Yellow"      ,colors.yellow,   false,"Color" ,colors.yellow}  
  102.   Button[11]= {27,16,41,16,"Lime"        ,colors.lime,     false,"Color" ,colors.lime}  
  103.   Button[12]= {27,18,41,18,"Pink"        ,colors.pink,     false,"Color" ,colors.pink}  
  104.   Button[13]= {27,20,41,20,"Gray"        ,colors.black,     false,"Color",colors.gray}
  105.   Button[14]= {27,22,41,22,"light Gray"  ,colors.lightGray,false,"Color" ,colors.lightGray}  
  106.   Button[15]= {27,24,41,24,"Cyan"        ,colors.cyan,     false,"Color" ,colors.cyan}  
  107.   Button[16]= {27,26,41,26,"Purple"      ,colors.purple,   false,"Color" ,colors.purple}
  108.   Button[17]= {27,28,41,28,"Blue"        ,colors.blue,     false,"Color" ,colors.blue}
  109.   Button[18]= {27,30,41,30,"Brown"       ,colors.brown,    false,"Color" ,colors.brown}
  110.   Button[19]= {27,32,41,32,"Green"       ,colors.green,    false,"Color" ,colors.green}
  111.   Button[20]= {27,34,41,34,"Red"         ,colors.red,      false,"Color" ,colors.red}  
  112.   Button[21]= {27,36,41,36,"Black"       ,colors.black,    false,"Color" ,colors.black}
  113. --Power
  114.   Button[22]= {7,30,21,30, "lvl 1"       ,colors.lime,     false,"Power" ,colors.lime}
  115.   Button[23]= {7,32,21,32, "lvl 2"       ,colors.orange,   false,"Power" ,colors.pink}
  116.   Button[24]= {7,34,21,34, "lvl 3"       ,colors.red,      false,"Power" ,colors.gray}
  117. --Farben2
  118.   Button[25] = {47, 6,60, 6,"White"       ,colors.lightGray,false,"Color2",colors.white}
  119.   Button[26] = {47, 8,60, 8,"Orange"      ,colors.orange,   false,"Color2",colors.orange}  
  120.   Button[27] = {47,10,60,10,"Magenta"     ,colors.magenta,  false,"Color2",colors.magenta}  
  121.   Button[28] = {47,12,60,12,"light Blue"  ,colors.lightBlue,false,"Color2",colors.lightBlue}  
  122.   Button[29]= {47,14,60,14,"Yellow"      ,colors.yellow,   false,"Color2" ,colors.yellow}  
  123.   Button[30]= {47,16,60,16,"Lime"        ,colors.lime,     false,"Color2" ,colors.lime}  
  124.   Button[31]= {47,18,60,18,"Pink"        ,colors.pink,     false,"Color2" ,colors.pink}  
  125.   Button[32]= {47,20,60,20,"Gray"        ,colors.black,    false,"Color2" ,colors.gray}
  126.   Button[33]= {47,22,60,22,"light Gray"  ,colors.lightGray,false,"Color2" ,colors.lightGray}  
  127.   Button[34]= {47,24,60,24,"Cyan"        ,colors.cyan,     false,"Color2" ,colors.cyan}  
  128.   Button[35]= {47,26,60,26,"Purple"      ,colors.purple,   false,"Color2" ,colors.purple}
  129.   Button[36]= {47,28,60,28,"Blue"        ,colors.blue,     false,"Color2" ,colors.blue}
  130.   Button[37]= {47,30,60,30,"Brown"       ,colors.brown,    false,"Color2" ,colors.brown}
  131.   Button[38]= {47,32,60,32,"Green"       ,colors.green,    false,"Color2" ,colors.green}
  132.   Button[39]= {47,34,60,34,"Red"         ,colors.red,      false,"Color2" ,colors.red}  
  133.   Button[40]= {47,36,60,36,"Black"       ,colors.black,    false,"Color2" ,colors.black}
  134. --weite Buttons
  135.   Button[41]= {70,6,90,8,  "Vorschau"    ,colors.orange,    false,"Extra" ,colors.white}
  136.   Button[42]= {70,10,90,12,"Craften"     ,colors.blue,      false,"Extra" ,colors.orange}
  137.   Button[43]= {70,14,90,16,"Reset"       ,colors.red,       false,"Extra"}
  138. --Menge
  139.   Button[44]= {70,20,"1" ,"Amount"}
  140.   Button[45]= {74,20,"2" ,"Amount"}
  141.   Button[46]= {78,20,"3" ,"Amount"}
  142.   Button[47]= {70,24,"4" ,"Amount"}
  143.   Button[48]= {74,24,"5" ,"Amount"}
  144.   Button[49]= {78,24,"6" ,"Amount"}
  145.   Button[50]= {70,28,"7" ,"Amount"}
  146.   Button[51]= {74,28,"8" ,"Amount"}
  147.   Button[52]= {78,28,"9" ,"Amount"}
  148.   Button[53]= {74,32,"0" ,"Amount"}
  149.   Button[54]= {78,32,"<-","Amount"}
  150. end
  151.  
  152. function drawError(ln1,ln2,ln3)
  153.   ystart = math.floor((yMax-4)/2)
  154.  
  155.   mon.setTextColor(1)
  156.   mon.setBackgroundColor(16384)
  157.   for i=ystart,ystart+4 do
  158.     mon.setCursorPos(3,i)
  159.     for j=3,xMax-3 do
  160.       mon.write(" ")
  161.     end
  162.   end
  163.   for i=ystart,ystart+4 do
  164.     mon.setCursorPos(3,i)
  165.     if i==ystart or i==ystart+4 then
  166.       for j=3,xMax-3 do
  167.         if j==3 or j==xMax-3 then
  168.           mon.write("+")
  169.         else
  170.           mon.write("-")
  171.         end
  172.       end
  173.     else
  174.       mon.setCursorPos(3,i)
  175.       mon.write("|")
  176.       mon.setCursorPos(xMax-3,i)
  177.       mon.write("|")
  178.     end
  179.   end
  180.   xstart = math.floor(((xMax-6)-#ln1)/2)
  181.   mon.setCursorPos(5+xstart,ystart+1)
  182.   mon.write(ln1)
  183.   xstart = math.floor(((xMax-6)-#ln2)/2)
  184.   mon.setCursorPos(5+xstart,ystart+2)
  185.   mon.write(ln2)
  186.   xstart = math.floor(((xMax-6)-#ln3)/2)
  187.   mon.setCursorPos(5+xstart,ystart+3)
  188.   mon.write(ln3)
  189. end
  190.  
  191. function printAmount()
  192.     overlay(70,18,"Amount")
  193.     mon.setBackgroundColor(colors.gray)
  194.     for B = 44,54 do
  195.         for xP = Button[B][1],Button[B][1]+2 do
  196.             for yP = Button[B][2],Button[B][2]+2 do
  197.                 mon.setCursorPos(xP,yP)
  198.                 mon.write(" ")
  199.             end
  200.         end
  201.         mon.setCursorPos(Button[B][1]+1,Button[B][2]+1)
  202.         mon.write(Button[B][3])
  203.     end
  204.     mon.setBackgroundColor(colors.black)
  205.     mon.setCursorPos(70,37)
  206.     mon.write(amt)
  207. end
  208.  
  209. function checkAmount(xP,yP)
  210.     for B = 44,54 do
  211.         if xP >= Button[B][1] and xP <= Button[B][1]+2
  212.         and yP >= Button[B][2] and yP <= Button[B][2]+2 then
  213.             if B == 54 then
  214.                 amt = string.sub(amt, 0, #amt-1)
  215.             else
  216.                 amt = amt..Button[B][3]
  217.             end
  218.         end
  219.     end
  220. end
  221.            
  222.    
  223. function printButton(b1,b2)
  224.   mon.setBackgroundColor(colors.black)
  225.   xP = Button[b1][1]-2
  226.   yP = Button[b1][2]-2
  227.   Pos1 = yP+1
  228.   Pos2 = yP+2
  229.   overlay(xP,yP,Button[b1][8])
  230.   mon.setBackgroundColor(colors.black)
  231.   for b = b1,b2 do
  232.     overlay(xP,Pos1,"|")
  233.     overlay(xP,Pos2,"+-")
  234.     Pos1 = Pos1+2
  235.     Pos2 = Pos2+2
  236.     if Button[b][7] then
  237.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  238.       mon.setBackgroundColor(colors.black)
  239.     else
  240.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  241.       mon.setBackgroundColor(colors.black)
  242.     end
  243.   end
  244. end
  245.  
  246. function printButton2(b1,b2)
  247.   mon.setBackgroundColor(colors.black)
  248.   xP = Button[b1][1]-2
  249.   yP = Button[b1][2]-2
  250.   Pos1 = yP+1
  251.   Pos2 = yP+2
  252.   overlay(xP,yP,Button[b1][8])
  253.   mon.setBackgroundColor(colors.black)
  254.   overlay(xP,Pos1,"|")
  255.   overlay(xP,Pos1+1,"|")
  256.   overlay(xP,Pos1+2,"+-")
  257.   for b = b1,b2 do
  258.     if b ~= b1 then
  259.         Pos1 = Pos1+4
  260.         overlay(xP,Pos1-1,"|")
  261.         overlay(xP,Pos1,"|")
  262.         overlay(xP,Pos1+1,"|")
  263.         overlay(xP,Pos1+2,"+-")
  264.     end
  265.     if Button[b][7] then
  266.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  267.       mon.setBackgroundColor(colors.black)
  268.     else
  269.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  270.       mon.setBackgroundColor(colors.black)
  271.     end
  272.   end
  273. end
  274.  
  275. function printButtonAnimation(b1,b2)
  276.   mon.setBackgroundColor(colors.black)
  277.   xP = Button[b1][1]-2
  278.   yP = Button[b1][2]-2
  279.   Pos1 = yP+1
  280.   Pos2 = yP+2
  281.   overlay(xP,yP,Button[b1][8])
  282.   mon.setBackgroundColor(colors.black)
  283.   for b = b1,b2 do
  284.     overlay(xP,Pos1,"|")
  285.     overlay(xP,Pos2,"+-")
  286.     Pos1 = Pos1+2
  287.     Pos2 = Pos2+2
  288.     if Button[b][7] then
  289.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  290.       mon.setBackgroundColor(colors.black)
  291.     else
  292.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  293.       mon.setBackgroundColor(colors.black)
  294.     end
  295.     sleep(0.1)
  296.   end
  297. end
  298.  
  299. function printButton2Animation(b1,b2)
  300.   mon.setBackgroundColor(colors.black)
  301.   xP = Button[b1][1]-2
  302.   yP = Button[b1][2]-2
  303.   Pos1 = yP+1
  304.   Pos2 = yP+2
  305.   overlay(xP,yP,Button[b1][8])
  306.   mon.setBackgroundColor(colors.black)
  307.   overlay(xP,Pos1,"|")
  308.   overlay(xP,Pos1+1,"|")
  309.   overlay(xP,Pos1+2,"+-")
  310.   for b = b1,b2 do
  311.     if b ~= b1 then
  312.         Pos1 = Pos1+4
  313.         overlay(xP,Pos1-1,"|")
  314.         overlay(xP,Pos1,"|")
  315.         overlay(xP,Pos1+1,"|")
  316.         overlay(xP,Pos1+2,"+-")
  317.     end
  318.     if Button[b][7] then
  319.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  320.       mon.setBackgroundColor(colors.black)
  321.     else
  322.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  323.       mon.setBackgroundColor(colors.black)
  324.     end
  325.     sleep(0.1)
  326.   end
  327. end
  328.  
  329. function checkButton(xP,yP)
  330.     col1 = 0
  331.     col2 = 0
  332.     for B = 1,21 do
  333.         if Button[B][7] then
  334.             col1 = col1+1
  335.         end
  336.     end
  337.     for B = 25,40 do
  338.         if Button[B][7] then
  339.             col2 = col2+1
  340.         end
  341.     end
  342.  
  343.     for B = 1,43 do
  344.         if xP >= Button[B][1] and xP <= Button[B][3] and
  345.            yP >= Button[B][2]-0.5 and yP <= Button[B][4]+0.5 then
  346.             if Button[B][7] then
  347.                 Button[B][7] = false
  348.             elseif Button[B][7] == false then
  349.                 if B >= 1 and B <= 21 or B >= 25 and B <= 40 then
  350.                     if B >= 1 and B <= 21 then
  351.                         if col1 >=8 then
  352.                         else
  353.                             Button[B][7] = true
  354.                             if B == 1 then
  355.                                 Button[2][7] = false
  356.                             elseif B == 2 then
  357.                                 Button[1][7] = false
  358.                             elseif B == 3 then
  359.                                 Button[4][7] = false  
  360.                                 Button[5][7] = false  
  361.                             elseif B == 4 then
  362.                                 Button[3][7] = false  
  363.                                 Button[5][7] = false  
  364.                             elseif B == 5 then
  365.                                 Button[3][7] = false  
  366.                                 Button[4][7] = false
  367.                             end
  368.                         end
  369.                     elseif B >= 25 and B <= 40 then
  370.                         if col2 >=8 then
  371.                         else
  372.                             Button[B][7] = true
  373.                         end
  374.                     end
  375.                 else
  376.                 Button[B][7] = true
  377.                 if B == 22 then
  378.                     Button[23][7] = false  
  379.                     Button[24][7] = false  
  380.                 elseif B == 23 then
  381.                     Button[22][7] = false  
  382.                     Button[24][7] = false  
  383.                 elseif B == 24 then
  384.                     Button[22][7] = false  
  385.                     Button[23][7] = false
  386.                 end
  387.                 end
  388.             end
  389.         end
  390.     end
  391. end
  392.  
  393.  function list()
  394.     i=0
  395.     overlay(67,6,"Auswahl:")
  396.     for B = 1,#Button do
  397.         if Button[B][7] then
  398.             mon.setCursorPos(67,8+2*i)
  399.             mon.write(Button[B][8].." "..Button[B][5].."      ")
  400.             i=i+1
  401.         end
  402.     end
  403.  end
  404.  
  405. function progress(actualProgress, maxProgress, title, msg, cAProgress, cMaxProgress)
  406.     x1 = (xMax/2)-15
  407.     x2 = (xMax/2)+15
  408.     y1 = (yMax/2)-7
  409.     y2 = (yMax/2)+7
  410.  
  411.     mon.setBackgroundColor(colors.gray)
  412.     mon.setTextColor(colors.white)
  413.     for i=y1, y2 do
  414.         mon.setCursorPos(x1,i)
  415.         for j=x1, x2 do
  416.             if i==y1 or i==y2 then
  417.                 if j==x1 or j==x2 then
  418.                     mon.write("+")
  419.                 else
  420.                     mon.write("-")
  421.                 end
  422.             else
  423.                 if j==x1 or j==x2 then
  424.                     mon.write("|")
  425.                 else
  426.                     mon.write(" ")
  427.                 end
  428.             end
  429.         end
  430.     end
  431.     mon.setCursorPos((xMax/2)-(#title/2), y1+2)
  432.     mon.write(title)
  433.     mon.setCursorPos((xMax/2)-(#msg/2), y1+6)
  434.     mon.write(msg)
  435.     mon.setCursorPos(x1+2,y1+9)
  436.     mon.setBackgroundColor(colors.lightGray)
  437.     for i=1,27 do
  438.         mon.write(" ")
  439.     end
  440.     mon.setCursorPos(x1+2,y1+9)
  441.     mon.setBackgroundColor(colors.lime)
  442.     for i=1,((27/maxProgress)*actualProgress) do
  443.         mon.write(" ")
  444.     end
  445.     if cAProgress~=nil and cMaxProgress~=nil then
  446.         percentage = tostring(math.floor((100/cMaxProgress)*cAProgress)) .. "%"
  447.         mon.setCursorPos(x1+2,y1+12)
  448.             mon.setBackgroundColor(colors.lightGray)
  449.         for i=1,27 do
  450.             mon.write(" ")
  451.         end
  452.         mon.setCursorPos(x1+2,y1+12)
  453.         mon.setBackgroundColor(colors.blue)
  454.         for i=1,((27/cMaxProgress)*cAProgress) do
  455.             mon.write(" ")
  456.         end
  457.         mon.setBackgroundColor(colors.gray)
  458.         mon.setCursorPos((xMax/2)-(#percentage/2), y1+11)
  459.         mon.write(percentage)
  460.     end
  461.     mon.setBackgroundColor(colors.black)
  462. end
  463.  
  464. function craft(anzahl)
  465.     --set 0
  466.     rs.setBundledOutput(BundledCableColorESP,0)
  467.     rs.setBundledOutput(BundledCableColor1,0)
  468.     rs.setBundledOutput(BundledCableColor2,0)
  469.     if vorschau == true then
  470.         rs.setBundledOutput(BundledCableExtra,colors.lime+colors.magenta+colors.lightBlue+colors.pink+colors.gray)
  471.         progress(0, 4, "Vorschau-Progress", "starting...")
  472.     else
  473.         rs.setBundledOutput(BundledCableExtra,colors.lime+colors.magenta+colors.lightBlue+colors.pink)
  474.         progress(0, 3, "Crafting-Progress", "starting...")
  475.     end
  476.     sleep(5)
  477.     --Color1
  478.     for b = 6,21 do
  479.         if Button[b][7] then
  480.             rs.setBundledOutput(BundledCableColor1,rs.getBundledOutput(BundledCableColor1)+Button[b][9])
  481.         end
  482.     end
  483.     for b = 1,5 do
  484.         if Button[b][7] then
  485.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[b][9])
  486.         end
  487.     end
  488.     if vorschau == true then
  489.         progress(1, 4, "Vorschau-Progress", "initialising...", 1, 2)
  490.     else
  491.         progress(1, 3, "Crafting-Progress", "initialising...", 1, 2)
  492.     end
  493.     sleep(7)
  494.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  495.     sleep(tickrate/2)
  496.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  497.     sleep(tickrate/2)
  498.     for b = 25,40 do
  499.         if Button[b][7] then
  500.             rs.setBundledOutput(BundledCableColor2,rs.getBundledOutput(BundledCableColor2)+Button[b][9])
  501.         end
  502.     end
  503.     if vorschau == true then
  504.         progress(1, 4, "Vorschau-Progress", "initialising...", 2, 2)
  505.     else
  506.         progress(1, 3, "Crafting-Progress", "initialising...", 2, 2)
  507.     end
  508.     sleep(7)
  509.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  510.     sleep(tickrate/2)
  511.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  512.     sleep(tickrate/2)
  513.         if Button[22][7] then
  514.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+colors.lightGray)
  515.         elseif Button[23][7] then
  516.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+Button[23][9]          +colors.lightGray)
  517.         elseif Button[24][7] then
  518.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+Button[23][9]+Button[24][9]+colors.lightGray)
  519.         end
  520.     if vorschau == true then
  521.         progress(2, 4, "Vorschau-Progress", "crafting...", 0, anzahl+3)
  522.     else
  523.         progress(2, 3, "Crafting-Progress", "crafting...", 0, anzahl+3)
  524.     end
  525.     sleep(7)
  526.     for b = 1,anzahl+3 do
  527.         progress(3, 5, "Crafting-Progress", "crafting...", b, anzahl+3)
  528.         rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  529.         sleep(tickrate/2)
  530.         rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  531.         sleep(tickrate/2)
  532.     end
  533.  
  534.     if vorschau == true then
  535.         progress(3, 4, "Vorschau-Progress", "cleaning up...", 1, 2)
  536.     else
  537.         progress(3, 3, "Crafting-Progress", "cleaning up...", 1, 2)
  538.     end
  539.     rs.setBundledOutput(BundledCableColor1,  0)
  540.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.magenta))      
  541.  
  542.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  543.     sleep(tickrate)
  544.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  545.     sleep(tickrate/2)
  546.  
  547.     if vorschau == true then
  548.         progress(3, 4, "Vorschau-Progress", "cleaning up...", 2, 2)
  549.     else
  550.         progress(3, 3, "Crafting-Progress", "cleaning up...", 2, 2)
  551.     end
  552.  
  553.     rs.setBundledOutput(BundledCableColor2,  0)
  554.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lightBlue))
  555.  
  556.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  557.     sleep(tickrate)
  558.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  559.     sleep(tickrate/2)
  560.  
  561.    
  562.     rs.setBundledOutput(BundledCableColorESP,     colors.subtract(rs.getBundledOutput(BundledCableColorESP),colors.white,colors.orange,colors.magenta,colors.lightBlue,colors.yellow))
  563.    
  564.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lime))
  565.  
  566.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  567.     sleep(tickrate)
  568.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  569.     sleep(tickrate/2)
  570.  
  571.     rs.setBundledOutput(BundledCableExtra,0)
  572.     if vorschau == true then
  573.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.gray)
  574.     end
  575.     rs.setBundledOutput(BundledCableColorESP,0)
  576.     rs.setBundledOutput(BundledCableColor1,0)
  577.     rs.setBundledOutput(BundledCableColor2,0)
  578.    
  579.     sleep(10)
  580.     mon.setBackgroundColor(colors.black)
  581.     mon.clear()
  582. end
  583.  
  584. function Vorschau()
  585.     vorschau = true
  586.     rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.gray)
  587.     craft(3)
  588.     t = 0
  589.     if Button[22][7] then
  590.             t = 0.5
  591.     elseif Button[23][7] then
  592.             t = 0.9
  593.     elseif Button[24][7] then
  594.             t = 1.2
  595.     end
  596.     progress(4, 4, "Vorschau-Progress", "showing Firework...", 0, 5)  
  597.     for i = 1,5 do
  598.         progress(4, 4, "Vorschau-Progress", "showing Firework...", i, 5)  
  599.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.lightGray)
  600.         sleep(t)
  601.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.cyan)
  602.         sleep(0.5)
  603.         rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lightGray,colors.cyan))
  604.         sleep(0.5)
  605.     end
  606.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.gray))
  607.     vorschau = false
  608.     mon.clear()
  609. end
  610.  
  611. --startup
  612. rs.setBundledOutput(BundledCableColorESP,0)
  613. rs.setBundledOutput(BundledCableColor1,0)
  614. rs.setBundledOutput(BundledCableColor2,0)
  615. rs.setBundledOutput(BundledCableExtra,0)
  616. amt = ""
  617. createArray()
  618. Background(colors.black)
  619. JoJa(xMax/2-7,1)
  620. mon.setBackgroundColor(colors.black)
  621. mon.setTextColor(colors.white)
  622. overlay(xMax/2-10,yMax/2-1,"Bitte auf den Monitor")
  623. overlay(xMax/2-5,yMax/2,"klicken...")
  624. event = os.pullEvent("monitor_touch")
  625. Background(colors.black)
  626. JoJa(xMax/2-7,1)
  627. printButtonAnimation(1,2)
  628. printButtonAnimation(3,5)
  629. printButtonAnimation(22,24)
  630. printButtonAnimation(6,21)
  631. printButtonAnimation(25,40)
  632. printButton2Animation(41,43)
  633. sleep(0.1)
  634. printAmount()
  635.  
  636. while true do
  637.     JoJa(xMax/2-7,1)
  638.     event,_,xPos,yPos = os.pullEvent("monitor_touch")
  639.     Background(colors.black)
  640.     checkButton(xPos,yPos)
  641.     checkAmount(xPos,yPos)
  642.     if Button[41][7] then
  643.         Vorschau()
  644.         Button[41][7] = false
  645.     end
  646.     if Button[42][7] then
  647.         if amt == nil or amt == "0" or amt == "" then
  648.             drawError("Error","No Ammount","Touch to continue...")
  649.             event = os.pullEvent("monitor_touch")
  650.             Background(colors.black)
  651.             Button[42][7] = false
  652.         else
  653.             craft(amt)
  654.             Button[42][7] = false
  655.         end
  656.     end
  657.     printButton(1,2)
  658.     printButton(3,5)
  659.     printButton(22,24)
  660.     printButton(6,21)
  661.     printButton(25,40)
  662.     printButton2(41,43)
  663.     if Button[43][7] then
  664.         sleep(1)
  665.         createArray()
  666.         amt = ""
  667.         printButton(1,2)
  668.         printButton(3,5)
  669.         printButton(22,24)
  670.         printButton(6,21)
  671.         printButton(25,40)
  672.         printButton2(41,43)
  673.     end
  674.     printAmount()
  675. end
Advertisement
Add Comment
Please, Sign In to add comment