View difference between Paste ID: wR8gakDX and YCbpmWRU
SHOW: | | - or go back to the newest paste.
1-
local JSON = (loadfile "JSON.lua")()
1+
2-
JSON.strictTypes = true
2+
3-
redstone.setOutput("left", true)
3+
4
function feedFuel()
5
  for i,data in pairs(chest.getAllStacks()) do
6
    print("Looping through chest slot: "..i)
7
    a = chest.getStackInSlot(i)
8
    if a.raw_name == "item.item.ethanol" then
9
      print("Found Ethanol")
10
      if chest.pushItem("East",i,1) then
11
        print("Fed engine with fuel")
12
      end
13
      break
14
    end
15
  end  
16
end
17
18
19
while true do
20
  os.sleep(5)
21
  a = grinder.printInv()
22
  if ( a ~= "Empty" ) then
23
    print("Found grinder to have something")
24
    a = grinder.getPower()
25
    if ( a == 0 ) then
26
      print("Grinder out of energy, feeding")
27
      feedFuel()
28
    end
29
  end
30
end