forked from xyqyear/auto-crossbreeding
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathautoStat.lua
More file actions
59 lines (53 loc) · 1.28 KB
/
Copy pathautoStat.lua
File metadata and controls
59 lines (53 loc) · 1.28 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
53
54
55
56
57
58
59
local gps = require("gps")
local action = require("action")
local database = require("database")
local scanner = require("scanner")
local posUtil = require("posUtil")
local config = require("config")
local tasks = require("tasks")
local args = {...}
local nonstop = false
local docleanup = true
local cleanCount = 0
if #args == 1 then
if args[1] == "nocleanup" then
docleanup = false
elseif args[1] == "nonstop" then
nonstop = true
end
end
local function init()
database.scanFarm()
if config.keepNewCropWhileMinMaxing then
database.scanStorage()
end
tasks.updateLowest()
action.restockAll()
end
local function main()
gps.turnTo(1)
init()
while not tasks.breedOnce(nonstop) do
gps.go({0,0})
action.restockAll()
gps.go({0,0})
cleanCount = cleanCount + 1
if cleanCount > config.inventoryCleanupCycleFreq then
if config.takeCareOfDrops then
action.dumpInventory()
end
gps.go({0,0})
end
end
gps.go({0,0})
if docleanup then
action.destroyAll()
gps.go({0,0})
end
if config.takeCareOfDrops then
action.dumpInventory()
end
gps.turnTo(1)
print("Done.\nAll crops are now 21/31/0")
end
main()