Advertisement
Nonsanity

SingleCurve

Nov 4th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. os.loadAPI("tt")
  2.  
  3. curve = fs.open("curve1","r")
  4. cur = curve.readLine()
  5. x = 0
  6. y = 0
  7. for a = 1,#cur do
  8. c = string.sub(cur,a,a)
  9. if c == "F" then
  10. turtle.forward()
  11. x = x + 1
  12. end
  13. if c == "P" then turtle.placeDown() end
  14. if c == "R" then turtle.digDown() end
  15. if c == "U" then
  16. turtle.up()
  17. y = y - 1
  18. end
  19. if c == "D" then
  20. turtle.down()
  21. y = y + 1
  22. end
  23. if c == "B" then
  24. turtle.turnLeft()
  25. turtle.turnLeft()
  26. turtle.place()
  27. turtle.turnLeft()
  28. turtle.turnLeft()
  29. end
  30. tt.restock()
  31. end
  32.  
  33. turtle.turnLeft()
  34. turtle.turnLeft()
  35. for a = 1,y+1 do
  36. turtle.up()
  37. end
  38. for a = 1,x do
  39. turtle.forward()
  40. end
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnRight()
  44. turtle.down()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement