Advertisement
Guest User

Meme

a guest
Mar 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. side = "right"
  2. rednet.open(side)
  3. while true do
  4. print("Listening for a message...")
  5. local id, message = rednet.receive()
  6.  
  7. -- print info about command and who sent it
  8. write("Recieved command: ")
  9. write(message)
  10. write(" From: ")
  11. print(id)
  12.  
  13. -- quit if they want to quit
  14. if message == "quit" then
  15. break
  16. -- run if they type run
  17. elseif message == "mine" then
  18. print("Mining a column!")
  19.  
  20. -- do the minging down
  21. local downCount = 0
  22. while downCount < 99 do
  23. if turtle.getFuelLevel() < 10 then
  24. turtle.refuel()
  25. end
  26. turtle.digDown()
  27. if turtle.down() then
  28. downCount = downCount + 1
  29. end
  30.  
  31. -- come back to the top
  32. for i=0,99 do
  33. turtle.up()
  34. end
  35.  
  36. -- move forward 4 blocks
  37. local count = 0
  38. while count ~= 2 do
  39. if turtle.forward() then
  40. count = count + 1
  41. end
  42. end
  43.  
  44. -- invalid command otherwise
  45. else
  46. print("Invalid command!")
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement