MigasRocha

Casa

Feb 19th, 2021 (edited)
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.04 KB | None | 0 0
  1. while true do
  2.  
  3. if turtle.getFuelLevel() < 500 then
  4.    turtle.select(16)
  5.    turtle.placeUp()
  6.    turtle.suckUp()
  7.    turtle.refuel()
  8.    turtle.dropUp()
  9.    turtle.digUp()
  10.    turtle.select(1)
  11.   end
  12.    
  13. local block,type = turtle.inspectDown()
  14.  
  15. if type.name == "ironchest:crystal_chest" then
  16.  if turtle.getItemSpace(1) > 0 then
  17.          print"A sugar"
  18.    turtle.suckDown()
  19.    print("turtle cheia")
  20. end
  21.        
  22. end
  23. function andar()
  24.  
  25. local block,type = turtle.inspect()
  26. while turtle.detect() == false do
  27.    turtle.forward()
  28.   end
  29. if type.name == "minecraft:spruce_log" then
  30.   turtle.turnRight()
  31.   print("encontrei o log")
  32.   end
  33.  
  34. if type.name == "minecraft:hopper" then
  35.    print"vou verificar o que tenho"
  36.   local details = turtle.getItemDetail(1)
  37.   if details.name == "minecraft:blackstone" then
  38.    blackstone()
  39.   end
  40.   if details.name == "minecraft:cobblestone" then
  41.    cobblestone()
  42.   end
  43. if details.name == "minecraft:andesite" then
  44.    andesite()
  45.   end
  46. if details.name == "minecraft:basalt" then
  47.    basalt()
  48.   end
  49. if details.name == "forbidden_arcanus:darkstone" then
  50.    darkstone()
  51.   end
  52. if details.name == "minecraft:netherrack" then
  53.    netherrack()
  54.   end
  55. if details.name == "minecraft:granite" then
  56.    granite()
  57.   end
  58.         end
  59. end
  60.  
  61. if turtle.getItemCount(1) == 64 then
  62.    andar()
  63.   end
  64.    
  65. function voltar()
  66.  print("a voltar a base")
  67.  turtle.turnRight()
  68.  turtle.turnRight()
  69.  
  70.  while turtle.detect() == false do
  71.    turtle.forward()
  72. local block,type = turtle.inspect()
  73. if type.name == "minecraft:glass" then
  74.   print("encontrei o vidro")
  75.   turtle.turnLeft()
  76.   end
  77.  end
  78. local block,type = turtle.inspect()
  79. if type.name == "minecraft:cobblestone" then
  80.   print("cheguei a base")
  81.   turtle.turnLeft()
  82.   turtle.turnLeft()
  83.     end
  84. end
  85.    
  86.  function cobblestone()    
  87. print("tenho cobblestone")
  88. local details = turtle.getItemDetail(1)
  89. if details.name == "minecraft:cobblestone" then
  90.    turtle.up()
  91.    turtle.drop()
  92.    turtle.down()
  93. if turtle.getItemSpace(1) == 64 then
  94.    voltar()
  95.   end
  96. end
  97. end
  98.   function blackstone()    
  99. print("tenho blackstone")
  100. local details = turtle.getItemDetail(1)
  101. if details.name == "minecraft:blackstone" then
  102.    turtle.up()
  103.    turtle.up()
  104.    turtle.up()
  105.    turtle.drop()
  106.    turtle.down()
  107.    turtle.down()
  108.    turtle.down()
  109. if turtle.getItemSpace(1) == 64 then
  110.    voltar()
  111.   end
  112. end
  113. end
  114. function andesite()    
  115. print("tenho andesite")
  116. local details = turtle.getItemDetail(1)
  117. if details.name == "minecraft:andesite" then
  118.    turtle.turnRight()
  119.    turtle.forward()
  120.    turtle.dropDown()
  121.    turtle.back()
  122.    turtle.turnLeft()
  123. if turtle.getItemSpace(1) == 64 then
  124.    voltar()
  125.   end
  126. end
  127. end
  128. function basalt()    
  129. print("tenho basalt")
  130. local details = turtle.getItemDetail(1)
  131. if details.name == "minecraft:basalt" then
  132.    turtle.up()
  133.    turtle.up()
  134.    turtle.forward()
  135.    turtle.forward()
  136.    turtle.forward()
  137.    turtle.dropDown()
  138.    turtle.back()
  139.    turtle.back()
  140.    turtle.back()
  141.    turtle.down()
  142.    turtle.down()
  143. if turtle.getItemSpace(1) == 64 then
  144.    voltar()
  145.   end
  146. end
  147. end
  148.  function darkstone()    
  149. print("tenho darkstone")
  150. local details = turtle.getItemDetail(1)
  151. if details.name == "forbidden_arcanus:darkstone" then
  152.    turtle.up()
  153.    turtle.up()
  154.    turtle.forward()
  155.    turtle.forward()
  156.    turtle.forward()
  157.    turtle.dropUp()
  158.    turtle.back()
  159.    turtle.back()
  160.    turtle.back()
  161.    turtle.down()
  162.    turtle.down()
  163. if turtle.getItemSpace(1) == 64 then
  164.    voltar()
  165.   end
  166. end
  167. end
  168. function netherrack()    
  169. print("tenho netherrack")
  170. local details = turtle.getItemDetail(1)
  171. if details.name == "minecraft:netherrack" then
  172.    turtle.up()
  173.    turtle.drop()
  174.    turtle.down()
  175. if turtle.getItemSpace(1) == 64 then
  176.    voltar()
  177.   end
  178. end
  179. end
  180. function granite()    
  181. print("tenho granite")
  182. local details = turtle.getItemDetail(1)
  183. if details.name == "minecraft:granite" then
  184.    turtle.turnRight()
  185.    turtle.forward()
  186.    turtle.dropDown()
  187.    turtle.back()
  188.    turtle.turnLeft()
  189. if turtle.getItemSpace(1) == 64 then
  190.    voltar()
  191.   end
  192. end
  193. end
  194. end
Add Comment
Please, Sign In to add comment