Advertisement
Guest User

startup

a guest
Apr 24th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | None | 0 0
  1. diam_room = 15
  2.  
  3.  
  4. function InspectBlockDown()
  5.     --local success
  6.   local success , data = turtle.inspectDown()
  7.   if success then
  8.     --turtle.inspectDown()
  9.     print("block :", data.name)
  10.   else
  11.     print("Vide")
  12.   end
  13.  
  14.   if data.name=="minecraft:chest" then
  15.     print("chest - Press return")
  16.     read()
  17.  
  18.   end
  19.  
  20. end
  21.  
  22. function InspectBlocksAround()
  23.   for i=1,3 do
  24.     local success , data = turtle.inspect()
  25.     if success then
  26.       print("front block :", data.name)
  27.     else
  28.       print("block Vide")
  29.  
  30.       local data = turtle.getItemDetail(2)
  31.  
  32.  
  33.       if data then
  34.         print("Item name: ", data.name)
  35.       else
  36.         print("Slot Empty")
  37.       end
  38.       print(turtle.select(2))
  39.       print(turtle.place())
  40.     end
  41.  
  42.     if data.name=="minecraft:chest" then
  43.       print("chest - Press return")
  44.       read()
  45.  
  46.     end
  47.     turtle.turnRight()
  48.  
  49.   end
  50.  
  51. end
  52.  
  53. function CheckFrontBlock()
  54.   local success , data = turtle.inspect()
  55.   if success then
  56.     print("front block :", data.name)
  57.   else
  58.     print("block Vide")
  59.   end
  60.  
  61.   if data.name=="minecraft:chest" then
  62.     print("chest - Press return")
  63.     read()
  64.  
  65.   end
  66. end
  67.  
  68.  
  69. for i=1,5 do
  70.  
  71.   InspectBlockDown()
  72.  
  73.   turtle.digDown()
  74.   turtle.down()
  75.   --print("dd "..tostring(i))
  76.  
  77. end
  78.  
  79. InspectBlocksAround()
  80.  
  81. for i=1,4 do
  82.   print(i)
  83.   for i=1,diam_room-1 do    
  84.     print(i)
  85.     CheckFrontBlock()
  86.     turtle.dig()
  87.     turtle.forward()
  88.   end
  89.   turtle.turnLeft()
  90.  
  91.  
  92. end
  93.  
  94. turtle.turnRight()
  95.  
  96. for j=1,5 do
  97.   turtle.up()
  98.   --print("up "..tostring(j))
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement