View difference between Paste ID: sxydm3gB and QMZRJuX9
SHOW: | | - or go back to the newest paste.
1
shell.run("clear")
2
rednet.open("right")
3
local x, y, z = gps.locate(5)
4
if x == nil then
5
print("Kein GPS-Signal")
6
sleep(3)
7
shell.run("clear")
8
print("Programm-Abruch")
9
sleep(3)
10
error()
11
end
12
print("Aktuelle Position: ",x," ",y," ",z)
13
print("Zielkoordinaten:")
14
print("X: ")
15
local xx = read()
16
print("Y: ")
17
local yy = read()
18
print("Z: ")
19
local zz = read()
20
local xxx = tonumber(xx)
21
local yyy = tonumber(yy)
22
local zzz = tonumber(zz)
23
shell.run("clear")
24
print("Aktuelle Position: ",x," ",y," ",z)
25
print("Zielkoordinaten: ",xxx," ",yyy," ",zzz)
26
print("Navigation starten? <JA/NEIN>")
27
if read() == "NEIN" then
28
shell.run("clear")
29
print("Programm-Abruch")
30
sleep(3)
31
error()
32
end
33
while 1 do
34
local x, y, z = gps.locate(1)
35
if z < 220 then
36-
print(z)
36+
37
sleep(0.1)
38-
sleep(2.0)
38+
39
sleep(0.1)
40-
sleep(2.0)
40+
41
sleep(0.1)
42-
sleep(2.0)
42+
43
sleep(0.1)
44-
sleep(2.0)
44+
45-
else
45+
if x < xxx then
46
redstone.setBundledOutput("back", colors.gray)
47
sleep(0.1)
48
redstone.setBundledOutput("back", colors.gray)
49
sleep(0.1)
50
rs.setBundledOutput("back", colors.pink)
51
sleep(0.1)
52
rs.setBundledOutput("back", colors.pink)
53
sleep(0.1)
54
end
55
if x > xxx then
56
redstone.setBundledOutput("back", colors.yellow)
57
sleep(0.1)
58
redstone.setBundledOutput("back", colors.yellow)
59
sleep(0.1)
60
rs.setBundledOutput("back", colors.lime)
61
sleep(0.1)
62
rs.setBundledOutput("back", colors.lime)
63
sleep(0.1)
64
end
65
if y < yyy then
66
redstone.setBundledOutput("back", colors.white)
67
sleep(0.1)
68
redstone.setBundledOutput("back", colors.white)
69
sleep(0.1)
70
rs.setBundledOutput("back", colors.orange)
71
sleep(0.1)
72
rs.setBundledOutput("back", colors.orange)
73
sleep(0.1)
74
end
75
if y > yyy then
76
redstone.setBundledOutput("back", colors.magenta)
77
sleep(0.1)
78
redstone.setBundledOutput("back", colors.magenta)
79
sleep(0.1)
80
rs.setBundledOutput("back", colors.lightBlue)
81
sleep(0.1)
82
rs.setBundledOutput("back", colors.lightBlue)
83
sleep(0.1)
84
end
85
end