Advertisement
Guest User

floor

a guest
Oct 30th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local tArgs = { ... }
  2. local selected_slot = 1
  3. if #tArgs < 2 then
  4. print( "Usage: floor <x> <y>" )
  5. return
  6. local x = tonumber(tArgs[1])
  7. local y = tonumber(tArgs[2])
  8. for i=1,x do
  9. turtle.select(selected_slot)
  10. for j=1,y do
  11. while turtle.getItemCount() == 0 do
  12. selected_slot++
  13. turtle.select(selected_slot)
  14. end
  15. turtle.digDown()
  16. turtle.placeDown()
  17. turtle.forward()
  18. end
  19. if flip then
  20. turtle.turnRight()
  21. turtle.forward()
  22. turtle.turnRight()
  23. flip = false
  24. else
  25. turtle.turnLeft()
  26. turtle.forward()
  27. turtle.turnLeft()
  28. flip = true
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement