Posted 26 February 2013 - 03:22 PM
[Question] A way to loop a computer to wait for bee analyzer
Hey, i've spent all night trying to figure this out but i just keep getting error after error. I am trying to make a program repeat until the condition m.isBee(true) and then, once there is a bee present in the analyzer, display the table (and i wanted to put a press any key once bee is removed, to repeat the program again) this computer is solely for use for analyzing bees and i would rather have the program repeated and automated rather than having to run for every bee inserted. Here is the code i have so far(which is one of my non working tries):
Hey, i've spent all night trying to figure this out but i just keep getting error after error. I am trying to make a program repeat until the condition m.isBee(true) and then, once there is a bee present in the analyzer, display the table (and i wanted to put a press any key once bee is removed, to repeat the program again) this computer is solely for use for analyzing bees and i would rather have the program repeated and automated rather than having to run for every bee inserted. Here is the code i have so far(which is one of my non working tries):
repeat
m = peripheral.wrap("right")
if m.Bee(true) then
data = m.analyze()
for i,v in pairs(data) do print(i.." "..tostring(v))
end
end
else if m.isBee(false) then
print("Please insert analyzed bee")
sleep(3)
end
until m.isBee(true)
end