Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local signalChest = peripheral.wrap("left")
- local starChest = peripheral.wrap("top")
- local direction = "east"
- local generator = peripheral.wrap("generatorfurnace_0")
- function findSignal()
- if signalChest.getStackInSlot(1) ~= nil then
- --print ("got signal, time to work")
- return true
- else
- print("no signal, keep looking")
- return false
- end
- end
- function feedGenerator()
- if findSignal() then
- print ("got signal, time to work")
- rs.setOutput("right", false)
- if generator.getStackInSlot(1) == nil then
- print(starChest.pushItemIntoSlot(direction,1,1,1))
- else
- print("already have star in the generator")
- end
- else
- rs.setOutput("right", true)
- --generator.pushItemIntoSlot("west",1,1,1)
- print("signal ended, clearing generator")
- end
- end
- while true do
- feedGenerator()
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement