ChunLing thanks for help but no…
So I have the problem again. I used this code in my core code:
term.clear()
for l = 1,16 do
turtle.select(l)
turtle.refuel(64)
end
local num = 0 <- defined num
if turtle.getFuelLevel() == 0 then
term.setCursorPos (1,1)
print "Turtlicka nema palivo! Vloz uhlie do"
print "inventara turtlicky !"
return
end
function begin()
if turtle.getFuelLevel() > 1 then
term.setCursorPos (1,1)
print "Sirka kopania:"
term.setCursorPos (16,1)
pocetx = tonumber(read())
if pocetx > 21 then
term.clear()
term.setCursorPos (1,1)
print "Sirka kopania: "
term.setCursorPos (1,2)
print "Povolene cislo je od 1 do 20"
begin()
elseif pocetx < 1 then
term.clear()
term.setCursorPos (1,1)
print "Sirka kopania:"
term.setCursorPos (1,2)
print "Povolene cislo je od 1 do 20"
begin()
end
function begin2()
term.setCursorPos (1,1)
print "Dlzka kopania: "
term.setCursorPos (16,1)
pocety = tonumber(read())
if pocety > 41 then
term.clear()
term.setCursorPos (1,1)
print "Dlzka kopania:"
term.setCursorPos (1,2)
print "Povolene cislo je od 1 do 40"
begin2()
elseif pocety < 1 then
term.clear()
term.setCursorPos (1,1)
print "Dlzka kopania:"
term.setCursorPos (1,2)
print "Povolene cislo je od 1 do 40"
begin2()
end
end
end
end
begin()
begin2()
function koppravo()
turtle.forward()
turtle.turnRight()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
turtle.dig()
turtle.forward()
for m = 1,16 do <- Here is the code where it was used
num = num + turtle.getItemCount(m)
if num > 384 then
turtle.turnRight()
turtle.forward()
turtle.down()
while true do
turtle.forward()
if turtle.detect() == true then
for k = 1,16 do
turtle.select(k)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
return
end
end
end
end
end
function kopvlavo()
turtle.forward()
turtle.turnLeft()
turtle.digUp()
turtle.digDown()
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnLeft()
turtle.dig()
turtle.forward()
end
function kop()
term.clear()
turtle.forward()
while turtle.detect() == true or turtle.detectUp() == true or turtle.detectDown() == true do
turtle.digUp()
turtle.digDown()
turtle.dig()
end
end
function jadro()
while true do
turtle.forward()
if turtle.detect() == true then
turtle.up()
for i = 1,7 do
turtle.dig()
end
turtle.forward()
turtle.digUp()
turtle.digDown()
turtle.turnRight()
for j = 1,pocety do
for i = 1,pocetx do
kop()
end
kopvlavo()
for i = 1,pocetx do
kop()
end
koppravo()
end
turtle.turnRight()
turtle.forward()
turtle.down()
while true do
turtle.forward()
if turtle.detect() == true then
for k = 1,16 do
turtle.select(k)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
return
end
end
end
end
end
jadro()
The turtle when it turn right scroll the code:
for m = 1,16 do
num = num + turtle.getItemCount(m)
if num > 384 then
turtle.turnRight()
turtle.forward()
turtle.down()
while true do
turtle.forward()
if turtle.detect() == true then
for k = 1,16 do
turtle.select(k)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
return
end
end
end
end
And it not worked :mellow:/>