Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Explanation:
- Robot will try placing a cobblestone using dev/Null under itself if it detect 'air' and then it will place a rail under itself.
- Robot will check if block in front of it is solid, if true, it will dig the block.
- Robot will move one block forward after digging out the block above or being able to move free if 'air'
- Robot is now under block #5, robot will turn left and check if block is solid. If solid, robot dig the block.
- Robot now move forward, under block #4. Robot check if block in front is 'air' and replace it if needed with the dev/ Null.
- Robot also check the block under it, and replace it with dev/ Null if needed.
- Robot now turnaround.
- Robot move forward once, under block #5, and check block solidity, if block is solid, robot dig the block.
- Robot move forward again, check block solidity in front of it, replace if air and does the same thing for the block below it.
- Robot check block #6 for solidity (over itself) , dig up if solid and/or move up under block #9.
- Robot check block solidity in front of it, replace with dev/ Null if air.
- Robot turn around, check block solidity and dig it out if solid and move forward once.
- Robot now under block #8, check block solidity in front of it, dig it out and move forward once.
- Robot check block solidity in front of it, if air, replace with dev/ Null.
- Robot check block solidity of block #7 and dig up if solid, then move up once.
- Robot check block solidity in front of it, if air, place block from dev/ Null.
- Robot check block solidity over itself, if air, place block from dev/ Null.
- Robot turn around, check solidity in front of itself and dig the block if solid and move forward once.
- Robot check solidity over itself, if air, replace with dev/ Null.
- Robot check solidity in front of it, if solid, dig and move forward once
- Robot under block #9, check solidity in front, if air, replace with dev/ Null.
- Robot check solidity up, if air, replace with dev/ Null.
- Robot turnaround, move forward once, turn right once and move down 2 blocks.
- Placements :
- Example Grid for 3x3 layer : 789
- 456 <--- This represent a vertical 3x3 layer of blocks, numbered from bottom to top for reference.
- 123
- Robot start facing block #2, it will start loaded with Mining Tool, Ender Chest, Crafting Table, dev/ Null (filled with dirt) and Rails, Cobblestones, Coals.
- local function digHollow3x3()
- while true do
- robot.select() -- select mining tool
- if rEnergy < 200
- robot.select()
- robot.turnLeft()
- robot.place()
- robot.suck()
- os.sleep(20)
- robot.swing()
- robot.turnRight()
- else robot.select() -- dev/ null
- robot.detectDown()
- if return air
- robot.placeDown()
- else robot.select() -- rails
- robot.placeDown()
- robot.select() -- mining tool
- robot.detect()
- if true robot.swing() -- swing at block 2
- else robot.forward()
- robot.turnLeft() -- face left
- robot.detect() -- check for solid block
- if true robot.swing() -- swing at block 1
- else robot.forward() -- under block 4
- robot.detectDown() -- detect under block 1
- if return air
- robot.select()
- robot.placeDown()
- else robot.detect() -- detect left side of block 1
- if return air
- robot.select()
- robot.place()
- else robot.turnAround() -- face right
- robot.forward() -- under block 5
- robot.detect()
- if true robot.select()
- robot.swing() -- swing at block 3
- else robot.forward() -- under block 6
- robot.detect() -- detect right side of block 3
- if return air
- robot.select()
- robot.place()
- else robot.detectDown() -- detect under block block 3
- if return air
- robot.place()
- else robot.detectUp
- if true robot.select()
- robot.swingUp -- swing at block 6
- else robot.up() -- under block 9
- robot.detect() -- detect block right of block 6
- if return air
- robot.place()
- else robot.turnAround() -- face left
- robot.detect()
- if true robot.select()
- robot.swing() -- swing at block 5
- else robot.forward() -- under block 8
- robot.detect()
- if true robot.swing() -- swing at block 4
- else robot.forward() -- under block 7
- robot.detect() -- detect block at right of block 4
- if return air
- robot.select()
- robot.place()
- else robot.detectUp()
- if true robot.select()
- robot.swing()
- else robot.up() -- at block 7 position
- robot.detect() -- detect block on left side of block 7
- if return air
- robot.select()
- robot.place()
- else robot.detectUp() -- detect block above block 7
- if return air
- robot.placeUp()
- else robot.turnAround() -- face right
- robot.detect()
- if true robot.select()
- robot.swing()
- else robot.forward() -- at block 8 position
- robot.detectUp() -- detect block above block 8
- if return air
- robot.select()
- robot.placeUp()
- else robot.forward() -- at block 9 position
- robot.detectUp() -- detect block above block 9
- if return air
- robot.placeUp()
- else robot.detect() -- detect block on the right of block 9
- if return air
- robot.place()
- else robot.back()
- robot.turnLeft() -- face toward next layer
- robot.down(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement