Advertisement
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 reset = "top"
- local laserstatus = ""
- local viftestatus = ""
- local spawner = 5
- local laser = 1
- local erlaserklar = ""
- local mottafra = 16
- local dragedrap = "1"
- local ladlaser = "2"
- local uladlaser = "3"
- rednet.open("left")
- while true do
- id, msg = rednet.receive()
- term.clear()
- term.setCursorPos(1,1)
- print("Programmer:")
- print("1. Drep drage")
- print("2. Skru på laser lading")
- print("3. Skru av laser lading")
- term.setCursorPos(1,6)
- write("Lader laser: ")
- write(laserstatus)
- term.setCursorPos(1,7)
- write("Er laser klar: ")
- write(erlaserklar)
- term.setCursorPos(1,8)
- write("Status vifte: ")
- write(viftestatus)
- term.setCursorPos(1,9)
- write("Kjør program:")
- pw = read()
- if pw == dragedrap then
- term.clear()
- term.setCursorPos(1,1)
- print("Venter på laser..")
- laserstatus = 1
- rednet.broadcast("ladlaser")
- if
- erlaserklar == 1 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")
- viftestatus = 1
- rednet.broadcast("spawneron")
- sleep(spawner)
- rednet.broadcast("spawneroff")
- rednet.broadcast("redlaseron")
- sleep(laser)
- rednet.broadcast("redlaseroff")
- rednet.broadcast("fanoff")
- viftestatus = 0
- 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 id == mottafra and msg == "laserklar" then
- erlaserklar = 1
- end
- if id == mottafra and msg == "laserikkeklar" then
- erlaserklar = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement