Advertisement
k_goos

TurtleActions

Apr 25th, 2013
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2.  
  3. function DropAll()
  4. print("Drop all")
  5. for i=1, 16 do
  6. turtle.dropDown()
  7. turtle.select(i)
  8. end
  9. end
  10. function PickUp()
  11. DropAll()
  12. print("Picking up...")
  13. turtle.select(1)
  14. turtle.dig()
  15. end
  16. function PlaceDown()
  17. print("Placing down...")
  18. turtle.select(1)
  19. turtle.place()
  20. end
  21.  
  22. if #args > 1 or #args < 1 then
  23. print("Invalid number of arguments.")
  24. else
  25. action = args[1]
  26. if action == "Pick" then
  27. PickUp()
  28. elseif action == "Place" then
  29. PlaceDown()
  30. elseif action == "Drop" then
  31. DropAll()
  32. else
  33. print("No valid action: Pick - Place - Drop")
  34. end
  35. end
Advertisement
RAW Paste Data Copied
Advertisement