Posted 06 February 2014 - 05:39 PM
So I am working on building a mining machine using a combination of computercraft, redstone in motion, and thermal expansion. I have written the code in the startup file assuming that since redstone in motion restarts the computer everytime it runs that it would run. I can get it to run once the I have to rerun the control computer's script again to get it to run. Would love some help here is my code.
Mining Machine
Control Computer
Mining Machine
while true do
local modem = peripheral.wrap("right")
modem.open(1)
local event, modemSide, senderChannel, replyChannel, message, SenderDistance = os.pullEvent("modem_message")
shell.run("clear")
if message == "on" then
print("Miner ON")
os.sleep(2)
shell.run("moveNorth")
else
print ("Miner OFF")
end
os.pullEvent("redstone")
end
Control Computer
while true do
shell.run("clear")
if rs.getInput("left") == true then
print("redstone ON")
peripheral.call("right", "transmit", 1, 1, "on")
else
peripheral.call("right", "transmit", 1, 1, "off")
print("redstone OFF")
end
os.pullEvent("redstone")
end