Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local interfaceDir = "down"
- local beeDir = {"front", "right", "back", "left"}
- local bee = {}
- for i=1,4 do
- bee[i] = peripheral.wrap(beeDir[i])
- end
- -- pull princess and drone from interface
- local function fillApiary(apiary)
- local result = 0
- -- princess in slot 1 in apiary and interface
- result = apiary.pullItemIntoSlot(interfaceDir, 1, 1, 1)
- if result==0 then result=apiary.pullItemIntoSlot(interfaceDir,3,1,1) end
- -- drone in slot 2
- result = result * apiary.pullItemIntoSlot(interfaceDir, 2, 1, 2)
- if result==1 then return true
- else return false end
- end
- --local function checkQueen(apiary)
- -- local queen = apiary.getQueen()
- -- return queen
- --end
- local function getApiaryProducts(apiary)
- local result = 0
- for i=3,9 do
- result = result + apiary.pushItem(interfaceDir,i,64)
- end
- return result
- end
- -- main :)
- local fill = true
- while true do
- for i=1,4 do
- --check apiaries
- if not bee[i].getQueen() then
- print(getApiaryProducts(bee[i]))
- fill = fillApiary(bee[i])
- if not fill then break end
- end
- end
- if not fill then break end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment