OfflineDude

mine_WIP

Jun 14th, 2022 (edited)
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.81 KB | None | 0 0
  1. x,y,z = arg[1], arg[2], arg[3]
  2. switch = 0
  3. switch_second = 0
  4. block_volume = (x*z)*y
  5.  
  6.  
  7. -- -------------------------- FUELS
  8. fuel_type = { "wood_tool", "lava", "blaze_rod", "wood_blocks", "sticks", "coal/charcoal", "mushroom_blocks"}
  9. fuel_value = { 10, 1000, 120, 15, 5, 80, 15}
  10.  
  11. -- --------------------------- FUEL CALCULATOR, AND REFUELER
  12. function doFuel(fuelSlot)
  13.     for i=1, #fuel_value do
  14.         calculated_fuel = block_volume / fuel_value[i]
  15.         io.write(fuel_type[i] .. " - " .. calculated_fuel .. "\n" )
  16.     end
  17.     io.write("CHESTS IN SLOT 1\n")
  18.     io.write("WAITING FOR FUEL IN SLOT 2")
  19.     turtle.select(fuelSlot)
  20.     while block_volume >= turtle.getFuelLevel() do
  21.         turtle.refuel(1)
  22.     end
  23.     if turtle.getItemCount(fuelSlot) > 0 then -- -------------------------- DROP EXCESS FUEL
  24.         turtle.dropUp()
  25.     end
  26. end
  27.  
  28.  
  29. -- -------------------------- CHECK INVENTORY, AND CHEST IT, WITH NORMAL CHESTS
  30. function checkIV (startSlot, endSlot, chestSlot)
  31.     is_full = 0
  32.     for i = startSlot, endSlot, 1 do
  33.         turtle.select(i)
  34.         if turtle.getItemCount(i) >= 10 then
  35.             is_full = is_full + 1
  36.         end
  37.     end
  38.     if is_full >= 15 then
  39.         turtle.select(chestSlot)
  40.         if turtle.detectUp() then
  41.             turtle.digUp()
  42.         end
  43.         turtle.placeUp()
  44.         for i = startSlot, endSlot, 1 do
  45.             turtle.select(i)
  46.             turtle.dropUp()
  47.         end
  48.     end
  49. end
  50.  
  51. -- -------------------------- MAIN
  52. doFuel(2) -- ---------------- REFUEL
  53. for i=1 , y/2 do
  54.     for ii=1, z-1 do
  55.         for iii=1, x-1 do -- ---------------- FORWARD
  56.             if turtle.detect() then
  57.                 turtle.dig()
  58.             end
  59.             turtle.digDown()
  60.             turtle.forward()
  61.         end
  62.         if switch == 0 then -- ---------------- MAIN TURN
  63.             turtle.turnRight()
  64.             turtle.dig()
  65.             turtle.digDown()
  66.             turtle.forward()
  67.             turtle.turnRight()
  68.             switch = 1
  69.         else
  70.             turtle.turnLeft()
  71.             turtle.dig()
  72.             turtle.digDown()
  73.             turtle.forward()
  74.             turtle.turnLeft()
  75.             switch = 0
  76.         end
  77.     end
  78.     for iii=1, x-1 do -- ---------------- SECOND FORWARD
  79.         if turtle.detect() then
  80.             turtle.dig()
  81.         end
  82.         turtle.digDown()
  83.         turtle.forward()
  84.     end
  85.     if switch == 0 then -- ---------------- SECOND TURN
  86.         for ix=1, 2 do
  87.             turtle.turnLeft()
  88.         end
  89.     else
  90.         for ix=1, 2 do
  91.             turtle.turnRight()
  92.         end
  93.     end
  94.     checkIV(2,16,1) -- ---------------- CHECK INVENTORY
  95.  
  96.     for i=1, 2 do   -- ---------------- LOWERING THE LEVEL TWO TIMES
  97.         turtle.digDown()  
  98.         turtle.down()
  99.     end
  100. end
  101. -- pastebin get sdFmrn4B test
Advertisement
Add Comment
Please, Sign In to add comment