-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTurtleUtils.lua
More file actions
42 lines (35 loc) · 845 Bytes
/
Copy pathTurtleUtils.lua
File metadata and controls
42 lines (35 loc) · 845 Bytes
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
include('modules/SchematicReader.lua')
include('modules/ItemPlace.lua')
include('modules/TurtleMove.lua')
function startRunning(string aFilePath, bool aExcavate)
{
lContinue = true
if fs.exists(aFilePath) then
Schematic.init(aFilePath)
else
lContinue = false
print ("Error: File not found")
end
while (lContine == true) do
lReturnCode = TurtleMove.moveTurtle(aExcavate)
if lReturnCode == 1 then
lContinue = false
print ("Schematic completed successfully")
elseif lReturnCode == -1 then
lContinue = false
print ("Error: Area is not clear")
elseif lReturnCode == -2 then
lContinue = false
print ("Error: Out of Materials")
end
end
}
lExcavate = false
lFilePath = ''
if arg[1] == '-excavate' then
lExcavate = true
lFilePath = arg[2]
else
lFilePath = arg[1]
end
startRunning(lFilePath, lExcavate)