This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
totalLoss's profile picture

Bee Analyzer program help

Started by totalLoss, 12 February 2013 - 02:46 PM
totalLoss #1
Posted 12 February 2013 - 03:46 PM
Title: Bee Analyzer program help

I keep getting an error when running the program Analyze:
bios:338: [string "analyze"]:4 '=' or 'in' expected

I have a bee analyzer under the Advanced CPU
Here is the analyze program:

m = peripheral.wrap("below")
if m.isBee() then
data = m.analyze()
for i.j in pairs(data) do
print(i .. ":" .. j)
end
else
print("Empty or not a bee?")
end


Any help to what I have done wrong would be a huge help.
Thanks for everyones interst.
OmegaVest #2
Posted 13 February 2013 - 05:00 AM
I think you have a problem because you use a period instead of a comma in your for loop. I'm not sure, and my instance is weirding out, so I can't check this right now, but try it and see.
ikke009 #3
Posted 13 February 2013 - 06:03 AM
m = peripheral.wrap("below")
isnt it "bottom"?
also which line exactly is causing the crash?
soccer16x #4
Posted 13 February 2013 - 11:08 AM
Yeah it should be a comma not a period like what is in there currently on line 4 and I'm pretty sure that it should be bottom not below, But since you didn't get that error it might for some reason work as below?
ChunLing #5
Posted 13 February 2013 - 12:43 PM
No, it's just not erroring on the loadstring. When the program actually is run that will at least result in m not containing the desired peripheral methods (it may error on the pcall).
detsuo04 #6
Posted 07 June 2013 - 11:04 AM
i noticed that part of the table returns a Boolean value and another part returns another table.

I cant figure out how to read that in beaded table but i got it a little further with this code

Spoiler

m = peripheral.wrap("bottom")
if m.isBee() then
  data = m.analyze()
  for i , j in pairs(data) do
	print(tostring(i) .. ":" .. tostring( j))
  end
  else
	print("Empty or not a bee?")
end
Almerish #7
Posted 01 July 2013 - 07:24 AM
Using this code i was able to view all of the information that the bee analyzer gives the computer. I changed the way how the 2nd table is shown to more accommodate how it is shown in forestry's beealyzer. Also the program will not work if the bee isn't already analyzed.

Spoiler

m = peripheral.wrap("right")
a = 0
b = 0
if m.isBee() then
data = m.analyze()
for i , j in pairs(data) do
  a = a+1
  if a ~= 14 then
   print(tostring(i) .. " ; " .. tostring(j))
  end
  if a == 14 then
   test = j
   write(tostring(i) .. " : ")
   for e , r in pairs(test) do
	b = b+1
	if b ~= 3 then
	 write(tostring(r).."X")
	end
	if b == 3 then
	 print(tostring(r))
	end
   end
  end
end
else
print("Analyzer is either empty or the item in the analyzer is not a bee.")
end