forked from xyqyear/auto-crossbreeding
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathautoSpread.lua
More file actions
46 lines (41 loc) · 1.02 KB
/
Copy pathautoSpread.lua
File metadata and controls
46 lines (41 loc) · 1.02 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
local database = require("database")
local gps = require("gps")
local posUtil = require("posUtil")
local scanner = require("scanner")
local action = require("action")
local config = require("config")
local tasks = require("tasks")
local args = {...}
local function init()
database.scanFarm()
local multifarmPos = {}
if #args == 2 then
multifarmPos[1] = tonumber(args[1])
multifarmPos[2] = tonumber(args[2])
end
if multifarmPos[1] and multifarmPos[2] then
database.setLastMultifarmPos(multifarmPos)
else
database.scanMultifarm()
end
action.restockAll()
end
local function main()
gps.turnTo(1)
init()
while not tasks.spreadOnce() do
gps.go({0, 0})
action.restockAll()
end
gps.go({0,0})
if #args == 1 and args[1] == "nocleanup" then
action.destroyAll()
gps.go({0,0})
end
if config.takeCareOfDrops then
action.dumpInventory()
end
gps.turnTo(1)
print("Done.\nThe Multifarm is filled up.")
end
main()