Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- rednet.open("right")
- local x, y, z = gps.locate(5)
- if x == nil then
- print("Kein GPS-Signal")
- sleep(3)
- shell.run("clear")
- print("Programm-Abruch")
- sleep(3)
- error()
- end
- print("Aktuelle Position: ",x," ",y," ",z)
- print("Zielkoordinaten:")
- print("X: ")
- local xx = read()
- print("Y: ")
- local yy = read()
- print("Z: ")
- local zz = read()
- local xxx = tonumber(xx)
- local yyy = tonumber(yy)
- local zzz = tonumber(zz)
- shell.run("clear")
- print("Aktuelle Position: ",x," ",y," ",z)
- print("Zielkoordinaten: ",xxx," ",yyy," ",zzz)
- print("Navigation starten? <JA/NEIN>")
- if read() == "NEIN" then
- shell.run("clear")
- print("Programm-Abruch")
- sleep(3)
- error()
- end
- while 1 do
- local x, y, z = gps.locate(1)
- if z < 220 then
- rs.setBundledOutput("back", colors.purple)
- sleep(0.1)
- rs.setBundledOutput("back", colors.purple)
- sleep(0.1)
- rs.setBundledOutput("back", colors.blue)
- sleep(0.1)
- rs.setBundledOutput("back", colors.blue)
- sleep(0.1)
- end
- if x > xxx then
- redstone.setBundledOutput("back", colors.gray)
- sleep(0.1)
- redstone.setBundledOutput("back", colors.gray)
- sleep(0.1)
- rs.setBundledOutput("back", colors.pink)
- sleep(0.1)
- rs.setBundledOutput("back", colors.pink)
- sleep(0.1)
- end
- if x < xxx then
- redstone.setBundledOutput("back", colors.yellow)
- sleep(0.1)
- redstone.setBundledOutput("back", colors.yellow)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lime)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lime)
- sleep(0.1)
- end
- if y > yyy then
- redstone.setBundledOutput("back", colors.white)
- sleep(0.1)
- redstone.setBundledOutput("back", colors.white)
- sleep(0.1)
- rs.setBundledOutput("back", colors.orange)
- sleep(0.1)
- rs.setBundledOutput("back", colors.orange)
- sleep(0.1)
- end
- if y < yyy then
- redstone.setBundledOutput("back", colors.magenta)
- sleep(0.1)
- redstone.setBundledOutput("back", colors.magenta)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lightBlue)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lightBlue)
- sleep(0.1)
- end
- if z < zzz
- rs.setBundledOutput("back", colors.purple)
- sleep(0.1)
- rs.setBundledOutput("back", colors.purple)
- sleep(0.1)
- rs.setBundledOutput("back", colors.blue)
- sleep(0.1)
- rs.setBundledOutput("back", colors.blue)
- sleep(0.1)
- end
- end
- while 1 do
- local x, y, z = gps.locate(1)
- if z > zzz
- redstone.setBundledOutput("back", colors.cyan)
- sleep(0.1)
- redstone.setBundledOutput("back", colors.cyan)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lightGray)
- sleep(0.1)
- rs.setBundledOutput("back", colors.lightGray)
- sleep(0.1)
- end
- if z == zzz
- shell.run("clear")
- error()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement