Advertisement
Muzze77

AutoMiningTurtle

May 8th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. shell.run("clear")
  2. n = nil
  3. rednet.open("right")
  4. modem = peripheral.wrap("right")
  5. function digg()
  6. turtle.dig()
  7. turtle.digUp()
  8. turtle.forward()
  9. if rs.getInput("bottom") == true then
  10.   n = 1
  11. end
  12. end
  13.  
  14. function getMsg()
  15.   ID, msg = rednet.receive()
  16.   if msg == "stop" then
  17.     n = 1
  18.     print("Waiting ...")
  19.   end  
  20. end
  21.  
  22. while n == nil do
  23. parallel.waitForAny(digg,getMsg)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement