Lua scripts for the computercraft mod for minecraft
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
local args = { ... }
|
|
|
|
|
|
|
|
rednet.open("right")
|
|
|
|
while true do
|
|
|
|
-- we are using wireless to get the distance
|
|
|
|
-- so the master should be aligned with the slaves
|
|
|
|
local id, mess, dist = rednet.receive()
|
|
|
|
if mess == args[1] then
|
|
|
|
rednet.send(id, "ack")
|
|
|
|
turtle.up()
|
|
|
|
for i = 1, dist do turtle.back() end
|
|
|
|
|
|
|
|
print("I will leave again in 5 seconds...")
|
|
|
|
sleep(5)
|
|
|
|
print("Bye!")
|
|
|
|
|
|
|
|
for i = 1, dist do turtle.forward() end
|
|
|
|
turtle.down()
|
|
|
|
rednet.send(id, "return")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- TODO: activate redstone for the buildcraft engine
|
|
|
|
|