Advertisement
ecco7777

CC Apiary Automation

Apr 26th, 2020
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --Apiary automation
  2. epd="down" --exportdirection
  3. wantProducts=false
  4. function wrapPs(peripheralName)
  5.     periTab = {}
  6.     sideTab = {}
  7.     if peripheralName == nil then
  8.         print("Fehler")
  9.     end
  10.     local peripherals = peripheral.getNames()
  11.     local i2 = 1
  12.     for i = 1, #peripherals do
  13.         if peripheral.getType(peripherals[i]) == peripheralName then
  14.             periTab[i2] = peripheral.wrap(peripherals[i])
  15.             sideTab[i2] = peripherals[i]
  16.             i2 = i2 + 1
  17.         end
  18.     end
  19.     if periTab ~= {} then
  20.         return periTab, sideTab
  21.     else
  22.         return nil
  23.     end
  24. end
  25.  
  26. apis=wrapPs("apiculture_0_name")
  27.  
  28. while true do
  29.     for i=1,#apis do
  30.         if apis[i].getAllStacks()[1]~=nil and wantProducts then
  31.             for i2=3,9 do
  32.                 apis[i].pushItem(epd,i2)
  33.             end
  34.         else
  35.             apis[i].condenseItems()
  36.         end
  37.     end
  38. sleep(30)
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement