Advertisement
Hakai69

AE2 Cluster Farming

May 15th, 2024 (edited)
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | Gaming | 0 0
  1. ---@params is_block bool
  2. ---@params data table
  3. local function is_cluster(is_block, data)
  4.     return is_block and data.name == 'ae2:quartz_cluster'
  5. end
  6.  
  7. local running = true
  8. repeat
  9.     term.clear()
  10.     term.setCursorPos(1,1)
  11.     if is_cluster(turtle.inspectUp()) then
  12.         turtle.digUp()
  13.     end
  14.     if is_cluster(turtle.inspectDown()) then
  15.         turtle.digDown()
  16.     end
  17.     for _ = 1, 4 do
  18.         if is_cluster(turtle.inspect()) then
  19.             turtle.dig()
  20.         end
  21.         turtle.turnRight()
  22.     end
  23.     print('Waiting...')
  24.     os.startTimer(120)
  25.  
  26.     repeat
  27.         local event, key = os.pullEvent()
  28.         if event == "key" and keys.getName(key) == "a" then
  29.             print(event)
  30.             print('Aborting execution...')
  31.             running = false
  32.         end
  33.     until event == "timer" or not running
  34. until not running
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement