Working on system for getting stuff from chests (with buildcraft)
One master-console with a bring command Multiple slaves which react to a broadcast (via wireless)
This commit is contained in:
parent
e6cec9e1da
commit
4856635080
2 changed files with 27 additions and 0 deletions
6
bring
Normal file
6
bring
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
local args = { ... }
|
||||||
|
|
||||||
|
-- the wifi side, i guess...
|
||||||
|
rednet.open("right");
|
||||||
|
rednet.broadcast(args[1])
|
||||||
|
|
21
slave
Normal file
21
slave
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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 == id then
|
||||||
|
turtle.up()
|
||||||
|
for i = 1, dist do turtle.back() end
|
||||||
|
|
||||||
|
-- TODO: wait for empty chest or something
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
|
for i = 1, dist do turtle.forward() end
|
||||||
|
turtle.down()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- TODO: activate redstone for the buildcraft engine
|
||||||
|
|
Reference in a new issue