Advertisement
Guest User

Untitled

a guest
Apr 29th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.70 KB | None | 0 0
  1. Explanation:
  2.  
  3. Robot will try placing a cobblestone using dev/Null under itself if it detect 'air' and then it will place a rail under itself.
  4. Robot will check if block in front of it is solid, if true, it will dig the block.
  5. Robot will move one block forward after digging out the block above or being able to move free if 'air'
  6. Robot is now under block #5, robot will turn left and check if block is solid. If solid, robot dig the block.
  7. Robot now move forward, under block #4. Robot check if block in front is 'air' and replace it if needed with the dev/ Null.
  8. Robot also check the block under it, and replace it with dev/ Null if needed.
  9. Robot now turnaround.
  10. Robot move forward once, under block #5, and check block solidity, if block is solid, robot dig the block.
  11. Robot move forward again, check block solidity in front of it, replace if air and does the same thing for the block below it.
  12. Robot check block #6 for solidity (over itself) , dig up if solid and/or move up under block #9.
  13. Robot check block solidity in front of it, replace with dev/ Null if air.
  14. Robot turn around, check block solidity and dig it out if solid and move forward once.
  15. Robot now under block #8, check block solidity in front of it, dig it out and move forward once.
  16. Robot check block solidity in front of it, if air, replace with dev/ Null.
  17. Robot check block solidity of block #7 and dig up if solid, then move up once.
  18. Robot check block solidity in front of it, if air, place block from dev/ Null.
  19. Robot check block solidity over itself, if air, place block from dev/ Null.
  20. Robot turn around, check solidity in front of itself and dig the block if solid and move forward once.
  21. Robot check solidity over itself, if air, replace with dev/ Null.
  22. Robot check solidity in front of it, if solid, dig and move forward once
  23. Robot under block #9, check solidity in front, if air, replace with dev/ Null.
  24. Robot check solidity up, if air, replace with dev/ Null.
  25. Robot turnaround, move forward once, turn right once and move down 2 blocks.
  26.  
  27. Placements :
  28.  
  29. Example Grid for 3x3 layer : 789
  30.                              456  <--- This represent a vertical 3x3 layer of blocks, numbered from bottom to top for reference.
  31.                              123    
  32.  
  33. 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.
  34.  
  35.  
  36.  
  37.  
  38. local function digHollow3x3()
  39.  
  40.   while true do
  41.  
  42.             robot.select() -- select mining tool
  43.  
  44.           if rEnergy < 200
  45.             robot.select()
  46.             robot.turnLeft()
  47.             robot.place()
  48.             robot.suck()
  49.             os.sleep(20)
  50.             robot.swing()
  51.             robot.turnRight()
  52.     else  robot.select() -- dev/ null
  53.           robot.detectDown()
  54.         if return air
  55.           robot.placeDown()
  56.     else  robot.select() -- rails
  57.           robot.placeDown()    
  58.           robot.select() -- mining tool
  59.           robot.detect()
  60.         if true robot.swing() -- swing at block 2
  61.     else robot.forward()      
  62.           robot.turnLeft() -- face left
  63.           robot.detect() -- check for solid block
  64.         if true robot.swing() -- swing at block 1
  65.     else  robot.forward() -- under block 4
  66.           robot.detectDown() -- detect under block 1
  67.         if return air
  68.           robot.select()
  69.           robot.placeDown()
  70.     else  robot.detect() -- detect left side of block 1
  71.         if return air
  72.           robot.select()
  73.           robot.place()
  74.     else  robot.turnAround() -- face right
  75.           robot.forward() -- under block 5
  76.           robot.detect()
  77.         if true robot.select()
  78.                 robot.swing() -- swing at block 3
  79.     else  robot.forward() -- under block 6
  80.           robot.detect() -- detect right side of block 3
  81.         if return air
  82.           robot.select()
  83.           robot.place()
  84.     else  robot.detectDown() -- detect under block block 3
  85.         if return air
  86.           robot.place()
  87.     else  robot.detectUp
  88.         if true robot.select()
  89.                 robot.swingUp -- swing at block 6
  90.     else  robot.up() -- under block 9
  91.           robot.detect() -- detect block right of block 6
  92.         if return air
  93.           robot.place()
  94.     else  robot.turnAround() -- face left
  95.           robot.detect()
  96.         if true robot.select()  
  97.                 robot.swing() -- swing at block 5
  98.     else  robot.forward() -- under block 8
  99.           robot.detect()
  100.         if true robot.swing() -- swing at block 4
  101.     else  robot.forward() -- under block 7
  102.           robot.detect() -- detect block at right of block 4
  103.         if return air
  104.           robot.select()
  105.           robot.place()
  106.     else  robot.detectUp()
  107.         if true robot.select()
  108.                 robot.swing()
  109.     else  robot.up() -- at block 7 position
  110.           robot.detect() -- detect block on left side of block 7
  111.         if return air
  112.           robot.select()
  113.           robot.place()
  114.     else  robot.detectUp() -- detect block above block 7
  115.         if return air
  116.           robot.placeUp()
  117.     else  robot.turnAround() -- face right    
  118.           robot.detect()
  119.         if true robot.select()
  120.                 robot.swing()
  121.     else  robot.forward() -- at block 8 position
  122.           robot.detectUp() -- detect block above block 8
  123.         if return air
  124.           robot.select()
  125.           robot.placeUp()
  126.     else  robot.forward() -- at block 9 position
  127.           robot.detectUp() -- detect block above block 9
  128.         if return air
  129.           robot.placeUp()
  130.     else  robot.detect() -- detect block on the right of block 9
  131.         if return air
  132.           robot.place()
  133.     else  robot.back()
  134.           robot.turnLeft() -- face toward next layer
  135.           robot.down(2)
  136. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement