-- if wat then invert check 16
local function check(wat)
 for st = 1,15 do
  turtle.select(st)
  if turtle.compareTo(16) and not wat then
   turtle.drop()
  elseif not turtle.compareTo(16) and wat then
   turtle.drop()
  end
 end
end

while true do
turtle.turnLeft()
turtle.turnLeft()
check(true) -- machine
sleep(1)
turtle.suck()
turtle.turnLeft()
turtle.turnLeft()
turtle.suck()
check(false) -- portal
turtle.suck()
end
