Posted 09 March 2014 - 10:21 AM
pastebin.com/TgD4BQLL
Help please
Help please
if os.pullEvent ("key",true) then -- this true here does nothing
print("am inceput")
for i=1, n do
miningadv()
--you forgot to close this for loop with an end statement.
end
Are these errors really that vauge to people, or do they just not bother anymore?
write("Cate layere vrei ? : ")
local n=read()
print("Pune in in turtle, cobblestone in slotul 13, ender chest pentru pus itemele in slotul 14, ender chest cu coal in slotul 15 si niste coal in slotul 16, apoi apasa E")
local x=turtle.getFuelLevel()
local o = 10
function getcoal()
--aia care ia coal de la un ender chest
turtle.turnRight()
o=o+1
turtle.dig()
turtle.select(15)
turtle.place()
turtle.select(16)
turtle.suck()
turtle.select(15)
turtle.dig()
turtle.turnLeft()
o=o-1
end
function refuel()
--functia care asigura ca turtle-ul are fuel
if x < 1000 then
turtle.select(16)
turtle.refuel(16)
--# we can remove the else here, since it's an empty block.
end
end
function dropitems()
--functia care da drop la iteme intr-un ender chest
turtle.turnRight()
o=o+1
turtle.select(14)
turtle.place()
for i = 1, 12 do
turtle.select(i)
turtle.drop()
end
turtle.select(14)
turtle.dig()
turtle.turnLeft()
o=o-1
end
function firstlinie()
for i = 1, 4 do
turtle.dig()
while turtle.dig(true) do
turtle.dig()
end
turtle.up()
turtle.turnLeft()
o=o-1
turtle.select(13)
turtle.place()
turtle.turnRight()
o=o+1
end
turtle.dig()
end
function liniesus()
for i = 1, 4 do
turtle.dig()
while turtle.dig(true) do
turtle.dig()
end
turtle.up()
end
turtle.dig()
end
function liniejos()
for i = 1,4 do
turtle.dig()
turtle.down()
end
turtle.dig()
end
function inapoi()
turtle.turnLeft()
o=o-1
for i = 1, 4 do
turtle.forward()
turtle.down()
end
turtle.turnRight()
o=o+1
turtle.forward()
end
function layer()
firstlinie()
for i = 1, 2 do
turtle.turnRight()
o=o+1
turtle.forward()
turtle.turnLeft()
o=o-1
liniejos()
turtle.turnRight()
o=o+1
turtle.forward()
turtle.turnLeft()
o=o-1
liniesus()
end
liniesus()
inapoi()
sleep(1)
end
function fullinv()
for i=1,12 do
if(turtle.getItemCount(i) == 0) then
return false
else
return true
end
end
end
function drop()
if fullinv(true) then
dropitems()
end
end
y = turtle.getItemCount(16)
function coal()
if y < 32 then
getcoal()
end
end
function aresume()
turtle.select(13)
turtle.placeDown()
turtle.turnLeft()
o=o-1
turtle.place()
turtle.turnRight()
o=o+1
end
function resume()
if o > 10 then
while o ~= 10 do
turtle.turnLeft()
o=o-1
end
elseif o < 10 then
while o ~= 10 do
turtle.turnRight()
o=o+1
end
end
turtle.turnLeft()
for i = 1, 5 do
turtle.forward()
end
turtle.turnRight()
for i = 1, 5 do
turtle.down()
end
end
function miningadv()
aresume()
resume()
drop()
coal()
refuel()
layer()
end
if os.pullEvent ("key",true) then
print("am inceput")
for i=1, n do
miningadv()
end