Advertisement
Risk_exe

bot.lua

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