Posted 30 December 2012 - 02:11 AM
Hello, guys!
I com from Germany and I know my english is not so god.
I hope you anderstand what I mean.
I try to make a turtle program what mine and find all the recurcen in the strip.
I make this, but it diden't work.
I know I have no Gravel but this is a conzept.
When I run the program, the turtle mine forward and scan to recurces.
Redstone come on le Left side and the Programm stopt and say: "hMine:46: attempt to call nil"
I hope you can halp me to write my programm in the end ;)/>
LetsDark
I com from Germany and I know my english is not so god.
I hope you anderstand what I mean.
I try to make a turtle program what mine and find all the recurcen in the strip.
I make this, but it diden't work.
path = 50
local function checkFuel()
if turtle.getFuelLevel() < 20 then
turtle.select(16)
turtle.refuel(1)
end
end
local function forward()
turtle.dig()
turtle.forward()
turtle.select(1)
turtle.placeDown()
turtle.digUp()
checkFuel()
end
local function compareDown()
checkFuel()
turtle.select(1)
if not turtle.placeDown() then
turtle.select(15)
if not turtle.compareDown() then
turtle.select(14)
if not turtle.compareDown() then
turtle.select(13)
if not turtle.compareDown() then
rMineDown()
end
end
end
end
end
local function compare()
checkFuel()
turtle.select(1)
if not turtle.place() then
turtle.select(15)
if not turtle.compare() then
turtle.select(14)
if not turtle.compare() then
turtle.select(13)
if not turtle.compare() then
rMine()
end
end
end
end
end
local function compareUp()
checkFuel()
turtle.select(1)
if not turtle.placeUp() then
turtle.select(15)
if not turtle.compareUp() then
turtle.select(14)
if not turtle.compareUp() then
turtle.select(13)
if not turtle.compareUp() then
rMineUp()
end
end
end
end
end
local function rMineDown()
turtle.digDown()
turtle.down()
compare()
compareDown()
turtle.turnLeft()
turtle.compare()
turtle.turnLeft()
turtle.compare()
turtle.turnLeft()
turtle.compare()
turtle.turnLeft()
turtle.up()
end
local function rMine()
turtle.dig()
turtle.forward()
compare()
compareDown()
turtle.turnLeft()
compare()
turtle.turnRight()
turtle.turnRight()
compare()
turtle.turnLeft()
compareUp()
turtle.back()
end
local function rMineUp()
turtle.digUp()
turtle.up()
compare()
compareUp()
turtle.turnLeft()
compare()
turtle.turnLeft()
compare()
turtle.turnLeft()
compare()
turtle.turnLeft()
compare()
turtle.turnLeft()
turtle.down()
end
for i=1,path do
forward()
compareDown()
turtle.turnLeft()
compare()
turtle.turnRight()
turtle.turnRight()
compare()
turtle.turnLeft()
end
turtle.up()
compare()
compareUp()
turtle.turnLeft()
turtle.turnLeft()
for i=1,path do
turtle.forward()
compareUp()
turtle.turnLeft()
compare()
turtle.turnRight()
turtle.turnRight()
compare()
turtle.turnLeft()
end
slot 16 = coal, slot 15 = stone, slot 14 = dirt, slot 13 = cobblestone, slot 1 = cobbelstoneI know I have no Gravel but this is a conzept.
When I run the program, the turtle mine forward and scan to recurces.
Redstone come on le Left side and the Programm stopt and say: "hMine:46: attempt to call nil"
I hope you can halp me to write my programm in the end ;)/>
LetsDark