-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbee.lua
More file actions
52 lines (48 loc) · 1.6 KB
/
Copy pathbee.lua
File metadata and controls
52 lines (48 loc) · 1.6 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local component = require("component")
--local serialization = require("serialization")
_G.package.loaded.config = nil
local strategy, mutations, device
local function initialize()
if not component.inventory_controller then
error("缺少物品栏交互升级")
elseif not component.robot then
error("此程序需要在机器人上运行")
elseif component.robot.inventorySize() < 32 then
error("需要2个物品栏升级")
elseif not component.crafting then
error("缺少合成升级")
elseif not component.beekeeper then
error("缺少养蜂员升级")
elseif not component.database then
error("缺少数据库升级")
elseif not component.upgrade_me then
error("缺少ME升级")
elseif not component.upgrade_me.isLinked() then
error("未连接到ME网络")
elseif component.inventory_controller.getInventoryName(0) ~= "tile.oc.charger" then
error("机器人初始位置应位于OC充电器上方")
end
print("加载中...")
mutations = require("mutations")
device = require("device")
strategy = require("strategy")
end
local function main()
print("请输入需要培育的蜜蜂:")
local species = io.read()
if mutations[species] then
strategy.task(species)
else
error("未发现突变路径")
end
end
local suc, err = pcall(initialize)
if suc then
suc, err = pcall(main)
if not suc then
print("发生错误: " .. err)
device.destruct()
end
else
print("发生错误: " .. err)
end