Advertisement
Nonsanity

MultiCurve

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