Advertisement
ItsGynoDa

RoomIT.lua

Oct 1st, 2021 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. print("Quanto profonda vuoi fare la stanza?")
  2. print("")
  3. a = tonumber(read()-1)
  4. read()
  5. print("Quanto larga vuoi fare la stanza?")
  6. print("")
  7. b = tonumber(read()-1)
  8. read()
  9. print("Quanto alta vuoi fare la stanza?")
  10. print("")
  11. c = tonumber(read()-1)
  12. read()
  13.  
  14. function up()
  15.     turtle.dig()
  16.     turtle.forward()
  17.     for i=c,1,-1 do
  18.         turtle.digUp()
  19.         turtle.up()
  20.     end
  21. end
  22.  
  23. function deep()
  24.     for i=a,1,-1 do
  25.         turtle.dig()
  26.         turtle.forward()
  27.     end
  28. end
  29.  
  30. function wide()
  31.     turtle.turnRight()
  32.     for i=b,1,-1 do
  33.         turtle.dig()
  34.         turtle.forward()
  35.     end
  36.     turtle.turnRight()
  37. end
  38.  
  39. function pane()
  40.     for i=a,1,-1 do
  41.         turtle.dig()
  42.         turtle.forward()
  43.     end
  44.     turtle.turnRight()
  45.     turtle.dig()
  46.     turtle.forward()
  47.     turtle.turnRight()
  48.     for i=a,1,-1 do
  49.         turtle.dig()
  50.         turtle.forward()
  51.     end
  52.     turtle.turnLeft()
  53.     turtle.dig()
  54.     turtle.forward()
  55.     turtle.turnLeft()
  56. end
  57.  
  58. function tall()
  59.     for i=(a+1)/2,1,-1 do
  60.        pane()
  61.     end
  62.  
  63.     for i=a,1,-1 do
  64.         turtle.dig()
  65.         turtle.forward()
  66.     end
  67.     if turtle.detectDown() then
  68.         turtle.turnRight()
  69.         turtle.forward()
  70.         turtle.turnRight()
  71.         for i=a,1,-1 do
  72.             turtle.dig()
  73.             turtle.forward()
  74.         end
  75.         turtle.turnLeft()
  76.         turtle.turnLeft()
  77.         for i=a,1,-1 do
  78.             turtle.dig()
  79.             turtle.forward()
  80.         end
  81.         turtle.turnRight()
  82.         turtle.turnRight()
  83.         turtle.down()
  84.     else
  85.         turtle.down()
  86.         turtle.turnRight()
  87.         turtle.turnRight()
  88.     end
  89. end
  90.  
  91. up()
  92. for i=c,1,-1 do
  93. deep()
  94. wide()
  95. tall()
  96. end
  97. turtle.turnRight()
  98. turtle.turnRight()
  99. turtle.drop(all)
  100. turtle.select(2)
  101. turtle.drop(all)
  102. turtle.select(3)
  103. turtle.drop(all)
  104. turtle.select(4)
  105. turtle.drop(all)
  106. turtle.select(5)
  107. turtle.drop(all)
  108. turtle.select(6)
  109. turtle.drop(all)
  110. turtle.select(7)
  111. turtle.drop(all)
  112. turtle.select(8)
  113. turtle.drop(all)
  114. turtle.select(9)
  115. turtle.drop(all)
  116. turtle.select(10)
  117. turtle.drop(all)
  118. turtle.select(11)
  119. turtle.drop(all)
  120. turtle.select(12)
  121. turtle.drop(all)
  122. turtle.select(13)
  123. turtle.drop(all)
  124. turtle.select(14)
  125. turtle.drop(all)
  126. turtle.select(15)
  127. turtle.drop(all)
  128. turtle.select(16)
  129. turtle.drop(all)
  130. turtle.select(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement