View difference between Paste ID: bjywCjsw and SQ8pe4xa
SHOW: | | - or go back to the newest paste.
1-
1+
2
fuels = 16
3
if #args ~= 1 then
4
  print( "Usage: ref <param1>" )
5
  print( "-------------------" )
6
  print( "Will suck from inventory in front and place back." )
7
  print( "Like the empty bucket after slurping lava..." )
8
else
9
  if not turtle.getItemCount(fuels) > 0 then
10
	print("Sorry, slot " .. fuels .. " has something in it.")
11
	return
12
  end
13
  times = tonumber(args[1])
14
  for i=1,args[1] do
15
	turtle.select(fuels)
16
 if	not turtle.suck() then
17
   print("nothing found")
18
   return
19
 else
20
   turtle.select(fuels)
21
   turtle.refuel()
22
   turtle.select(fuels)
23
    if turtle.getItemCount(fuels) > 0 then
24
      if not turtle.place() then
25
        print("Cant place item back")
26
        return
27
      end
28
    end
29
 end
30
 end
31
end