Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clearAll()
- monitor.clear()
- monitor.setCursorPos(2,2)
- term.clear()
- term.setCursorPos(1,1)
- end
- function farmCollect()
- clearAll()
- check = turtle.detect()
- print("Farm Collection: In Progress")
- if check == true then
- turtle.dig()
- print("Collected!")
- monitor.write("ON!")
- turtle.dropDown()
- os.sleep(2)
- check = false
- clearAll()
- else
- print("Looking for harvest...")
- monitor.write("ON")
- os.sleep(2)
- clearAll()
- end
- end
- function stopSignal()
- x,y = rednet.receive()
- while true do
- if y == "stop" then
- a=a+1
- return
- end
- end
- end
- --The process:
- a = 0
- repeat
- parallel.waitForAny(farmCollect, stopSignal)
- until a == 1
- textutils.slowPrint("Shutting down...", 10)
- os.sleep(3)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment