Advertisement
Risk_exe

bot.lua

Feb 3rd, 2023
818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 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.   print("no valuable ores discovered")
  42.   return false;
  43. end
  44.  
  45.  
  46. function scan()
  47.   local success, data = turtle.inspectUp();
  48.   if valuable(data.name) then
  49.     print("this ore is valueable");
  50.   end
  51. end
  52.  
  53.  
  54. if z == nil then
  55.   print("please pass y value as argument");
  56.   return;
  57. end
  58.  
  59. local success, data = turtle.inspectDown();
  60.  
  61. if success then
  62.   print("Block name: ", data.name);
  63.   print("Block metadata: ", data.metadata);
  64.   scan();
  65. end
  66.  
  67. print("x: ", x);
  68. print("y: ", y);
  69. print("z: ", z);
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement