Advertisement
JustMark

Ore Miner

Jul 10th, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. local whitelist = {
  2.     'minecraft:coal_ore',
  3.     'minecraft:iron_ore',
  4.     'minecraft:gold_ore',
  5.     'minecraft:redstone_ore',
  6.     'minecraft:lapis_ore',
  7.     'minecraft:diamond_ore',
  8.     'minecraft:emerald_ore',
  9.     'minecraft:nether_quartz_ore'
  10. }
  11.  
  12. function isOre(name)
  13.     for i = 1, #whitelist do
  14.         if (name == whitelist[i]) then
  15.             return true
  16.         end
  17.     end
  18.  
  19.     return false
  20. end
  21.  
  22. while true do
  23.     local _, data = turtle.inspect()
  24.     local ore = isOre(data.name)
  25.     print(ore and 'found ore' or 'not ore')
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement