Compare commits
No commits in common. "69e0a4555a480bf8de887f82f0f5d991d2a20e1a" and "e68905578f65c9fb486a4c9f8c9dd44bad830f0c" have entirely different histories.
69e0a4555a
...
e68905578f
@ -1,103 +0,0 @@
|
||||
--[[digtunnel program from Sascha
|
||||
Dig a tunnel until bedrock]]
|
||||
|
||||
os.loadAPI('hare')
|
||||
isBedrock = false
|
||||
level = 0
|
||||
|
||||
function comming_back(distance)
|
||||
for i = 1, distance do
|
||||
turtle.up()
|
||||
end
|
||||
end
|
||||
|
||||
function dig_around()
|
||||
if is_bedrock() then
|
||||
print('Found Bedrock. Comming back')
|
||||
comming_back(level)
|
||||
error('Done')
|
||||
end
|
||||
turtle.dig()
|
||||
turtle.turnLeft()
|
||||
if is_bedrock() == true then
|
||||
print('Found Bedrock. Comming back')
|
||||
comming_back(level)
|
||||
error('Done')
|
||||
end
|
||||
turtle.dig()
|
||||
turtle.turnRight()
|
||||
turtle.turnRight()
|
||||
if is_bedrock() then
|
||||
print('Found Bedrock comming back')
|
||||
comming_back(level)
|
||||
error('done')
|
||||
end
|
||||
turtle.dig()
|
||||
turtle.turnLeft()
|
||||
end
|
||||
|
||||
function is_bedrock()
|
||||
-- Check if we have Bedrock in Front
|
||||
-- or underneath of us
|
||||
local success, item = turtle.inspect()
|
||||
if success == true and item['name'] == 'minecraft:bedrock' then
|
||||
isBedrock = true
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
local success, item = turtle.inspectDown()
|
||||
if success == true and item['name'] == 'minecraft;bedrock' then
|
||||
isBedrock = true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
while isBedrock == false do
|
||||
-- Dig one level down
|
||||
if is_bedrock() then
|
||||
print('Found Bedrock. Comming back')
|
||||
comming_back(level)
|
||||
error('Done')
|
||||
end
|
||||
turtle.digDown()
|
||||
turtle.down()
|
||||
level = level + 1
|
||||
|
||||
-- Dig a 3x3 Tunnel
|
||||
dig_around()
|
||||
turtle.forward()
|
||||
dig_around()
|
||||
turtle.forward()
|
||||
turtle.turnLeft()
|
||||
if is_bedrock() then
|
||||
print('Found Bedrock. Comming back')
|
||||
comming_back(level)
|
||||
error('Done')
|
||||
end
|
||||
turtle.dig()
|
||||
turtle.turnRight()
|
||||
turtle.turnRight()
|
||||
if is_bedrock() then
|
||||
print('Found Bedrock. Comming back')
|
||||
comming_back(level)
|
||||
error('Done')
|
||||
end
|
||||
turtle.dig()
|
||||
turtle.turnLeft()
|
||||
|
||||
-- place a ladder
|
||||
local success, item = turtle.inspect()
|
||||
if not success then
|
||||
hare.selectItem('minecraft:cobblestone')
|
||||
turtle.place()
|
||||
end
|
||||
turtle.back()
|
||||
hare.selectItem('minecraft:ladder')
|
||||
turtle.place()
|
||||
hare.selectEmptySlot()
|
||||
-- Go back to Start Position
|
||||
turtle.back()
|
||||
end
|
||||
|
@ -195,28 +195,3 @@ function findBlock(name)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- puke() puke everything that is in the turtles
|
||||
-- inventory out in front of it (hopefully there is
|
||||
-- a chest
|
||||
function puke()
|
||||
for i = 1, 16 do
|
||||
turtle.select(i)
|
||||
turtle.drop()
|
||||
end
|
||||
end
|
||||
|
||||
-- Check Fuel checks if the turtle has enough fuel.
|
||||
-- if not, it asks for fuel in slot 1 and refuels.
|
||||
function check_fuel()
|
||||
local refueled = false
|
||||
while not refueled do
|
||||
if turtle.getFuelLevel() == 0 then
|
||||
print("Fuel is empty. Please put fuel in slot 1 and press a key.")
|
||||
read()
|
||||
turtle.select(1)
|
||||
turtle.refuel()
|
||||
else
|
||||
refueled = true
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user