Kingdaro

turtle destination bombing

Oct 8th, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. local args = {
  2.   ...
  3. }
  4. if not #args == 3 then
  5.   print('Usage: bomb <x> <y> <z>')
  6. end
  7. local x, y, z = tonumber(args[1]), tonumber(args[2]), tonumber(args[3])
  8. for i = 1, x do
  9.   turtle.forward()
  10. end
  11. for i = 1, y do
  12.   turtle.up()
  13. end
  14. if z < 0 then
  15.   turtle.turnLeft()
  16. else
  17.   turtle.turnRight()
  18. end
  19. for i = 1, z do
  20.   turtle.forward()
  21. end
  22. rs.setOutput('bottom', true)
  23. turtle.select(1)
  24. turtle.placeDown()
  25. turtle.turnLeft()
  26. turtle.turnLeft()
  27. for i = 1, z do
  28.   turtle.forward()
  29. end
  30. if z < 0 then
  31.   turtle.turnRight()
  32. else
  33.   turtle.turnLeft()
  34. end
  35. for i = 1, y do
  36.   turtle.down()
  37. end
  38. for i = 1, x do
  39.   turtle.forward()
  40. end
  41. turtle.turnRight()
  42. turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment