Advertisement
poboivin

GetFace

Oct 3rd, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. local oldx,oldy,oldz = shell.run(GetPos())
  2. shell.run(GoForward(1))
  3. shell.run(GetPos())
  4. print("check direction")
  5.  
  6. if cx > oldx then
  7. currentFacing = 3
  8. return 3
  9. elseif cx < oldx then
  10. currentFacing = 1
  11. return 1
  12. elseif cy > oldy then
  13. currentFacing = 0
  14. return 0
  15. else
  16. currentFacing = 2
  17. return 2
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement