So I have spent a few hours looking for documentation on the item "Computer Controlled Seed Analyzer" with no current information that is useful. My goal is to set up a seed analyzer that will check for a plant next to the analyzer and analyze it.
My code:
local sides = require("sides")
if hasPlant(sides.left) and isAnalyzed() == false then
analyze(side.left)
end
From my logic, I believe the outcome should analyze the seed, but instead it gives an attempt to call a nil value (global hasPlant
). From my research, sides were not defined at the time therefor I added the local line. What else would I be missing?
Two problems here:
Of note:
DOWN
,UP
,NORTH
,SOUTH
,WEST
, andEAST
, rather than the numeric constants fromside
.component
.local component = require("component")
, so add it to the top if you get an error about it missing. (It works for me without it, but a bunch of documentation says you need it.)