Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- robot = require("robot")
- component = require("component")
- sides = require("sides")
- inv = component.inventory_controller
- geo = component.geolyzer
- function mine()
- robot.swingDown()
- robot.forward()
- robot.swingDown()
- robot.forward()
- robot.swingDown()
- robot.turnLeft()
- robot.forward()
- robot.swingDown()
- robot.turnLeft()
- robot.forward()
- robot.swingDown()
- robot.forward()
- robot.swingDown()
- robot.turnRight()
- robot.forward()
- robot.swingDown()
- robot.turnRight()
- robot.forward()
- robot.swingDown()
- robot.forward()
- robot.swingDown()
- robot.turnRight()
- robot.forward()
- robot.forward()
- robot.turnRight()
- robot.forward()
- robot.forward()
- robot.down()
- robot.turnRight()
- robot.turnRight()
- end
- while true do
- if robot.durability() == nil then
- print("Ошибка инструмента")
- os.exit()
- end
- slot = inv.getStackInInternalSlot(1)
- if slot == nil then
- print("Ошибка инструмента")
- os.exit()
- end
- if geo.analyze(0)["name"] == "minecraft:dirt" or geo.analyze(0)["name"] == "minecraft:grass" then
- slot = inv.getStackInInternalSlot(1)
- if slot["name"] == "minecraft:diamond_shovel" or slot["name"] == "minecraft:iron_shovel" or slot["name"] == "minecraft:stone_shovel" then
- inv.equip()
- end
- elseif geo.analyze(0)["name"] == "minecraft:bedrock" then
- print("Достигнут бедрок.")
- os.exit()
- else
- robot.select(1)
- slot = inv.getStackInInternalSlot(1)
- if slot["name"] == "minecraft:diamond_pickaxe" or slot["name"] == "minecraft:iron_pickaxe" or slot["name"] == "minecraft:stone_pickaxe" then
- inv.equip()
- end
- end
- mine()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement