Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if not args or not args[1] then
- print("Valid Arguments:")
- print("tunnel <width> <height> <depth>")
- print("stairs <width> <height> <depth>")
- print("mineshaft <depth> <count> <spacing>")
- print("pattern mode count pattern1 <pattern2> <pattern3> ...")
- return
- end
- refuel.refuel()
- term.clear()
- if string.lower(args[1]) == "pattern" then
- local patterns = {}
- for i=4,#args do
- print(args[i])
- local a,b,c,d,e,f = pattern.loadPattern(args[i])
- if not a then error(b) end
- table.insert(patterns,{a=a,b=b,c=c,d=d,e=e,f=f})
- end
- if #patterns <= 0 then error("No specified patterns") end
- local count = args[3]
- local mode = args[2]
- if not tonumber(count) then count = #patterns else count = tonumber(count) end
- for i=0,count-1 do
- local index = i%(#patterns)+1
- if index <= 0 then index = #patterns end
- local p = patterns[index]
- --why is table unpack dumb
- success,turtleData = pattern.mine(p.a,p.b,p.c,p.d,p.e,p.f,mode)
- while turtleData.horizRot ~= 0 do
- turt.turnLeft()
- turtleData.horizRot = (turtleData.horizRot-1)%4
- end
- if not success then error("pattern mining failed") end
- end
- term.clear()
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- stats.printStat()
- return
- end
- args[2],args[3],args[4] = tonumber(args[2]),tonumber(args[3]),tonumber(args[4])
- if string.lower(args[1]) == "tunnel" then
- local cost = (args[2] or 3)*(args[3] or 3) * (args[4] or 30)
- if cost > turtle.getFuelLevel() then error("Not enough fuel to make the trip") end
- mine.mineTunnel(args[2],args[3],args[4])
- elseif string.lower(args[1]) == "stairs" then
- local cost = (args[2] or 3) * (args[3] or 6) * (args[4] or 30)
- if cost > turtle.getFuelLevel() then error("Not enough fuel to complete task") end
- mine.mineDeprecatedStairs(args[2],args[3],args[4])
- elseif string.lower(args[1]) == "mineshaft" then
- local cost = ((args[2] or 45) + (args[4] or 3))*2*(args[3] or 10)
- if cost > turtle.getFuelLevel() then error("Not enough fuel to complete task") end
- args[5] = args[5] == "true"
- mine.createMiningTunnels(args[2],args[3],args[4],args[5])
- end
- --mine.miningTunnel(45,4,3)
- --mine.stairs(1,6,30)
- --print("test2")
- local success,msg = turt.storeItems()
- if not success then
- term.setTextColor(colors.red)
- print(msg)
- term.setTextColor(colors.white)
- else
- stats.printStat()
- end
- --print("Blocks Dug:",stats.read("Amount Dug") or 0)
- --print("Times Moved:",stats.read("Times Moved") or 0)
- --print("Items Dropped:",stats,read("Items Dropped") or 0)
Advertisement
Add Comment
Please, Sign In to add comment