Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checks = 0
- function checkWanted()
- success, data = turtle.inspect()
- if data.name == "minecraft:diamond_ore" or data.name == "minecraft:redstone_ore" or data.name == "minecraft:iron_ore" or data.name == "minecraft:coal_ore" or data.name == "minecraft:gold_ore" or data.name == "minecraft:lapis_ore" then
- print("I found ", data.name, "!")
- return true
- end
- end
- function checkWantedUp()
- success, data = turtle.inspectUp()
- if data.name == "minecraft:diamond_ore" or data.name == "minecraft:redstone_ore" or data.name == "minecraft:iron_ore" or data.name == "minecraft:coal_ore" or data.name == "minecraft:gold_ore" or data.name == "minecraft:lapis_ore" then
- print("I found ", data.name, "!")
- return true
- end
- end
- function checkWantedDown()
- success, data = turtle.inspectDown()
- if data.name == "minecraft:diamond_ore" or data.name == "minecraft:redstone_ore" or data.name == "minecraft:iron_ore" or data.name == "minecraft:coal_ore" or data.name == "minecraft:gold_ore" or data.name == "minecraft:lapis_ore" then
- print("I found ", data.name, "!")
- return true
- end
- end
- function checkLavaCheck()
- success, data = turtle.inspect()
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- return true
- end
- end
- function checkLavaCheckUp()
- success, data = turtle.inspectUp()
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- if y == h - 1 then
- return true
- end
- end
- end
- function checkLavaCheckDown()
- success, data = turtle.inspectDown()
- if data.name == "minecraft:lava" or data.name == "minecraft:flowing_lava" then
- if y == 0 then
- return true
- end
- end
- end
- function check()
- print("I'm gonna check for some ore and lava!")
- print("Checking in front of me!")
- if checkWanted() then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- checks = checks + 1
- check()
- turtle.back()
- checks = checks - 1
- end
- if checkLavaCheck() then
- print("I found some in front of me!")
- turtle.select(16)
- turtle.place()
- turtle.refuel()
- print("My fuel level is at ", turtle.getFuelLevel(), ".")
- end
- print("Checking to my left!")
- turtle.turnLeft()
- if checkWanted() then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- checks = checks + 1
- check()
- turtle.back()
- checks = checks - 1
- end
- if checkLavaCheck() then
- print("I found some to my left!")
- turtle.select(16)
- turtle.place()
- turtle.refuel()
- print("My fuel level is at ", turtle.getFuelLevel(), ".")
- if checks == 0 then
- turtle.select(2)
- turtle.place()
- end
- end
- print("Checking to my right!")
- turtle.turnRight()
- turtle.turnRight()
- if checkWanted() then
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- checks = checks + 1
- check()
- turtle.back()
- checks = checks - 1
- end
- if checkLavaCheck() then
- print("I found some to my right!")
- turtle.select(16)
- turtle.place()
- turtle.refuel()
- print("My fuel level is at ", turtle.getFuelLevel(), ".")
- if checks == 0 then
- turtle.select(2)
- turtle.place()
- end
- end
- turtle.turnLeft()
- print("Checking above me!")
- if checkWantedUp() then
- turtle.digUp()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.up()
- checks = checks + 1
- check()
- turtle.down()
- checks = checks - 1
- end
- if checkLavaCheckUp() then
- print("I found some above me!")
- turtle.select(16)
- turtle.placeUp()
- turtle.refuel()
- print("My fuel level is at ", turtle.getFuelLevel(), ".")
- end
- print("Checking below me!")
- if checkWantedDown() then
- turtle.digDown()
- turtle.down()
- checks = checks + 1
- check()
- turtle.up()
- checks = checks - 1
- end
- if checkLavaCheckDown() then
- print("I found some below me!")
- turtle.select(16)
- turtle.placeDown()
- turtle.refuel()
- print("My fuel level is at ", turtle.getFuelLevel(), ".")
- end
- end
- print("+------------------------+")
- print(" ID = ", os.getComputerID())
- print("+------------------------+")
- print("| Modem Side = ? |")
- print("+------------------------+")
- side = tostring(read())
- rednet.open(side)
- turtle.select(16)
- while true do
- turtle.refuel()
- print("My fuel level is ", turtle.getFuelLevel())
- local id, message = rednet.receive()
- if message == "forward" then
- turtle.forward()
- end
- if message == "back" then
- turtle.back()
- end
- if message == "up" then
- turtle.up()
- end
- if message == "down" then
- turtle.down()
- end
- if message == "left" then
- turtle.turnLeft()
- end
- if message == "right" then
- turtle.turnRight()
- end
- if message == "suck" then
- turtle.placeDown()
- end
- if message == "check" then
- check()
- end
- if message == "dig" then
- turtle.dig()
- end
- if message == "digUp" then
- turtle.digUp()
- end
- if message == "digDown" then
- turtle.digDown()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement