Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- local trustedID = 26
- local ID = 22
- function checkCoal()
- turtle.select(1)
- turtle.getItemCount()
- if turtle.getItemCount() <= 4 then
- turtle.select(16)
- turtle.placeUp()
- turtle.select(1)
- turtle.suckUp(60)
- turtle.select(16)
- turtle.digUp()
- turtle.select(1)
- end
- end
- function checkFuel()
- turtle.getFuelLevel()
- if turtle.getFuelLevel() <= 10 then
- turtle.select(1)
- turtle.refuel(1)
- end
- end
- function beginMining()
- turtle.select(2)
- turtle.forward(1)
- turtle.place()
- turtle.select(3)
- turtle.up(1)
- turtle.place()
- turtle.select(4)
- turtle.back(1)
- turtle.down(1)
- turtle.place()
- sleep(40)
- end
- function endMining()
- turtle.select(4)
- turtle.dig()
- turtle.select(2)
- turtle.forward(1)
- turtle.dig()
- turtle.select(3)
- turtle.up(1)
- turtle.dig()
- turtle.down()
- end
- function rednetControl()
- trustedID, message = rednet.receive()
- if message == "Identify" then
- print("Identifing")
- rednet.send(trustedID, "Miner1")
- print("Identified")
- trustedID, message = rednet.receive()
- if message == "Check" then
- print("Checking")
- checkCoal()
- checkFuel()
- rednet.send(trustedID, "Checked")
- print("Checked")
- trustedID, message = rednet.receive()
- if message == "Mine" then
- print("Mining")
- beginMining()
- endMining()
- print("Mining Complete")
- rednet.send(trustedID, "Complete")
- end
- end
- end
- end
- rednetControl()
Add Comment
Please, Sign In to add comment