Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Alle variabler
- local redspawner = "left"
- local redlaser = "back"
- local input = "right"
- local laserstatus = ""
- local viftestatus = ""
- local spawner = 5
- local laser = 1
- local dragedrap = "1"
- local ladlaser = "2"
- local uladlaser = "3"
- local triggerlaser = "4"
- local turnfanon = "5"
- local turnfanoff = "6"
- rednet.open("left")
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Programmer:")
- print("1. Drep drage")
- print("2. Skru på laser lading")
- print("3. Skru av laser lading")
- print("4. Aktiver laser manuelt")
- term.setCursorPos(1,7)
- write("Status laser: ")
- write(laserstatus)
- term.setCursorPos(1,8)
- write("Status vifte: ")
- write(viftestatus)
- term.setCursorPos(1,10)
- write("Kjør program:")
- pw = read()
- if pw == dragedrap 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("Aktiverer om...")
- print("3")
- sleep(1)
- print("2")
- sleep(1)
- print("1")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Aktiv!")
- rednet.broadcast("fanon")
- print("Vifte på")
- viftestatus = 1
- rednet.broadcast("spawneron")
- print("Spawner på")
- sleep(spawner)
- rednet.broadcast("spawneroff")
- print("Spawner av")
- rednet.broadcast("redlaseron")
- print("Laser på")
- sleep(laser)
- rednet.broadcast("redlaseroff")
- print("Laser av")
- rednet.broadcast("fanoff")
- print("Vifte av")
- viftestatus = 0
- sleep(1)
- 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 == fanon then
- rednet.broadcast("fanon")
- end
- if pw == fanoff then
- rednet.broadcast("fanoff")
- end
- if pw == triggerlaser then
- term.clear()
- term.setCursorPos(1,1)
- print("Aktiverer laser manuelt")
- rednet.broadcast("redlaseron")
- print("Laser på!")
- sleep(laser)
- rednet.broadcast("redlaseroff")
- print("Laser av!")
- sleep(1)
- end
- if pw == turnfanon then
- viftestatus = 1
- rednet.broadcast("fanon")
- end
- if pw == turnfanoff then
- viftestatus = 0
- rednet.broadcast("fanoff")
- end
- end
Add Comment
Please, Sign In to add comment