LookStickNow

strip_test

Jan 28th, 2021
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. blocks_to_mine = {
  2.     "thermalfoundation:ore",
  3.     "minecraft:diamond_ore"
  4.     "minecraft:iron_ore"
  5.     "minecraft:coal_ore"
  6.     "minecraft:gold_ore"
  7.     "minecraft:redstone_ore"
  8.     "minecraft:emerald_ore"
  9.     "quark:biotite_ore"
  10. }
  11.  
  12. blocks_to_throw = {
  13.     "minecraft:cobblestone",
  14.     "minecraft:andesite",
  15.     "minecraft:diorite",
  16.     "minecraft:granite",
  17.     "minecraft:sand",
  18.     "minecraft:gravel",
  19.     "minecraft:sandstone"
  20. }
  21.  
  22. function check_block()
  23.     local _,front_inspect = turtle.inspect()
  24.     for i=1, #blocks_to_mine do
  25.         if front_inspect.name == blocks_to_mine[i] then
  26.             return true
  27.         else
  28.             return false
  29.         end
  30.     end
  31. end
  32.  
  33. function check_refuel()
  34.     if turtle.getFuelLevel() < turtle.getFuelLimit() then
  35.         for i=1,16 do
  36.             if turtle.getItemDetail(i) == "minecraft:coal" then
  37.                 turtle.select(i)
  38.                 turtle.refuel()
  39.                 break
  40.         end
  41.     end
  42. end
  43.  
  44. function check_full_inv()
  45.     for i=1,16 do
  46.         if turtle.getItemDetail(i) != nil then
  47.             return false
  48.         else
  49.             return true
  50.         end
  51.     end
  52. end
  53.  
  54. function throw_blocks()
  55.     for k=1,16 do
  56.         for i=1, #blocks_to_throw do
  57.             if turtle.getItemDetail(k) == blocks_to_throw[i] then
  58.                 turtle.select(k)
  59.                 turtle.drop()
  60.             end
  61.         end
  62.     end
  63. end
  64.  
Advertisement
Add Comment
Please, Sign In to add comment