From 4b2201e544d91df80ee1cc04c8407f4763ec8c67 Mon Sep 17 00:00:00 2001 From: sascham Date: Sun, 20 Dec 2020 16:21:40 +0000 Subject: [PATCH] Fixing wrong function calls --- Tree_Farm/farmtree.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Tree_Farm/farmtree.lua b/Tree_Farm/farmtree.lua index 77da42e..f3aed65 100644 --- a/Tree_Farm/farmtree.lua +++ b/Tree_Farm/farmtree.lua @@ -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