Advertisement
rl2014

move.lua

May 20th, 2021 (edited)
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. if not turtle then
  2.     return error("Must be a turtle to use the Move API.")
  3. end
  4.  
  5. function turtle.go(num)
  6.     for i = 1, num, 1 do
  7.         turtle.forward()
  8.     end
  9. end
  10.  
  11. function turtle.goBack(num)
  12.     for i = 1, num, 1 do
  13.         turtle.back()
  14.     end
  15. end
  16.  
  17. function turtle.goRight(num)
  18.     turtle.turnRight()
  19.     turtle.go(num)
  20. end
  21.  
  22. function turtle.goLeft(num)
  23.     turtle.turnLeft()
  24.     turtle.go(num)
  25. end
  26.  
  27. function turtle.goUp(num)
  28.     for i = 1, num, 1 do
  29.         turtle.up()
  30.     end
  31. end
  32.  
  33. function turtle.goDown(num)
  34.     for i = 1, num, 1 do
  35.         turtle.down()
  36.     end
  37. end
  38.  
  39. function turtle.turnAround()
  40.     turtle.turnRight()
  41.     turtle.turnRight()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement