forked from huchenlei/auto-crossbreeding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscanner.lua
31 lines (29 loc) · 990 Bytes
/
scanner.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local component = require("component")
local geolyzer = component.geolyzer
local sides = require("sides")
local function scan()
local rawResult = geolyzer.analyze(sides.down)
if rawResult.name == "minecraft:air" or rawResult.name == "GalacticraftCore:tile.brightAir" then
return {isCrop=false, name="air"}
elseif rawResult.name == "IC2:blockCrop" then
if rawResult["crop:name"] == nil then
return {isCrop=false, name="crop"}
elseif rawResult["crop:name"] == "weed" then
return {isCrop=true, name="weed"}
else
return {
isCrop=true,
name = rawResult["crop:name"],
gr = rawResult["crop:growth"],
ga = rawResult["crop:gain"],
re = rawResult["crop:resistance"],
tier = rawResult["crop:tier"]
}
end
else
return {isCrop=false, name=rawResult.name}
end
end
return {
scan = scan
}