Advertisement
Risk_exe

bot.lua

Feb 3rd, 2023
920
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1.  
  2. args = {...};
  3. local x = 0;
  4. local y = args[1];
  5. local z = 0;
  6.  
  7.  
  8. function forward()
  9.  
  10. end
  11.  
  12. function up()
  13.   y = y + 1;
  14.   if turtle.detectUp() then
  15.     turtle.digUp();
  16.   end
  17.   turtle.up();
  18. end
  19.  
  20. function down()
  21.   y = y - 1;
  22.   if turtle.detectDown() then
  23.     turtle.digDown();
  24.   end
  25.   turtle.down();
  26. end
  27.  
  28. function descend()
  29.   while y > -30 do
  30.     down();
  31.   end
  32. end
  33.  
  34. function valuable(name)
  35.   local lis = {"minecraft:diamond_ore", "minecraft:coal_ore", "minecraftt:gold_ore, minecraft_iron_ore", "minecraft_redstone_ore"};
  36.   -- for index, value in ipairs(lis) do
  37.   --   if value == name then
  38.   --     return true;
  39.   --   end
  40.   -- end
  41.   for i=1, #lis do
  42.     if lis[i] == name then
  43.       return true;
  44.     end
  45.   end
  46.   print("no valuable ores discovered")
  47.   print("ore name: ", name);
  48.   return false;
  49. end
  50.  
  51.  
  52. function scan()
  53.   local success, data = turtle.inspectUp();
  54.   if valuable("minecraft:redstone_ore") then
  55.     print("this ore is valueable");
  56.   end
  57. end
  58.  
  59.  
  60. if z == nil then
  61.   print("please pass y value as argument");
  62.   return;
  63. end
  64.  
  65. local success, data = turtle.inspectDown();
  66.  
  67. if success then
  68.   print("Block name: ", data.name);
  69.   print("Block metadata: ", data.metadata);
  70.   scan();
  71. end
  72.  
  73. print("x: ", x);
  74. print("y: ", y);
  75. print("z: ", z);
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement