Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Alle variabler
- local redspawner = "left"
- local input = "right"
- local laserstatus = ""
- local laser = 1
- local startlasersekvens = "1"
- local ladlaser = "2"
- local uladlaser = "3"
- local triggerlaser = "4"
- local laser_on = "5"
- local laser_off = "6"
- rednet.open("top")
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Programmer:")
- print("1. Start lasersekvens")
- print("2. Skru på laser lading")
- print("3. Skru av laser lading")
- print("4. Åpne laserport")
- print("5. Lukk laserport")
- term.setCursorPos(1,9)
- write("Status laser: ")
- write(laserstatus)
- term.setCursorPos(1,11)
- write("Kjør program:")
- pw = read()
- if pw == startlasersekvens then
- term.clear()
- term.setCursorPos(1,1)
- term.clear()
- print("Venter på laser..")
- laserstatus = 1
- rednet.broadcast("ladlaser")
- if
- os.pullEvent("redstone") then
- term.clear()
- term.setCursorPos(1,1)
- print("Laser klar!")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Starter alarm..")
- rednet.broadcast("ALARM_ON")
- print("Aktiverer om...")
- print("3")
- sleep(1)
- print("2")
- sleep(1)
- print("1")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Aktiv!")
- rednet.broadcast("redlaseron")
- print("Laser på")
- sleep(laser)
- rednet.broadcast("redlaseroff")
- print("Laser av")
- sleep(1)
- print("Alarm av")
- rednet.broadcast("ALARM_OFF")
- term.clear()
- end
- end
- if pw == ladlaser then
- laserstatus = 1
- rednet.broadcast("ladlaser")
- end
- if pw == uladlaser then
- laserstatus = 0
- rednet.broadcast("uladlaser")
- end
- if pw == laser_on then
- laserstatus = 1
- rednet.broadcast("redlaseron")
- rednet.broadcast("ladlaser")
- end
- if pw == laser_off then
- laserstatus = 0
- rednet.broadcast("redlaseroff")
- rednet.broadcast("uladlaser")
- end
- end
Add Comment
Please, Sign In to add comment