Risk_exe

bot.lua

Feb 5th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1.  
  2. args = {...};
  3. local x = 0;
  4. local y = args[1];
  5. local z = 0;
  6.  
  7. function forward()
  8.   if turtle.detect() then
  9.     turtle.dig();
  10.   end
  11.  
  12. end
  13.  
  14. function up()
  15.   y = y + 1;
  16.   if turtle.detectUp() then
  17.     turtle.digUp();
  18.   end
  19.   turtle.up();
  20. end
  21.  
  22. function down()
  23.   y = y - 1;
  24.   if turtle.detectDown() then
  25.     turtle.digDown();
  26.   end
  27.   turtle.down();
  28. end
  29.  
  30. function descend()
  31.   while y > -30 do
  32.     down();
  33.   end
  34. end
  35.  
  36. -- This function is causing so many problems
  37. function is_valuable(data)
  38.   local lis = {"minecraft:diamond_ore", "minecraft:coal_ore", "minecraftt:gold_ore", "minecraft_iron_ore", "minecraft_redstone_ore"};
  39.   for index, value in ipairs(lis) do
  40.     if value == data.name then
  41.       return true;
  42.     end
  43.   end
  44.  
  45.   print("no valuable ores discovered");
  46.   print("ore name: ", name);
  47.   return false;
  48. end
  49.  
  50.  
  51. function scan()
  52.   local success, data = turtle.inspectUp();
  53.   if data.name == "minecraft:redstone" then
  54.     print("fuck it");
  55.   end
  56.   if is_valuable(data) then
  57.     print("this ore is valueable");
  58.   end
  59. end
  60.  
  61. function strip()
  62.   for i = 1, 32 do
  63.     forward();
  64.   end
  65. end
  66.  
  67. function strip_step()
  68.   turtle.turnLeft();
  69.   -- check for valueable item. dig it.
  70.   turtle.turnRight();
  71.   turtle.turnRight();
  72.   -- check for valuable item again.
  73.   turtle.turnLeft();
  74. end
  75.  
  76.  
  77. if z == nil then
  78.   print("please pass y value as argument");
  79.   return;
  80. end
  81.  
  82.  
  83. if turtle.detect("minecraft:redstone_ore") then
  84.   print("it worked!, that's redstone");
  85. end
  86.  
  87. -- descend();
  88.  
  89. -- turtle.turnLeft();
  90. -- for i = 1, 32 do
  91. -- end
  92.  
Add Comment
Please, Sign In to add comment