SHOW:
|
|
- or go back to the newest paste.
1 | os.loadAPI("predictSimpleQuarry.lua") | |
2 | - | os.loadAPI("userInput.lua") |
2 | + | |
3 | os.loadAPI("simpleQuarry.lua") | |
4 | os.loadAPI("turtleChest.lua") | |
5 | os.loadAPI("turtleForward.lua") | |
6 | - | os.loadAPI("turtleRefuel.lua") |
6 | + | |
7 | ||
8 | function quarry(loop, choice) | |
9 | - | function mine() |
9 | + | if choice == "left" then |
10 | - | choice = 0 |
10 | + | direction = 0 |
11 | - | while choice ~= 1 do |
11 | + | elseif choice == "right" then |
12 | - | invalid = true |
12 | + | direction = 1 |
13 | - | while invalid do |
13 | + | else |
14 | - | width = tonumber(userInput.getUserInput("Enter Length: ")) |
14 | + | os.exit(1) |
15 | - | length = tonumber(userInput.getUserInput("Enter Width: ")) |
15 | + | |
16 | - | depth = tonumber(userInput.getUserInput("Enter Depth")) |
16 | + | width = 5 |
17 | - | if width == nil then |
17 | + | length = 5 |
18 | - | print("Invalid Length!") |
18 | + | depth = 27 |
19 | - | elseif length == nil then |
19 | + | volume = width * length * depth * loop + (length * loop) |
20 | - | print("Invalid Width!") |
20 | + | width = width - 1 |
21 | - | elseif depth == nil then |
21 | + | x = 0 |
22 | - | print("Invalid Depth!") |
22 | + | while x < loop do |
23 | - | else |
23 | + | simpleQuarry.quarry(width, length, depth) |
24 | - | invalid = false |
24 | + | turtle.turnLeft() |
25 | - | end |
25 | + | turtleChest.insertAll() |
26 | turtle.turnRight() | |
27 | - | tw = width |
27 | + | x = x + 1 |
28 | - | tl = length |
28 | + | y = -2 |
29 | - | td = depth |
29 | + | if direction == 0 then |
30 | - | if tw == 0 then |
30 | + | turtle.turnLeft() |
31 | - | tw = 1 |
31 | + | turtle.turnLeft() |
32 | end | |
33 | - | if tl == 0 then |
33 | + | while y < width do |
34 | - | tl = 1 |
34 | + | turtleForward.moveForward() |
35 | y = y + 1 | |
36 | - | if td == 0 then |
36 | + | |
37 | - | td = 1 |
37 | + | if direction == 0 then |
38 | turtle.turnLeft() | |
39 | - | volume = tw * tl * td |
39 | + | turtle.turnLeft() |
40 | - | width = width - 1 |
40 | + | |
41 | - | print("Volume: " .. volume .. " blocks") |
41 | + | |
42 | end |