Not quite working
master
D4VID 9 months ago
parent cc813454ac
commit 3f55f115c0

@ -2,14 +2,21 @@ local drone = component.proxy(component.list("drone")())
local function fly(dx, dy, dz) local function fly(dx, dy, dz)
drone.move(dx, dy, dz) drone.move(dx, dy, dz)
drone.setStatusText(math.floor(dx) .. "," .. math.floor(dy) .. "," .. math.floor(dz))
while drone.getOffset() > 1 do while drone.getOffset() > 0.5 do
computer.pullSignal(0.1) computer.pullSignal(0.1)
end end
end end
while true do while true do
fly(0,2,0) local signal = table.pack(computer.pullSignal())
fly(10,0,0) if signal[1] == "motion" then
fly(-10,0,0) if signal[6] == "Zombie" then
fly(0,-2,0) fly(signal[3], signal[4]+2, signal[5])
if drone.getOffset() < 1 then
drone.setStatusText('' .. drone.getOffset())
drone.swing(3) -- forward
end
end
end
end end

Loading…
Cancel
Save