local chest = peripheral.wrap("tileskychest_0")
local apiary = peripheral.wrap("right")
local pattern = peripheral.wrap("left")
local species = nil
function IsApiaryDone()
if apiary.getAllStacks()[1] == nil then
return true
else
return false
end
end
function Split(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
function GetSpecies ()
bee = pattern.getAllStacks()
if bee[1] == nil then
printError("No species bee")
error()
end
species = Split(bee[1].basic().display_name," ")[1]
end
function findWrongPrincess ()
bee = chest.getAllStacks()
for k,v in pairs(bee) do
if v.basic().id == "Forestry:beePrincessGE" then
if species ~= Split(v.basic().display_name," ")[1] then
chest.pushItem("west",k)
return
end
end
end
printError("No princess to work with")
error()
end
GetSpecies()
while true do
sleep(1)
if (IsApiaryDone()) then
findWrongPrincess ()
end
end
Comments
0 B
|👍
/👎