Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...};
- local x = 0;
- local y = args[1];
- local z = 0;
- function forward()
- end
- function up()
- y = y + 1;
- if turtle.detectUp() then
- turtle.digUp();
- end
- turtle.up();
- end
- function down()
- y = y - 1;
- if turtle.detectDown() then
- turtle.digDown();
- end
- turtle.down();
- end
- function descend()
- while y > -30 do
- down();
- end
- end
- -- This function is causing so many problems
- function valuable(name)
- local lis = {"minecraft:diamond_ore", "minecraft:coal_ore", "minecraftt:gold_ore", "minecraft_iron_ore", "minecraft_redstone_ore"};
- for index, value in ipairs(lis) do
- print("item: ", value);
- if value == name then
- return true;
- end
- end
- print("no valuable ores discovered");
- print("ore name: ", name);
- return false;
- end
- function scan()
- local success, data = turtle.inspectUp();
- print(type(data.name));
- if valuable(data.name) then
- print("this ore is valueable");
- end
- end
- if z == nil then
- print("please pass y value as argument");
- return;
- end
- local success, data = turtle.inspectDown();
- if success then
- print("Block name: ", data.name);
- print("Block metadata: ", data.metadata);
- scan();
- end
- print("x: ", x);
- print("y: ", y);
- print("z: ", z);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement