jamawie

Feuerwerk

Jan 7th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.96 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 printAmount()
  153.     overlay(70,18,"Amount")
  154.     mon.setBackgroundColor(colors.gray)
  155.     for B = 44,54 do
  156.         for xP = Button[B][1],Button[B][1]+2 do
  157.             for yP = Button[B][2],Button[B][2]+2 do
  158.                 mon.setCursorPos(xP,yP)
  159.                 mon.write(" ")
  160.             end
  161.         end
  162.         mon.setCursorPos(Button[B][1]+1,Button[B][2]+1)
  163.         mon.write(Button[B][3])
  164.     end
  165.     mon.setBackgroundColor(colors.black)
  166.     mon.setCursorPos(70,37)
  167.     mon.write(amt)
  168. end
  169.  
  170. function checkAmount(xP,yP)
  171.     for B = 44,54 do
  172.         if xP >= Button[B][1] and xP <= Button[B][1]+2
  173.         and yP >= Button[B][2] and yP <= Button[B][2]+2 then
  174.             if B == 54 then
  175.                 amt = string.sub(amt, 0, #amt-1)
  176.             else
  177.                 amt = amt..Button[B][3]
  178.             end
  179.         end
  180.     end
  181. end
  182.            
  183.    
  184. function printButton(b1,b2)
  185.   mon.setBackgroundColor(colors.black)
  186.   xP = Button[b1][1]-2
  187.   yP = Button[b1][2]-2
  188.   Pos1 = yP+1
  189.   Pos2 = yP+2
  190.   overlay(xP,yP,Button[b1][8])
  191.   mon.setBackgroundColor(colors.black)
  192.   for b = b1,b2 do
  193.     overlay(xP,Pos1,"|")
  194.     overlay(xP,Pos2,"+-")
  195.     Pos1 = Pos1+2
  196.     Pos2 = Pos2+2
  197.     if Button[b][7] then
  198.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  199.       mon.setBackgroundColor(colors.black)
  200.     else
  201.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  202.       mon.setBackgroundColor(colors.black)
  203.     end
  204.   end
  205. end
  206.  
  207. function printButton2(b1,b2)
  208.   mon.setBackgroundColor(colors.black)
  209.   xP = Button[b1][1]-2
  210.   yP = Button[b1][2]-2
  211.   Pos1 = yP+1
  212.   Pos2 = yP+2
  213.   overlay(xP,yP,Button[b1][8])
  214.   mon.setBackgroundColor(colors.black)
  215.   overlay(xP,Pos1,"|")
  216.   overlay(xP,Pos1+1,"|")
  217.   overlay(xP,Pos1+2,"+-")
  218.   for b = b1,b2 do
  219.     if b ~= b1 then
  220.         Pos1 = Pos1+4
  221.         overlay(xP,Pos1-1,"|")
  222.         overlay(xP,Pos1,"|")
  223.         overlay(xP,Pos1+1,"|")
  224.         overlay(xP,Pos1+2,"+-")
  225.     end
  226.     if Button[b][7] then
  227.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  228.       mon.setBackgroundColor(colors.black)
  229.     else
  230.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  231.       mon.setBackgroundColor(colors.black)
  232.     end
  233.   end
  234. end
  235.  
  236. function printButtonAnimation(b1,b2)
  237.   mon.setBackgroundColor(colors.black)
  238.   xP = Button[b1][1]-2
  239.   yP = Button[b1][2]-2
  240.   Pos1 = yP+1
  241.   Pos2 = yP+2
  242.   overlay(xP,yP,Button[b1][8])
  243.   mon.setBackgroundColor(colors.black)
  244.   for b = b1,b2 do
  245.     overlay(xP,Pos1,"|")
  246.     overlay(xP,Pos2,"+-")
  247.     Pos1 = Pos1+2
  248.     Pos2 = Pos2+2
  249.     if Button[b][7] then
  250.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  251.       mon.setBackgroundColor(colors.black)
  252.     else
  253.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  254.       mon.setBackgroundColor(colors.black)
  255.     end
  256.     sleep(0.1)
  257.   end
  258. end
  259.  
  260. function printButton2Animation(b1,b2)
  261.   mon.setBackgroundColor(colors.black)
  262.   xP = Button[b1][1]-2
  263.   yP = Button[b1][2]-2
  264.   Pos1 = yP+1
  265.   Pos2 = yP+2
  266.   overlay(xP,yP,Button[b1][8])
  267.   mon.setBackgroundColor(colors.black)
  268.   overlay(xP,Pos1,"|")
  269.   overlay(xP,Pos1+1,"|")
  270.   overlay(xP,Pos1+2,"+-")
  271.   for b = b1,b2 do
  272.     if b ~= b1 then
  273.         Pos1 = Pos1+4
  274.         overlay(xP,Pos1-1,"|")
  275.         overlay(xP,Pos1,"|")
  276.         overlay(xP,Pos1+1,"|")
  277.         overlay(xP,Pos1+2,"+-")
  278.     end
  279.     if Button[b][7] then
  280.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],Button[b][6])
  281.       mon.setBackgroundColor(colors.black)
  282.     else
  283.       Bt(Button[b][1],Button[b][2],Button[b][3],Button[b][4],Button[b][5],colors.gray)
  284.       mon.setBackgroundColor(colors.black)
  285.     end
  286.     sleep(0.1)
  287.   end
  288. end
  289.  
  290. function checkButton(xP,yP)
  291.     col1 = 0
  292.     col2 = 0
  293.     for B = 1,21 do
  294.         if Button[B][7] then
  295.             col1 = col1+1
  296.         end
  297.     end
  298.     for B = 25,40 do
  299.         if Button[B][7] then
  300.             col2 = col2+1
  301.         end
  302.     end
  303.  
  304.     for B = 1,43 do
  305.         if xP >= Button[B][1] and xP <= Button[B][3] and
  306.            yP >= Button[B][2]-0.5 and yP <= Button[B][4]+0.5 then
  307.             if Button[B][7] then
  308.                 Button[B][7] = false
  309.             elseif Button[B][7] == false then
  310.                 if B >= 1 and B <= 21 or B >= 25 and B <= 40 then
  311.                     if B >= 1 and B <= 21 then
  312.                         if col1 >=8 then
  313.                         else
  314.                             Button[B][7] = true
  315.                             if B == 1 then
  316.                                 Button[2][7] = false
  317.                             elseif B == 2 then
  318.                                 Button[1][7] = false
  319.                             elseif B == 3 then
  320.                                 Button[4][7] = false  
  321.                                 Button[5][7] = false  
  322.                             elseif B == 4 then
  323.                                 Button[3][7] = false  
  324.                                 Button[5][7] = false  
  325.                             elseif B == 5 then
  326.                                 Button[3][7] = false  
  327.                                 Button[4][7] = false
  328.                             end
  329.                         end
  330.                     elseif B >= 25 and B <= 40 then
  331.                         if col2 >=8 then
  332.                         else
  333.                             Button[B][7] = true
  334.                         end
  335.                     end
  336.                 else
  337.                 Button[B][7] = true
  338.                 if B == 22 then
  339.                     Button[23][7] = false  
  340.                     Button[24][7] = false  
  341.                 elseif B == 23 then
  342.                     Button[22][7] = false  
  343.                     Button[24][7] = false  
  344.                 elseif B == 24 then
  345.                     Button[22][7] = false  
  346.                     Button[23][7] = false
  347.                 end
  348.                 end
  349.             end
  350.         end
  351.     end
  352. end
  353.  
  354.  function list()
  355.     i=0
  356.     overlay(67,6,"Auswahl:")
  357.     for B = 1,#Button do
  358.         if Button[B][7] then
  359.             mon.setCursorPos(67,8+2*i)
  360.             mon.write(Button[B][8].." "..Button[B][5].."      ")
  361.             i=i+1
  362.         end
  363.     end
  364.  end
  365.  
  366. function progress(actualProgress, maxProgress, title, msg, cAProgress, cMaxProgress)
  367.     x1 = (xMax/2)-15
  368.     x2 = (xMax/2)+15
  369.     y1 = (yMax/2)-7
  370.     y2 = (yMax/2)+7
  371.  
  372.     mon.setBackgroundColor(colors.gray)
  373.     mon.setTextColor(colors.white)
  374.     for i=y1, y2 do
  375.         mon.setCursorPos(x1,i)
  376.         for j=x1, x2 do
  377.             if i==y1 or i==y2 then
  378.                 if j==x1 or j==x2 then
  379.                     mon.write("+")
  380.                 else
  381.                     mon.write("-")
  382.                 end
  383.             else
  384.                 if j==x1 or j==x2 then
  385.                     mon.write("|")
  386.                 else
  387.                     mon.write(" ")
  388.                 end
  389.             end
  390.         end
  391.     end
  392.     mon.setCursorPos((xMax/2)-(#title/2), y1+2)
  393.     mon.write(title)
  394.     mon.setCursorPos((xMax/2)-(#msg/2), y1+6)
  395.     mon.write(msg)
  396.     mon.setCursorPos(x1+2,y1+9)
  397.     mon.setBackgroundColor(colors.lightGray)
  398.     for i=1,27 do
  399.         mon.write(" ")
  400.     end
  401.     mon.setCursorPos(x1+2,y1+9)
  402.     mon.setBackgroundColor(colors.lime)
  403.     for i=1,((27/maxProgress)*actualProgress) do
  404.         mon.write(" ")
  405.     end
  406.     if cAProgress~=nil and cMaxProgress~=nil then
  407.         percentage = tostring(math.floor((100/cMaxProgress)*cAProgress)) .. "%"
  408.         mon.setCursorPos(x1+2,y1+12)
  409.             mon.setBackgroundColor(colors.lightGray)
  410.         for i=1,27 do
  411.             mon.write(" ")
  412.         end
  413.         mon.setCursorPos(x1+2,y1+12)
  414.         mon.setBackgroundColor(colors.blue)
  415.         for i=1,((27/cMaxProgress)*cAProgress) do
  416.             mon.write(" ")
  417.         end
  418.         mon.setBackgroundColor(colors.gray)
  419.         mon.setCursorPos((xMax/2)-(#percentage/2), y1+11)
  420.         mon.write(percentage)
  421.     end
  422.     mon.setBackgroundColor(colors.black)
  423. end
  424.  
  425. function craft(anzahl)
  426.     --set 0
  427.     rs.setBundledOutput(BundledCableColorESP,0)
  428.     rs.setBundledOutput(BundledCableColor1,0)
  429.     rs.setBundledOutput(BundledCableColor2,0)
  430.     if vorschau == true then
  431.         rs.setBundledOutput(BundledCableExtra,colors.lime+colors.magenta+colors.lightBlue+colors.pink+colors.gray)
  432.         progress(0, 4, "Vorschau-Progress", "starting...")
  433.     else
  434.         rs.setBundledOutput(BundledCableExtra,colors.lime+colors.magenta+colors.lightBlue+colors.pink)
  435.         progress(0, 3, "Crafting-Progress", "starting...")
  436.     end
  437.     sleep(5)
  438.     --Color1
  439.     for b = 6,21 do
  440.         if Button[b][7] then
  441.             rs.setBundledOutput(BundledCableColor1,rs.getBundledOutput(BundledCableColor1)+Button[b][9])
  442.         end
  443.     end
  444.     for b = 1,5 do
  445.         if Button[b][7] then
  446.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[b][9])
  447.         end
  448.     end
  449.     if vorschau == true then
  450.         progress(1, 4, "Vorschau-Progress", "initialising...", 1, 2)
  451.     else
  452.         progress(1, 3, "Crafting-Progress", "initialising...", 1, 2)
  453.     end
  454.     sleep(7)
  455.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  456.     sleep(tickrate/2)
  457.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  458.     sleep(tickrate/2)
  459.     for b = 25,40 do
  460.         if Button[b][7] then
  461.             rs.setBundledOutput(BundledCableColor2,rs.getBundledOutput(BundledCableColor2)+Button[b][9])
  462.         end
  463.     end
  464.     if vorschau == true then
  465.         progress(1, 4, "Vorschau-Progress", "initialising...", 2, 2)
  466.     else
  467.         progress(1, 3, "Crafting-Progress", "initialising...", 2, 2)
  468.     end
  469.     sleep(7)
  470.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  471.     sleep(tickrate/2)
  472.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  473.     sleep(tickrate/2)
  474.         if Button[22][7] then
  475.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+colors.lightGray)
  476.         elseif Button[23][7] then
  477.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+Button[23][9]          +colors.lightGray)
  478.         elseif Button[24][7] then
  479.             rs.setBundledOutput(BundledCableColorESP,rs.getBundledOutput(BundledCableColorESP)+Button[22][9]+Button[23][9]+Button[24][9]+colors.lightGray)
  480.         end
  481.     if vorschau == true then
  482.         progress(2, 4, "Vorschau-Progress", "crafting...", 0, anzahl+3)
  483.     else
  484.         progress(2, 3, "Crafting-Progress", "crafting...", 0, anzahl+3)
  485.     end
  486.     sleep(7)
  487.     for b = 1,anzahl+3 do
  488.         progress(3, 5, "Crafting-Progress", "crafting...", b, anzahl+3)
  489.         rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  490.         sleep(tickrate/2)
  491.         rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  492.         sleep(tickrate/2)
  493.     end
  494.  
  495.     if vorschau == true then
  496.         progress(3, 4, "Vorschau-Progress", "cleaning up...", 1, 2)
  497.     else
  498.         progress(3, 3, "Crafting-Progress", "cleaning up...", 1, 2)
  499.     end
  500.     rs.setBundledOutput(BundledCableColor1,  0)
  501.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.magenta))       
  502.  
  503.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  504.     sleep(tickrate)
  505.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  506.     sleep(tickrate/2)
  507.  
  508.     if vorschau == true then
  509.         progress(3, 4, "Vorschau-Progress", "cleaning up...", 2, 2)
  510.     else
  511.         progress(3, 3, "Crafting-Progress", "cleaning up...", 2, 2)
  512.     end
  513.  
  514.     rs.setBundledOutput(BundledCableColor2,  0)
  515.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lightBlue)) 
  516.  
  517.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  518.     sleep(tickrate)
  519.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  520.     sleep(tickrate/2)
  521.  
  522.    
  523.     rs.setBundledOutput(BundledCableColorESP,     colors.subtract(rs.getBundledOutput(BundledCableColorESP),colors.white,colors.orange,colors.magenta,colors.lightBlue,colors.yellow))
  524.    
  525.     rs.setBundledOutput(BundledCableExtra,   colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lime))
  526.  
  527.     rs.setBundledOutput(BundledCableExtra,rs.getBundledOutput(BundledCableExtra)+Button[42][9])
  528.     sleep(tickrate)
  529.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.orange))
  530.     sleep(tickrate/2)
  531.  
  532.     rs.setBundledOutput(BundledCableExtra,0)
  533.     if vorschau == true then
  534.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.gray)
  535.     end
  536.     rs.setBundledOutput(BundledCableColorESP,0)
  537.     rs.setBundledOutput(BundledCableColor1,0)
  538.     rs.setBundledOutput(BundledCableColor2,0)
  539.    
  540.     sleep(10)
  541.     mon.setBackgroundColor(colors.black)
  542.     mon.clear()
  543. end
  544.  
  545. function Vorschau()
  546.     vorschau = true
  547.     rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.gray)
  548.     craft(3)
  549.     t = 0
  550.     if Button[22][7] then
  551.             t = 0.5
  552.     elseif Button[23][7] then
  553.             t = 0.9
  554.     elseif Button[24][7] then
  555.             t = 1.2
  556.     end
  557.     progress(4, 4, "Vorschau-Progress", "showing Firework...", 0, 5)   
  558.     for i = 1,5 do
  559.         progress(4, 4, "Vorschau-Progress", "showing Firework...", i, 5)   
  560.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.lightGray)
  561.         sleep(t)
  562.         rs.setBundledOutput(BundledCableExtra, rs.getBundledOutput(BundledCableExtra)+colors.cyan)
  563.         sleep(0.5)
  564.         rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.lightGray,colors.cyan))
  565.         sleep(0.5)
  566.     end
  567.     rs.setBundledOutput(BundledCableExtra,colors.subtract(rs.getBundledOutput(BundledCableExtra),colors.gray))
  568.     vorschau = false
  569.     mon.clear()
  570. end
  571.  
  572. --startup
  573. rs.setBundledOutput(BundledCableColorESP,0)
  574. rs.setBundledOutput(BundledCableColor1,0)
  575. rs.setBundledOutput(BundledCableColor2,0)
  576. rs.setBundledOutput(BundledCableExtra,0)
  577. amt = ""
  578. createArray()
  579. Background(colors.black)
  580. JoJa(xMax/2-7,1)
  581. mon.setBackgroundColor(colors.black)
  582. mon.setTextColor(colors.white)
  583. overlay(xMax/2-10,yMax/2-1,"Bitte auf den Monitor")
  584. overlay(xMax/2-5,yMax/2,"klicken...")
  585. event = os.pullEvent("monitor_touch")
  586. Background(colors.black)
  587. JoJa(xMax/2-7,1)
  588. printButtonAnimation(1,2)
  589. printButtonAnimation(3,5)
  590. printButtonAnimation(22,24)
  591. printButtonAnimation(6,21)
  592. printButtonAnimation(25,40)
  593. printButton2Animation(41,43)
  594. sleep(0.1)
  595. printAmount()
  596.  
  597. while true do
  598.     JoJa(xMax/2-7,1)
  599.     event,_,xPos,yPos = os.pullEvent("monitor_touch")
  600.     Background(colors.black)
  601.     checkButton(xPos,yPos)
  602.     checkAmount(xPos,yPos)
  603.     if Button[41][7] then
  604.         Vorschau()
  605.         Button[41][7] = false
  606.     end
  607.     if Button[42][7] then
  608.         craft(amt)
  609.         Button[42][7] = false
  610.     end
  611.     printButton(1,2)
  612.     printButton(3,5)
  613.     printButton(22,24)
  614.     printButton(6,21)
  615.     printButton(25,40)
  616.     printButton2(41,43)
  617.     if Button[43][7] then
  618.         sleep(1)
  619.         createArray()
  620.         amt = ""
  621.         printButton(1,2)
  622.         printButton(3,5)
  623.         printButton(22,24)
  624.         printButton(6,21)
  625.         printButton(25,40)
  626.         printButton2(41,43)
  627.     end
  628.     printAmount()
  629. end
Add Comment
Please, Sign In to add comment