DPG-mattcow12

Bee2 - beeAPI example

Jun 26th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. os.loadAPI("beeAPI") -- this imports the api
  2. function sort()
  3.     if beeAPI.isAnalyzedBee() then -- checks if it is an analyzed bee (or a bee at all)
  4.         print(beeAPI.getType()) -- prints type in chat for loging and debugging
  5.         print(beeAPI.getPrimarySpecies() .. " - " .. beeAPI.getSecondarySpecies())-- prints species in
  6.                                         -- chat for loging and debugging
  7.         if beeAPI.isPure() then -- checks if it is a pure bee
  8.             turtle.suckDown()
  9.             turtle.turnLeft()
  10.             turtle.drop()
  11.             turtle.turnRight()
  12.         else
  13.             turtle.suckDown()
  14.             turtle.turnRight()
  15.             turtle.drop()
  16.             turtle.turnLeft()
  17.         end
  18.     else
  19.         turtle.suckDown()
  20.         turtle.turnLeft()
  21.         turtle.turnLeft()
  22.         turtle.drop()
  23.         turtle.turnRight()
  24.         turtle.turnRight()
  25.     end
  26. end
  27. while true do
  28.     if turtle.suck() then -- trys to pull an itemStack from the chest in front of it
  29.         turtle.dropDown() -- drops bee in the bee analyzer
  30.         sleep(0.25)
  31.         sort() -- function above
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment