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 laserbryter = "bottom"
- local laserstatus = ""
- local spawner = 5
- local laser = 1
- local dragedrap = "1"
- local ladlaser = "2"
- local uladlaser = "3"
- 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")
- term.setCursorPos(1,6)
- write("Laserstatus: ")
- write(laserstatus)
- term.setCursorPos(1,8)
- write("Kjør program:")
- input = redstone.getInput("right")
- pw = read()
- if pw == dragedrap then
- term.clear()
- term.setCursorPos(1,1)
- -- print("Starter reset")
- -- rs.setOutput(reset, true)
- -- sleep(1)
- --rs.setOutput(reset, false)
- term.clear()
- print("Venter på laser..")
- --os.pullEvent("redstone")
- laserstatus = 1
- rs.setOutput(laserbryter, true)
- if
- if input == true then
- --rs.getInput("right") then
- term.clear()
- 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!")
- rs.setOutput(redspawner, true)
- sleep(spawner)
- rs.setOutput(redspawner, false)
- rs.setOutput(redlaser, true)
- sleep(laser)
- rs.setOutput(redlaser, false)
- term.clear()
- end
- end
- if input == false then
- print("venter på laser..")
- if pw == ladlaser then
- laserstatus = 1
- rs.setOutput(laserbryter, true)
- end
- if pw == uladlaser then
- laserstatus = 0
- rs.setOutput(laserbryter, false)
- end
- end
- end
Add Comment
Please, Sign In to add comment