Jappards

movement API

Jun 1st, 2013 (edited)
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. function version()
  2.  print("1.0.0.0")
  3. end
  4.  
  5. function turn(direction,times)
  6.  if direction == "right" then
  7.   for i=1,times[1] do
  8.    turtle.turnRight()
  9.   end
  10.  if direction == "left" then
  11.   for i=1,times[1] then
  12.    turtle.turnleft()
  13.   end
  14.  end
  15. end
  16.  
  17. function move(direction,times)
  18.  if direction == "forward" then
  19.   for i=1,times[1] do
  20.    turtle.forward()
  21.   end
  22. if direction == "back" then
  23.   for i=1,times[1] do
  24.    turtle.back()
  25.   end
  26. if direction == "right" then
  27.   turtle.turnRight()
  28.   for i=1,times[1] do
  29.    turtle.forward()
  30.   end
  31.   turtle.turnLeft()
  32. end
  33. if direction == "left" then
  34.   turtle.turnLeft()
  35.   for i=1,times[1] do
  36.    turtle.turnLeft()
  37.   end
  38.   turtle.turnRight()
  39. end
  40. end
  41. if direction == "up" then
  42. for i=1,times[1] do
  43.   turtle.up()
  44. end
  45. end
  46. if direction == "down" then
  47.  for i=1,times[1] do
  48.   turtle.down()
  49.  end
  50. end
  51. end
Add Comment
Please, Sign In to add comment