TehNoiseBomb_

ComputerCraft 1.75 - 9x9 Farming - nextRow

Apr 13th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. --@Author: Zach Combs aka TehNoiseBomb
  2. --@Version: 1.1
  3.  
  4. local inputs = {...}
  5. local east = ... --boolean flag passed into the function determining if the turtle is facing east(true) or west(false)
  6.  
  7. --This code is mostly self-explanatory
  8. --The turtle will move right one row when facing east and left one row when facing west
  9. if east then
  10.  print("Moving to next row... (EAST)")
  11.  turtle.turnRight()
  12.  turtle.forward()
  13.  turtle.turnRight()
  14. else
  15.  print("Moving to next row... (WEST)")
  16.  turtle.turnLeft()
  17.  turtle.forward()
  18.  turtle.turnLeft()
  19. end
  20.  
  21. --Return the opposite of the east flag
  22. return not east
Add Comment
Please, Sign In to add comment