Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --unmnt
- diskDriveId = "computercraft:disk_drive"
- defaultDir = "/tmp/disk/"
- local driveSlot = 16
- local floppySlot= driveSlot - 1
- function getBlock(inspectInDirection)
- a,b = inspectInDirection()
- local name = b.name
- return name
- end
- function getSideWith(bockName)
- local up = getBlock(turtle.inspectUp)
- local down= getBlock(turtle.inspectDown)
- local fwd = getBlock(turtle.inspect)
- if up == bockName then
- return "up"
- elseif down == bockName then
- return "down"
- elseif fwd == bockName then
- return "fwd"
- else
- return "none"
- end
- end
- function digSideWithDrive()
- local side = getSideWith(diskDriveId)
- if side == "none" then
- error("disk drive not found")
- elseif side == "down" then
- turtle.digDown()
- elseif side == "fwd" then
- turtle.dig()
- elseif side == "up" then
- turtle.digUp()
- end
- end
- turtle.select(floppySlot)
- digSideWithDrive()
- shell.setDir(defaultDir)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement