The 3 firsts in the main computer (id 46) :
--startup program
rednet.open("back")
term.clear()
term.setCursorPos(1 ,1)
print("Controle de la Generation de Cobble (on / off)")
--on program
rednet.send(45,"on")
term.clear()
term.setCursorPos(1, 1)
print("Controle de la Generation de Cobble (on / off)")
--off program
rednet.send(45,"off")
term.clear()
term.setCursorPos(1, 1)
print("Controle de la Generation de Cobble (on / off)")
Then, in the Turtle (id 45), I've written this :
--startup program
rednet.open("right")
local id, message, dist = rednet.receive()
while true do
if message == "on" then
if turtle.detect() then
turtle.dig()
if message == "off" then
break
end
end
elseif message == "off" then
break
end
end
os.reboot()
My problem is that the turtle starts mining perfectly well, but it's impossible to stop it (except manually of course)