Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chest = peripheral.wrap("top")
- ino = peripheral.wrap("right")
- function getNew()
- newSerum = 0
- while newSerum == 0 do
- chestSize = chest.getSizeInventory()
- for slot = 0, chestSize do
- chestSerum = chest.getStackInSlot(slot)
- if chestSerum then
- if serum.name == chestSerum.name then
- chest.push("up", slot, 1)
- print("Got new "..serum.name.." serum")
- newSerum = 1
- break
- end
- else
- break
- end
- end
- sleep(10)
- end
- end
- function refill()
- ino.push("east", 15, 1)
- print("refilling "..serum.name)
- end
- function checkSerum()
- serum = ino.getStackInSlot(15)
- if serum then
- print(serum.dmg)
- if serum.dmg == 16 then
- refill()
- getNew()
- end
- end
- end
- -----------
- while true do
- checkSerum()
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement