when launched it asks how far you would like to go and in which direction you would like to move
for the distance you can enter any number and it will move that many blocks assuming it does not run into any obstructions
for direction it excepts north south east west up and down
it will error out if you enter a non number in the distance or if you enter a direction other then north south east west up or down in the direction spot.
The startup needs to read
sleep(time) -- for fastest speed use 0.8 but i recomend useing between 1-4 if on a server
shell.run("program name") -- whatever you named the program
because blocks update at a speed of 0.8 seconds you can not have anything less then 0.8 for the sleep time on startup or it will not startup properly and will fail to move however i do not recomend useing 0.8 unless on singleplayer or on a server running with minimal lag.
here is the code for the quarry
--this is a simple redstone in motion --quarry script and can be used --for many purposes --your startup file should read -- first line -- sleep(4) --second line -- shell.run("this script") -- you can reduce the sleep time but -- i dont recomend anything less then 2 -- these are for direction local down = 0 local up = 1 local north = 2 local south = 3 local west = 4 local east = 5 -- function to read from file function readFile(filename) local rv local h = fs.open(filename, "r") if h then rv = h.readLine() h.close() end return rv end --function to save to file function variableSave(fileName, variable) h = fs.open(fileName, "w") h.write(variable) h.close() end -- lets check if we are already doing something if fs.exists("count") then count = readFile("count") distance = readFile("distance") direction = readFile("direction") else -- looks like we are not doing anything yet -- what do we want to do while true do -- how many blocks to dig print("How far shall i dig master?") distance = read() distance = tonumber(distance) if type(distance) == "number" then variableSave("distance", distance) break else -- a number was not entered print("I am terribly sorry sir but that is not a number") end end while true do -- which direction we going print("what direction") direction = read() if -- list of choices (direction == "down") or (direction == "up") or (direction == "north") or (direction == "south") or (direction == "west") or (direction == "east") then variableSave("direction", direction) print("You have 10 seconds to get off the rig") sleep(10) break else -- entered an incorrect direction print("not a correct direction") end end --create the count file then continue variableSave("count", "0") count = 0 end -- check count file to see how many -- times we have moved in chosen -- direction if count == distance then -- done with moving delete count file -- to start over print("quarry done") fs.delete("count") else -- we are not done move in direction -- then add one to count and start over drive = peripheral.wrap("top") drive.move(direction, false, false) count = count + "1" variableSave("count", count) end
I added in comments to help people trying to learn what i did better understand how it works.
You can download this useing pastebin get 0znM4b1c RiMQuarry (RiMQuarry can be changed to what ever you want to name the program just remember when trying to run it with shell.run it is cap sensitive)
http must be enabled in order to use pastebin. If you are playing single player you can simply go to the config folder in your minecraft folder and open the computercraft config and finding http and setting it to true. If you are playing on a server you will need to ask the owner to enable it.
If you have any question or suggestions please post below. Also on a side note I will be working on adding features to this to allow more functionality such as automatic quarry that will go to bedrock then back up move over and do it again so you can set it and forget about it while it runs its course clearing out large areas












