Sivarias

CC_turtle_!wall

Oct 17th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. --!wall
  2. --This is an accompaniment of !floor that wraps a room in walls
  3. print("How far forward boss?")
  4. local x=tonumber(read())-1
  5. print("How far across boss?")
  6. local y=tonumber(read())-1
  7. print("How far up boss?")
  8. local z=tonumber(read())
  9. print("Left or Right boss? (L/R)")
  10. local dir=read()
  11. if dir=="L" or dir=="l" then
  12. dir="L"
  13. elseif dir=="R" or dir=="r" then
  14. dir="R"
  15. end
  16. a=1
  17. if (2*x+2*y)*z+z<=turtle.getFuelLevel() then
  18. for k=1, z do
  19. t.up()
  20. for c=1, 2 do
  21. for i=1, x do
  22. if turtle.getItemCount(a)==0 then
  23. a=a+1
  24. elseif a==16 and turtle.getItemCount(a)==0 then
  25. break
  26. end
  27. turtle.select(a)
  28. turtle.placeDown(a)
  29. t.forward()
  30. if i==x then
  31. if dir=="R" then
  32. t.right()
  33. elseif dir=="L" then
  34. t.left()
  35. end
  36. end
  37. end
  38. for j=1, y do
  39. if turtle.getItemCount(a)==0 then
  40. a=a+1
  41. elseif a==16 and turtle.getItemCount(a)==0 then
  42. break
  43. end
  44. turtle.select(a)
  45. turtle.placeDown(a)
  46. t.forward()
  47. if j==y then
  48. if dir=="R" then
  49. t.right()
  50. elseif dir=="L" then
  51. t.left()
  52. end
  53. end
  54. end
  55. end
  56. if k==z then
  57. if dir=="L" then
  58. t.left()
  59. t.forward()
  60. t.right()
  61. t.forward()
  62. elseif dir=="R" then
  63. t.right()
  64. t.forward()
  65. t.left()
  66. t.forward()
  67. end
  68. t.down(z)
  69. end
  70. end
  71. else
  72. print("Not enough fuel! Shutting Down Now!")
  73. end
Advertisement
Add Comment
Please, Sign In to add comment