MigasRocha

Botania Living Rock

Mar 16th, 2025
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.33 KB | Gaming | 0 0
  1. x = 0
  2.  
  3. local function getRealTime()
  4.     local time = os.date("*t")
  5.     return time
  6. end
  7.  
  8. function reffil()
  9.  
  10.     if turtle.getItemCount(1) == 0 then
  11.         turtle.select(15)
  12.         turtle.placeUp()
  13.         turtle.select(1)
  14.         turtle.suckUp(64)
  15.         turtle.select(15)
  16.         turtle.digUp()
  17.         turtle.select(1)
  18.     end
  19. end
  20.  
  21. function deposit()
  22.  
  23.     if turtle.getItemCount(2) == 64 then
  24.         turtle.select(16)
  25.         turtle.placeUp()
  26.         turtle.select(2)
  27.         turtle.dropUp(64)
  28.         turtle.select(16)
  29.         turtle.digUp()
  30.         turtle.select(1)
  31.     end
  32. end
  33.  
  34.  
  35. function check()
  36.  
  37.     local checkBelow, data = turtle.inspectDown()
  38.      
  39.     if checkBelow == true then
  40.  
  41.         if data.name == "botania:livingrock" then
  42.             turtle.select(2)
  43.             turtle.digDown()
  44.             turtle.select(1)
  45.             turtle.placeDown()
  46.             reffil()
  47.             deposit()
  48.                
  49.         end
  50.     end  
  51. end
  52.  
  53.  
  54. function pathLeft()
  55.  
  56.    
  57.     turtle.forward()
  58.     check()
  59.     turtle.turnLeft()
  60.     turtle.forward()
  61.     check()
  62.     turtle.forward()
  63.     check()
  64.     turtle.turnLeft()
  65.     turtle.forward()
  66.     check()
  67.     turtle.forward()
  68.     check()
  69.     turtle.turnLeft()
  70.     turtle.forward()
  71.     check()
  72.     turtle.forward()
  73.     check()
  74.     turtle.turnLeft()
  75.     turtle.forward()
  76.    
  77.         sleep(1)
  78.         x = 1
  79. end
  80.  
  81. function pathRight()
  82.  
  83.     check()
  84.     turtle.forward()
  85.     check()
  86.     turtle.turnRight()
  87.     turtle.forward()
  88.     check()
  89.     turtle.forward()
  90.     check()
  91.     turtle.turnRight()
  92.     turtle.forward()
  93.     check()
  94.     turtle.forward()
  95.     check()
  96.     turtle.turnRight()
  97.     turtle.forward()
  98.     check()
  99.     turtle.forward()
  100.     check()
  101.     turtle.turnRight()
  102.     turtle.forward()
  103.     check()
  104.         sleep(1)
  105.         x = 0
  106. end
  107.  
  108.     while true do
  109.  
  110.             if x == 1 then
  111.                 pathRight()
  112.                 reffil()
  113.                 deposit()
  114.                 sleep(1)
  115.             else
  116.                 pathLeft()
  117.                 reffil()
  118.                 deposit()
  119.                 sleep(1)
  120.             end
  121.  
  122.             local currentTime = getRealTime()
  123.                
  124.             if currentTime.hour == 04 and currentTime.min >= 50 then
  125.                 sleep(5000)
  126.             end
  127.     end
Add Comment
Please, Sign In to add comment