Advertisement
TaKaQod

branch-miner

Aug 5th, 2022
806
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mineBranch = require('mine-branch')
  2. local mineHallway = require('mine-hallway')
  3. local MoveAdvanced = require('move-advanced')
  4. local Move = require('move')
  5.  
  6. local slot_blocks = 15
  7.  
  8. local branchNumber = 2
  9.  
  10. local function mineNextBranches()
  11.     -- Go to branch left
  12.     MoveAdvanced.go({
  13.         x = 0,
  14.         y = 3,
  15.         z = -2
  16.     })
  17.     Move.face(3)
  18.  
  19.     -- Mine branch left
  20.     mineBranch()
  21.  
  22.     -- Go to branch right
  23.     MoveAdvanced.go({
  24.         x = 2,
  25.         y = 0,
  26.         z = 0
  27.     })
  28.     Move.face(1)
  29.  
  30.     -- Mine branch right
  31.     mineBranch()
  32.  
  33.     -- Prepare for hallway (cause don't want to have a condition in main loop)
  34.     MoveAdvanced.go({
  35.         x = 0,
  36.         y = 1,
  37.         z = 0
  38.     })
  39.     Move.face(0)
  40. end
  41.  
  42. local function main()
  43.     MoveAdvanced.go({
  44.         x = 1,
  45.         y = 0,
  46.         z = 0
  47.     })
  48.     Move.face(0)
  49.  
  50.     local branchDigged = 0
  51.     while branchDigged < branchNumber do
  52.         mineHallway()
  53.         mineNextBranches()
  54.         branchDigged = branchDigged + 1
  55.     end
  56. end
  57.  
  58.  
  59. main()
  60.  
  61.  
  62.  
  63.  
Advertisement
RAW Paste Data Copied
Advertisement