Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "v0.1"
- objekt = "objekt"
- cmdPC = true
- obrazovka = true
- MonitorPos = "monitor_5"
- linky = 0
- Red_Line = true
- cervena = "PU c.1"
- Orange_Line = true
- oranzova = "PU c.2"
- Magenta_Line = true
- magentaT = "PU c.3"
- lightBlue_Line = true
- lightBlueT = "PU c.4"
- yellow_Line = true
- yellowT = "PU c.5"
- pink_Line = true
- pinkT = "PU c.6"
- if Red_Line then
- linky = linky + colors.red
- end
- if Orange_Line then
- linky = linky + colors.orange
- end
- if Magenta_Line then
- linky = linky + colors.magenta
- end
- if lightBlue_Line then
- linky = linky + colors.lightBlue
- end
- if yellow_Line then
- linky = linky + colors.yellow
- end
- if pink_Line then
- linky = linky + colors.pink
- end
- function klid_tik()
- redstone.setBundledOutput("back", linky)
- sleep(2)
- redstone.setBundledOutput("back", 0)
- sleep(1)
- vyhodnoceni()
- end
- function vyhodnoceni()
- if Red_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.red)) then
- Line = cervena
- poplach()
- end
- end
- if Orange_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.orange)) then
- Line = oranzova
- poplach()
- end
- end
- if Magenta_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.magenta)) then
- Line = magentaT
- poplach()
- end
- end
- if lightBlue_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.lightBlue)) then
- Line = lightBlueT
- poplach()
- end
- end
- if yellow_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.yellow)) then
- Line = yellowT
- poplach()
- end
- end
- if pink_Line then
- if (colors.test (redstone.getBundledInput("back"), colors.pink)) then
- Line = pinkT
- poplach()
- end
- end
- klid_tik()
- end
- function poplach()
- if obrazovka then
- monitor("poplach")
- end
- if cmdPC then
- for i=1,5 do
- commands.exec("say POZAR! Objekt: "..objekt.." cidlo v PU: "..Line)
- sleep(1)
- end
- end
- os.shutdown()
- end
- function monitor(udalost)
- local monitor = peripheral.wrap(MonitorPos)
- monitor.setTextScale(1)
- if (udalost == "start") then
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write( "EPS by Pepek@Soft" )
- monitor.setCursorPos(1,3)
- monitor.write( "Stav: " )
- monitor.setCursorPos(15,5)
- monitor.write(verze)
- monitor.setCursorPos(7,3)
- monitor.setTextColor(colors.lime)
- monitor.write( "v klidu" )
- elseif (udalost == "poplach") then
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write( "POPLACH! POPLACH!" )
- monitor.setCursorPos(1,3)
- monitor.write( "Nahlasil:" )
- monitor.setTextColor(colors.black)
- monitor.setCursorPos(1,4)
- monitor.write(Line)
- end
- end
- if obrazovka then
- monitor("start")
- end
- klid_tik()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement