Posted 27 December 2012 - 06:13 AM
right now i have this:
local function compare()
turtle.select(2)
a = turtle.compare()
turtle.select(3)
b = turtle.compare()
turtle.select(4)
c = turtle.compare()
turtle.select(5)
d = turtle.compare()
turtle.select(6)
e = turtle.compare()
end
local function block()
compare()
while a or b or c or d or e do
turtle.dig()
compare()
end
end
local function row()
for i=1,2 do
block()
turtle.up()
end
block()
turtle.down()
turtle.down()
end
local function section()
for i=1,2 do
row()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
end
row()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight()
end
for i=1,5 do
section()
turtle.forward()
end
and what i want to do is to add a return function by counting how many sections it made and to make it do it if it encounters any ore, or even better do go around the ore and keep going, not sure if it is possible
local function compare()
turtle.select(2)
a = turtle.compare()
turtle.select(3)
b = turtle.compare()
turtle.select(4)
c = turtle.compare()
turtle.select(5)
d = turtle.compare()
turtle.select(6)
e = turtle.compare()
end
local function block()
compare()
while a or b or c or d or e do
turtle.dig()
compare()
end
end
local function row()
for i=1,2 do
block()
turtle.up()
end
block()
turtle.down()
turtle.down()
end
local function section()
for i=1,2 do
row()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
end
row()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnRight()
end
for i=1,5 do
section()
turtle.forward()
end
and what i want to do is to add a return function by counting how many sections it made and to make it do it if it encounters any ore, or even better do go around the ore and keep going, not sure if it is possible