Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grinder = peripheral.wrap("right")
- chest = peripheral.wrap("top")
- function feedFuel()
- for i,data in pairs(chest.getAllStacks()) do
- print("Looping through chest slot: "..i)
- a = chest.getStackInSlot(i)
- if a.raw_name == "item.item.ethanol" then
- print("Found Ethanol")
- if chest.pushItem("East",i,1) then
- print("Fed engine with fuel")
- end
- break
- end
- end
- end
- while true do
- os.sleep(5)
- a = grinder.printInv()
- if ( a ~= "Empty" ) then
- print("Found grinder to have something")
- a = grinder.getPower()
- if ( a == 0 ) then
- print("Grinder out of energy, feeding")
- feedFuel()
- end
- end
- end
Advertisement