Fixing wrong function calls
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user