Advertisement
Guest User

startup

a guest
Jun 18th, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.81 KB | None | 0 0
  1. output = "front"   -- Bundles Output Side
  2. side = "back"     -- Monitor Side
  3.  
  4. redstone.setBundledOutput(output, 0)
  5. mon = peripheral.wrap(side)
  6. mon.setTextScale(1.5)
  7. mon.setBackgroundColor(colors.black)
  8. mon.clear()
  9.  
  10. function msg(gap, line, color, groundb, text)
  11.     if color == 1 then
  12.         color = 1
  13.     elseif color == 02 then
  14.         color = 2
  15.     elseif color == 03 then
  16.         color = 4
  17.     elseif color == 04 then
  18.         color = 8
  19.     elseif color == 05 then
  20.         color = 16
  21.     elseif color == 06 then
  22.         color = 32
  23.     elseif color == 07 then
  24.         color = 64
  25.     elseif color == 08 then
  26.         color = 128
  27.     elseif color == 09 then
  28.         color = 256
  29.     elseif color == 10 then
  30.         color = 512
  31.     elseif color == 11 then
  32.         color = 1024
  33.     elseif color == 12 then
  34.         color = 2048
  35.     elseif color == 13 then
  36.         color = 4096
  37.     elseif color == 14 then
  38.         color = 8192
  39.     elseif color == 15 then
  40.         color = 16384
  41.     elseif color == 16 then
  42.         color = 32768
  43.     end
  44.     if groundb == 1 then
  45.         groundb = 1
  46.     elseif groundb == 02 then
  47.         groundb = 2
  48.     elseif groundb == 03 then
  49.         groundb = 4
  50.     elseif groundb == 04 then
  51.         groundb = 8
  52.     elseif groundb == 05 then
  53.         groundb = 16
  54.     elseif groundb == 06 then
  55.         groundb = 32
  56.     elseif groundb == 07 then
  57.         groundb = 64
  58.     elseif groundb == 08 then
  59.         groundb = 128
  60.     elseif groundb == 09 then
  61.         groundb = 256
  62.     elseif groundb == 10 then
  63.         groundb = 512
  64.     elseif groundb == 11 then
  65.         groundb = 1024
  66.     elseif groundb == 12 then
  67.         groundb = 2048
  68.     elseif groundb == 13 then
  69.         groundb = 4096
  70.     elseif groundb == 14 then
  71.         groundb = 8192
  72.     elseif groundb == 15 then
  73.         groundb = 16384
  74.     elseif groundb == 16 then
  75.         groundb = 32768
  76.     end
  77.  
  78.     mon.setBackgroundColor(groundb)
  79.     mon.setCursorPos(gap,line)
  80.     mon.setTextColor(color)
  81.     text = mon.write(text)
  82. end
  83.  
  84. ------------------------------------
  85. function Iaus()
  86.     msg(2,02,1,15,"                 ")
  87.     msg(2,03,1,15,"     Bsp. 1      ")  --
  88.     msg(2,04,1,15,"                 ")
  89. end
  90.  
  91. function IIaus()
  92.     msg(2,06,1,15,"                 ")
  93.     msg(2,07,1,15,"     Bsp. 2      ")  --
  94.     msg(2,08,1,15,"                 ")
  95. end
  96.  
  97. function IIIaus()
  98.     msg(2,10,1,15,"                 ")
  99.     msg(2,11,1,15,"     Bsp. 3      ")  --
  100.     msg(2,12,1,15,"                 ")
  101. end
  102.  
  103. function IVaus()
  104.     msg(2,14,1,15,"                 ")
  105.     msg(2,15,1,15,"     Bsp. 4      ")  --
  106.     msg(2,16,1,15,"                 ")
  107. end
  108.  
  109. function Vaus()
  110.     msg(2,18,1,15,"                 ")
  111.     msg(2,19,1,15,"     Bsp. 5      ")  --
  112.     msg(2,20,1,15,"                 ")
  113. end
  114. ------------------------------------
  115. function Ian()
  116.     msg(2,02,1,06,"                 ")
  117.     msg(2,03,1,06,"     Bsp. 1      ")  --
  118.     msg(2,04,1,06,"                 ")
  119. end
  120.  
  121. function IIan()
  122.     msg(2,06,1,06,"                 ")
  123.     msg(2,07,1,06,"     Bsp. 2      ")  --
  124.     msg(2,08,1,06,"                 ")
  125. end
  126.  
  127. function IIIan()
  128.     msg(2,10,1,06,"                 ")
  129.     msg(2,11,1,06,"     Bsp. 3      ")  --
  130.     msg(2,12,1,06,"                 ")
  131. end
  132.  
  133. function IVan()
  134.     msg(2,14,1,06,"                 ")
  135.     msg(2,15,1,06,"     Bsp. 4      ")  --
  136.     msg(2,16,1,06,"                 ")
  137. end
  138.  
  139. function Van()
  140.     msg(2,18,1,06,"                 ")
  141.     msg(2,19,1,06,"     Bsp. 5      ")  --
  142.     msg(2,20,1,06,"                 ")
  143. end
  144. ------------------------------------
  145.  
  146.     file = fs.open("log1", "r")
  147.     local inhalt = file.readLine()
  148.     file.close()
  149.     print(inhalt)
  150.     if inhalt == "an" then
  151.         Ian()
  152.   sleep(0.5)
  153.         redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.yellow))
  154.         sleep(0.5)
  155.     elseif inhalt == "aus" then
  156.         Iaus()
  157.   sleep(0.5)
  158.         redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.yellow))
  159.         sleep(0.5)
  160.     end
  161.  
  162.     file = fs.open("log2", "r")
  163.     local inhalt = file.readLine()
  164.     file.close()
  165.     print(inhalt)
  166.     if inhalt == "an" then
  167.         IIan()
  168.         redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.blue))
  169.         sleep(0.5)
  170.     elseif inhalt == "aus" then
  171.         IIaus()
  172.         redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.blue))
  173.         sleep(0.5)
  174.     end
  175.  
  176.     file = fs.open("log3", "r")
  177.     local inhalt = file.readLine()
  178.     file.close()
  179.     print(inhalt)
  180.     if inhalt == "an" then
  181.         IIIan()
  182.         redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.white))
  183.         sleep(0.5)
  184.     elseif inhalt == "aus" then
  185.         IIIaus()
  186.         redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.white))
  187.         sleep(0.5)
  188.     end
  189.  
  190.     file = fs.open("log4", "r")
  191.     local inhalt = file.readLine()
  192.     file.close()
  193.     print(inhalt)
  194.     if inhalt == "an" then
  195.         IVan()
  196.         redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.red))
  197.         sleep(0.5)
  198.     elseif inhalt == "aus" then
  199.         IVaus()
  200.         redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.red))
  201.         sleep(0.5)
  202.     end
  203.  
  204.     file = fs.open("log5", "r")
  205.     local inhalt = file.readLine()
  206.     file.close()
  207.     print(inhalt)
  208.     if inhalt == "an" then
  209.         Van()
  210.         redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.green))
  211.         sleep(0.5)
  212.     elseif inhalt == "aus" then
  213.         Vaus()
  214.         redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.green))
  215.         sleep(0.5)
  216.     end
  217.  
  218.  
  219.  
  220. while true do
  221.         local event, side, X, Y = os.pullEvent("monitor_touch")
  222.         if X >= 1 and X <= 17 and Y >= 2 and Y <= 4 and side == side then
  223.             file = fs.open("log1", "r")
  224.             local inhalt = file.readLine()
  225.             file.close()
  226.             print(inhalt)
  227.             if inhalt == "an" then
  228.                 Iaus()
  229.                 file = fs.open("log1", "w")
  230.                 file.write("aus")
  231.                 file.close()
  232.                 redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.yellow))
  233.                 sleep(0.5)
  234.             elseif inhalt == "aus" then
  235.                 Ian()
  236.                 file = fs.open("log1", "w")
  237.                 file.write("an")
  238.                 file.close()
  239.                 redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.yellow))
  240.                 sleep(0.5)
  241.             end  
  242.         elseif X >= 1 and X <= 17 and Y >= 6 and Y <= 8 and side == side then
  243.             file = fs.open("log2", "r")
  244.             local inhalt = file.readLine()
  245.             file.close()
  246.             print(inhalt)
  247.             if inhalt == "an" then
  248.                 IIaus()
  249.                 file = fs.open("log2", "w")
  250.                 file.write("aus")
  251.                 file.close()
  252.                 redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.blue))
  253.                 sleep(0.5)
  254.             elseif inhalt == "aus" then
  255.                 IIan()
  256.                 file = fs.open("log2", "w")
  257.                 file.write("an")
  258.                 file.close()
  259.                 redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.blue))
  260.                 sleep(0.5)
  261.             end
  262.         elseif X >= 1 and X <= 17 and Y >= 10 and Y <= 12 and side == side then
  263.             file = fs.open("log3", "r")
  264.             local inhalt = file.readLine()
  265.             file.close()
  266.             print(inhalt)
  267.             if inhalt == "an" then
  268.                 IIIaus()
  269.                 file = fs.open("log3", "w")
  270.                 file.write("aus")
  271.                 file.close()
  272.                 redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.white))
  273.                 sleep(0.5)
  274.             elseif inhalt == "aus" then
  275.                 IIIan()
  276.                 file = fs.open("log3", "w")
  277.                 file.write("an")
  278.                 file.close()
  279.                 redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.white))
  280.                 sleep(0.5)
  281.             end
  282.         elseif X >= 1 and X <= 17 and Y >= 14 and Y <= 16 and side == side then
  283.             file = fs.open("log4", "r")
  284.             local inhalt = file.readLine()
  285.             file.close()
  286.             print(inhalt)
  287.             if inhalt == "an" then
  288.                 IVaus()
  289.                 file = fs.open("log4", "w")
  290.                 file.write("aus")
  291.                 file.close()
  292.                 redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.red))
  293.                 sleep(0.5)
  294.             elseif inhalt == "aus" then
  295.                 IVan()
  296.                 file = fs.open("log4", "w")
  297.                 file.write("an")
  298.                 file.close()
  299.                 redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.red))
  300.                 sleep(0.5)
  301.             end
  302.         elseif X >= 1 and X <= 17 and Y >= 18 and Y <= 20 and side == side then
  303.             file = fs.open("log5", "r")
  304.             local inhalt = file.readLine()
  305.             file.close()
  306.             print(inhalt)
  307.             if inhalt == "an" then
  308.                 Vaus()
  309.                 file = fs.open("log5", "w")
  310.                 file.write("aus")
  311.                 file.close()
  312.                 redstone.setBundledOutput(output,colors.subtract(redstone.getBundledOutput(output), colors.green))
  313.                 sleep(0.5)
  314.             elseif inhalt == "aus" then
  315.                 Van()
  316.                 file = fs.open("log5", "w")
  317.                 file.write("an")
  318.                 file.close()
  319.                 redstone.setBundledOutput(output,colors.combine(redstone.getBundledOutput(output), colors.green))
  320.                 sleep(0.5)
  321.             end
  322.         end
  323. sleep(0.5)
  324. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement