View difference between Paste ID: hV6x6tNr and FgcnJWmH
SHOW: | | - or go back to the newest paste.
1
os.loadAPI("predictSimpleQuarry.lua")
2
os.loadAPI("userInput.lua")
3
os.loadAPI("getTurtleFuel.lua")
4
os.loadAPI("simpleQuarry.lua")
5
os.loadAPI("turtleForward.lua")
6-
os.loadAPI("turtleRefuel.lua")
6+
7
choice = 0
8
while choice ~= 1 do
9-
function mine()
9+
	width = tonumber(userInput.getUserInput("Enter Length: "))
10-
	choice = 0
10+
	length = tonumber(userInput.getUserInput("Enter Width: "))
11-
	while choice ~= 1 do
11+
	depth = tonumber(userInput.getUserInput("Enter Depth"))
12-
		invalid = true
12+
	tw = width
13-
		while invalid do
13+
	tl = length
14-
			width = tonumber(userInput.getUserInput("Enter Length: "))
14+
	td = depth
15-
			length = tonumber(userInput.getUserInput("Enter Width: "))
15+
	if tw == 0 then
16-
			depth = tonumber(userInput.getUserInput("Enter Depth"))
16+
		tw = 1
17-
			if width == nil then
17+
18-
				print("Invalid Length!")
18+
	if tl == 0 then
19-
			elseif length == nil then
19+
		tl = 1
20-
				print("Invalid Width!")
20+
21-
			elseif depth == nil then
21+
	if td == 0 then
22-
				print("Invalid Depth!")
22+
		td = 1
23-
			else
23+
24-
				invalid = false
24+
	volume = tw * tl * td
25-
			end
25+
	width = width - 1
26
27-
		tw = width
27+
	print("Use a Preset?")
28-
		tl = length
28+
	choice = tonumber(userInput.getUserInput("Yes = 1, No = 2"))
29-
		td = depth
29+
	if choice == 1 then
30-
		if tw == 0 then
30+
		choice = tonumber(userInput.getUserInput("1 for sand, 2 for gravel"))
31-
			tw = 1
31+
		if choice == 1 then
32
			blockname = "minecraft:sand"
33-
		if tl == 0 then
33+
34-
			tl = 1
34+
			blockname = "minecraft:gravel"
35
		end
36-
		if td == 0 then
36+
	else
37-
			td = 1
37+
		blockname = userInput.getUserInput("Please Input Block ID")
38
	end
39-
		volume = tw * tl * td
39+
40-
		width = width - 1
40+
	print("Volume: " .. volume .. " blocks")
41-
		print("Volume: " .. volume .. " blocks")
41+
42
	if volume > 800 then
43-
		if volume > 800 then
43+
		print("WARNING! Volume over 800")
44-
			print("WARNING! Volume over 800")
44+
		print("Max is 1024 with Empty Inventory")
45-
			print("Max is 1024 with Empty Inventory")
45+
		print("With Stacks of 64.")
46-
			print("With Stacks of 64.")
46+
47
	print("Proceed?")
48-
		max = volume > 9000
48+
	choice = tonumber(userInput.getUserInput("Yes = 1, No = 2"))
49-
		if not max then
49+
end
50-
			print("Proceed?")
50+
51-
			choice = tonumber(userInput.getUserInput("Yes = 1, No = 2"))
51+
52
predictSimpleQuarry.predict(width, length, depth)
53-
			predictSimpleQuarry.predict(width, length, depth)
53+
fuelcost = predictSimpleQuarry.getFuelCost()
54-
			fuelcost = predictSimpleQuarry.getFuelCost()
54+
if fuelcost > turtle.getFuelLevel() then
55-
			if fuelcost > turtle.getFuelLevel() then
55+
	getTurtleFuel.displayFuelInfo()
56-
				getTurtleFuel.displayFuelInfo()
56+
	print("Fuel too Low to Start, Please Insert Buckets")
57-
				print("Quarry Fuel Cost = " .. fuelcost)
57+
	userInput.getUserInput("Type Anything to Refuel")
58-
				print("Fuel too Low to Start, Please Insert Buckets")
58+
	shell.run("turtleRefuel.lua")
59-
				choice = tonumber(userInput.getUserInput("Type 1 to Refuel, Type 2 to Re-select Quarry"))
59+
end
60-
				if choice == 1 then
60+
if fuelcost > turtle.getFuelLevel() then
61-
					turtleRefuel.refuelWithLava()
61+
	print("Fuel Still too Low to Start, Terminating Program")
62-
					turtle.select(1)
62+
else
63-
					if fuelcost > turtle.getFuelLevel() then
63+
	simpleQuarry.smartQuarry(width, length, depth, blockname)
64-
						print("Fuel Still too Low to Start, Terminating Program")
64+
end
65-
						os.sleep(3)
65+