Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---@params is_block bool
- ---@params data table
- local function is_cluster(is_block, data)
- return is_block and data.name == 'ae2:quartz_cluster'
- end
- local running = true
- repeat
- term.clear()
- term.setCursorPos(1,1)
- if is_cluster(turtle.inspectUp()) then
- turtle.digUp()
- end
- if is_cluster(turtle.inspectDown()) then
- turtle.digDown()
- end
- for _ = 1, 4 do
- if is_cluster(turtle.inspect()) then
- turtle.dig()
- end
- turtle.turnRight()
- end
- print('Waiting...')
- os.startTimer(120)
- repeat
- local event, key = os.pullEvent()
- if event == "key" and keys.getName(key) == "a" then
- print(event)
- print('Aborting execution...')
- running = false
- end
- until event == "timer" or not running
- until not running
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement