Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Dateien die erstellt werden müssen_
- -- doors, strom, ...
- mon = peripheral.wrap("back")
- redstone.setBundledOutput("right", 0)
- mon.setBackgroundColor(colors.black)
- mon.setTextScale(1.5)
- mon.clear()
- -- Hilfsfunktionen --
- function color(color)
- mon.setTextColor(color)
- end
- function pos(gap, line)
- mon.setCursorPos(gap1,line1)
- end
- function zzz(a,b,c,text)
- mon.setCursorPos(a,b)
- mon.setTextColor(c)
- mon.write(text)
- end
- function bg(color)
- mon.setBackgroundColor(color)
- end
- function msg(gap, line, color, groundb, text)
- if color == 1 then
- color = 1
- elseif color == 02 then
- color = 2
- elseif color == 03 then
- color = 4
- elseif color == 04 then
- color = 8
- elseif color == 05 then
- color = 16
- elseif color == 06 then
- color = 32
- elseif color == 07 then
- color = 64
- elseif color == 08 then
- color = 128
- elseif color == 09 then
- color = 256
- elseif color == 10 then
- color = 512
- elseif color == 11 then
- color = 1024
- elseif color == 12 then
- color = 2048
- elseif color == 13 then
- color = 4096
- elseif color == 14 then
- color = 8192
- elseif color == 15 then
- color = 16384
- elseif color == 16 then
- color = 32768
- end
- if groundb == 1 then
- groundb = 1
- elseif groundb == 02 then
- groundb = 2
- elseif groundb == 03 then
- groundb = 4
- elseif groundb == 04 then
- groundb = 8
- elseif groundb == 05 then
- groundb = 16
- elseif groundb == 06 then
- groundb = 32
- elseif groundb == 07 then
- groundb = 64
- elseif groundb == 08 then
- groundb = 128
- elseif groundb == 09 then
- groundb = 256
- elseif groundb == 10 then
- groundb = 512
- elseif groundb == 11 then
- groundb = 1024
- elseif groundb == 12 then
- groundb = 2048
- elseif groundb == 13 then
- groundb = 4096
- elseif groundb == 14 then
- groundb = 8192
- elseif groundb == 15 then
- groundb = 16384
- elseif groundb == 16 then
- groundb = 32768
- end
- mon.setBackgroundColor(groundb)
- mon.setCursorPos(gap,line)
- mon.setTextColor(color)
- text = mon.write(text)
- end
- -- Hauptfunctionen --
- function kabelbelegung()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- zzz(01,01,16384,"Farbbelegung gelbes Bundled-Wire:")
- bg(32768) zzz(01,02,00256,"01. Mobfarm voll/leer")
- bg(16) zzz(35,02,00001," ")
- bg(32768) zzz(01,03,00256,"02. Alle Türen auf/zu")
- bg(01) zzz(35,03,00001," ")
- bg(32768) zzz(01,04,00256,"03. noch frei")
- bg(265) zzz(35,04,00001," ")
- bg(32768) zzz(01,05,00256,"04. noch frei")
- bg(265) zzz(35,05,00001," ")
- bg(32768) zzz(01,06,00256,"05. noch frei")
- bg(265) zzz(35,06,00001," ")
- bg(32768) zzz(01,07,00256,"06. noch frei")
- bg(265) zzz(35,07,00001," ")
- bg(32768) zzz(01,08,00256,"07. noch frei")
- bg(265) zzz(35,08,00001," ")
- bg(32768) zzz(01,09,00256,"08. noch frei")
- bg(265) zzz(35,09,00001," ")
- bg(32768) zzz(01,10,00256,"09. noch frei")
- bg(265) zzz(35,10,00001," ")
- bg(32768) zzz(01,11,00256,"10. noch frei")
- bg(265) zzz(35,11,00001," ")
- bg(32768) zzz(01,12,00256,"11. noch frei")
- bg(265) zzz(35,12,00001," ")
- bg(32768) zzz(01,13,00256,"12. noch frei")
- bg(265) zzz(35,13,00001," ")
- bg(32768) zzz(01,14,00256,"13. noch frei")
- bg(265) zzz(35,14,00001," ")
- bg(32768) zzz(01,15,00256,"14. noch frei")
- bg(265) zzz(35,15,00001," ")
- bg(32768) zzz(01,16,00256,"15. noch frei")
- bg(265) zzz(35,16,00001," ")
- bg(32768) zzz(01,17,00256,"16. noch frei")
- bg(265) zzz(35,17,00001," ")
- os.pullEvent("monitor_touch")
- shell.run("1")
- end
- --------------------------------------
- function doors1()
- msg(01,01,16,15," ")
- msg(01,02,16,15," Türen manuell ")
- msg(01,03,16,15," ")
- end
- function doors2()
- msg(01,01,16,06," ")
- msg(01,02,16,06," Türen auf ")
- msg(01,03,16,06," ")
- end
- --------------------------------------
- function strom1()
- msg(01,05,16,15," ")
- msg(01,06,16,15," Haus-Strom ")
- msg(01,07,16,15," ")
- end
- function strom2()
- msg(01,05,16,06," ")
- msg(01,06,16,06," Haus-Strom ")
- msg(01,07,16,06," ")
- end
- --------------------------------------
- function farben()
- msg(01,15,16,01," ")
- msg(01,16,16,01," Farbbelegung ")
- msg(01,17,16,01," ")
- end
- --------------------------------------
- farben()
- file = fs.open("doors", "r")
- local inhalt = file.readLine()
- file.close()
- if inhalt == "rot" then
- doors1()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.combine(redstone.getBundledOutput("right"), colors.white))
- sleep(0.5)
- elseif inhalt == "gruen" then
- doors2()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.subtract(redstone.getBundledOutput("right"), colors.white))
- sleep(0.5)
- end
- --------------------------------------
- file = fs.open("strom", "r")
- local inhalt = file.readLine()
- file.close()
- if inhalt == "rot" then
- strom1()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.subtract(redstone.getBundledOutput("right"), colors.red))
- sleep(0.5)
- elseif inhalt == "gruen" then
- strom2()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.combine(redstone.getBundledOutput("right"), colors.red))
- sleep(0.5)
- end
- --------------------------------------
- --file = fs.open("beispiel", "r")
- --local inhalt = file.readLine()
- --file.close()
- --if inhalt == "rot" then
- -- beispiel()
- -- sleep(0.5)
- -- -- redstone.setBundledOutput("right",colors.combine(redstone.getBundledOutput("right"), colors.yellow))
- -- sleep(0.5)
- --elseif inhalt == "gruen" then
- -- beispiel()
- -- sleep(0.5)
- -- -- redstone.setBundledOutput("right",colors.subtract(redstone.getBundledOutput("right"), colors.yellow))
- -- sleep(0.5)
- --end
- --------------------------------------
- while true do
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 1 and X <= 16 and Y >= 15 and Y <= 17 and side == "back" then
- kabelbelegung()
- ----------------------------------------------------------------------------------------------------------------------
- elseif X >= 1 and X <= 15 and Y >= 1 and Y <= 3 and side == "back" then
- file = fs.open("doors", "r")
- local inhalt = file.readLine()
- file.close()
- if inhalt == "rot" then
- doors2()
- file = fs.open("doors", "w")
- file.write("gruen")
- file.close()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.combine(redstone.getBundledOutput("right"), colors.white))
- sleep(0.5)
- elseif inhalt == "gruen" then
- doors1()
- file = fs.open("doors", "w")
- file.write("rot")
- file.close()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.subtract(redstone.getBundledOutput("right"), colors.white))
- sleep(0.5)
- end
- ----------------------------------------------------------------------------------------------------------------------
- elseif X >= 1 and X <= 15 and Y >= 5 and Y <= 7 and side == "back" then
- file = fs.open("strom", "r")
- local inhalt = file.readLine()
- file.close()
- if inhalt == "rot" then
- strom2()
- file = fs.open("strom", "w")
- file.write("gruen")
- file.close()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.combine(redstone.getBundledOutput("right"), colors.red))
- sleep(0.5)
- elseif inhalt == "gruen" then
- strom1()
- file = fs.open("strom", "w")
- file.write("rot")
- file.close()
- sleep(0.5)
- redstone.setBundledOutput("right",colors.subtract(redstone.getBundledOutput("right"), colors.red))
- sleep(0.5)
- end
- end
- end
- ----------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement