Advertisement
TheProdigy22

Untitled

Mar 13th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. local bpFile = fs.open(shell.resolve(args[1]))
  2.  
  3. local blueprint = textutils.deserialize(bpFile.readAll())
  4.  
  5. print("Please put materials in the following slots:")
  6. for i=1,#blueprint.slots do
  7. print(i..". "..blueprint.slots[i].name..": "..blueprint.slots[i].count)
  8. end
  9. print("Press enter to start...")
  10. read()
  11.  
  12. local i = 1
  13. local right = true
  14. for h=1,blueprint.h do
  15. turtle.up()
  16. for y=1,blueprint.y do
  17. for x=1,blueprint.x do
  18. if(blueprint.tcode[i] > 0) then
  19. turtle.select(blueprint.tcode[i])
  20. turtle.placeDown()
  21. end
  22. if x < blueprint.x then
  23. turtle.forward()
  24. end
  25. i = i + 1
  26. end
  27. if y < blueprint.y then
  28. if right then
  29. turtle.turnRight()
  30. turtle.forward()
  31. turtle.turnRight()
  32. right = false
  33. else
  34. turtle.turnLeft()
  35. turtle.forward()
  36. turtle.turnLeft()
  37. right = true
  38. end
  39. end
  40. end
  41. turtle.turnRight()
  42. turtle.turnRight()
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement