Posted 02 September 2012 - 12:34 AM
I have a functional frame quarry and this program seems to work, I was hoping some of the experts here could tell what I could do to make the code a bit cleaner and suggest where to start to improve the program. I want to eventually be able to select how deep the miner goes and to have an abort function that will recall the miner to the surface.
Thanks Boes
Spoiler
depth = 30
recover = depth * 2
function MoveNorth()
print("MoveNorth")
rs.setBundledOutput("bottom", 8)
sleep(1)
rs.setBundledOutput("bottom", 8)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function MoveSouth()
print("MoveSouth")
rs.setBundledOutput("bottom", 4)
sleep(1)
rs.setBundledOutput("bottom", 4)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function MoveEast()
print("MoveEast")
rs.setBundledOutput("bottom", 2)
sleep(1)
rs.setBundledOutput("bottom", 2)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function MoveWest()
print ("MoveWest")
rs.setBundledOutput("bottom", 1)
sleep(1)
rs.setBundledOutput("bottom", 1)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function MoveUp()
print ("MoveUp")
rs.setBundledOutput("bottom", 32)
sleep(1)
rs.setBundledOutput("bottom", 0)
sleep(1)
rs.setBundledOutput("bottom", 32)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function MoveDown()
print ("MoveDown")
rs.setBundledOutput("bottom", 16)
sleep(1)
rs.setBundledOutput("bottom", 16)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function BBreaker()
print ("BBreaker")
rs.setBundledOutput("bottom", 64)
sleep(1)
rs.setBundledOutput("bottom", 0)
end
function Recover()
print ("Bringing Miner to Surface")
for i = 1 , recover do
MoveUp()
end
end
for i = 1, depth do
BBreaker()
MoveEast()
BBreaker()
MoveDown()
BBreaker()
MoveWest()
BBreaker()
MoveDown()
end
Recover()
Thanks Boes