Fixing wrong function calls

This commit is contained in:
sascham 2020-12-20 16:21:40 +00:00
parent 55ef03625a
commit 4b2201e544

View File

@ -25,6 +25,7 @@ while true do
if item ~= nil and item['name'] ~= 'minecraft:' .. TREE_SAPLING .. '_sapling' then
turtle.select(i)
print('Dropping ' .. item['name'] .. ' into chest.')
turtle.drop()
end
end
@ -40,7 +41,7 @@ while true do
turtle.turnLeft()
for i = 1, NUM_OF_TREES do
for j = 1, 3 do
check_fuel()
modules.check_fuel()
if i ~= 3 * NUM_OF_TREES then
turtle.dig()
end
@ -49,10 +50,10 @@ while true do
turtle.turnLeft()
blockExists, item = turtle.inspect()
if blockExists and item['name'] == 'minecraft:' .. TREE_SAPLING .. '_log' then
modules.selectEmptySlot()
modules.select_emptySlot()
shell.run('choptree.lua') -- Run Choptree
elseif blockExists and item['name'] ~= 'minecraft:' .. TREE_SAPLING .. '_sapling' then
print('Error! Wrong block')
print('Error! Wrong block. Found ' .. item['name'])
elseif not blockExists then
turtle.forward()
local success, underneath = turtle.inspectDown()
@ -61,7 +62,8 @@ while true do
turtle.back()
else
turtle.back()
modules.selectItem('minecraft:' .. TREE_SAPLING .. '_sapling')
print('Planting seed.')
modules.select_item('minecraft:' .. TREE_SAPLING .. '_sapling')
turtle.place()
end
end
@ -71,12 +73,13 @@ while true do
-- Move forward to the chest again
turtle.turnLeft()
turtle.turnLeft()
print('Heading back to chest.')
for i = 1, (3 * NUM_OF_TREES) do
check_fuel()
modules.check_fuel()
if i ~= 3 * NUM_OF_TREES then
turtle.dig()
end
turtle.foward()
turtle.forward()
end
end