Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TUNNEL_HEIGHT = 5;
- local TUNNEL_BLOCK = "minecraft:stone";
- local TUNNEL_CORNER = "minecraft:stone_stairs";
- local USE_CORNER = false;
- local CORNER_IS_STAIR = false;
- local function findItem(itemName)
- for i = 1, 16, 1 do
- local item = turtle.getItemDetail(i);
- if item.name == itemName then return i end;
- end
- return -1;
- end
- local function refuel()
- end
- local function splashScreen()
- term.clear();
- term.setCursorPos(0,0);
- term.write(string.rep("-", 39, ""));
- for i = 1, 5, 1 do
- term.setCursorPos(1, i);
- term.setCursorPos(38, i);
- end
- term.write("| |")
- term.write("| TUNNEL WALL BUILDER |")
- term.write("| |")
- term.write("| |")
- term.write("| |")
- term.write(string.rep("-", 39, ""));
- end
- local function getTunnelInfo()
- local done = false;
- while not done do
- term.write("What height does your tunnel wall have? (leave empty for default)");
- local input = read();
- if input == "" then
- done = true;
- goto continue;
- end
- local numberInput = tonumber(input);
- if numberInput == nil or numberInput < 3 then
- term.write("Please use a valid integer of 3 and above, i have no use for this!");
- goto continue;
- end
- TUNNEL_HEIGHT = math.floor(numberInput);
- done = true;
- ::continue::
- end
- term.write("Great! Using " .. TUNNEL_HEIGHT .. " as the tunnel height!");
- while not done do
- term.write("What block should i use for the wall?");
- local input = read();
- if input ~= "" then
- TUNNEL_BLOCK = input;
- end
- local foundItem = findItem(TUNNEL_BLOCK);
- if foundItem == -1 then
- term.write("I can't find this block, could you please insert the specified block? " .. TUNNEL_BLOCK .. ".");
- goto continue;
- else
- done = true;
- goto continue;
- end
- ::continue::
- end
- term.write("Great! Using " .. TUNNEL_BLOCK .. " as the wall block.")
- term.write("Do you want to use a corner block? (Y/n)");
- local input = read();
- if string.lower(input) == "y" or string.lower(input) == "yes" then
- USE_CORNER = true;
- else
- term.write("I'll make the tunnel as square as possible!");
- goto skip_corner;
- end
- term.write("Now i'll need some more information about the corner block.");
- while not done do
- term.write("What block should i used for the corner?");
- local input = read();
- if input ~= "" then
- TUNNEL_CORNER = input;
- end
- local foundItem = findItem(TUNNEL_CORNER);
- if foundItem == -1 then
- term.write("I can't find this block, could you please insert the specified block? " .. TUNNEL_CORNER .. ".");
- goto continue;
- else
- done = true;
- goto continue;
- end
- ::continue::
- end
- term.write("I'll place " .. TUNNEL_CORNER .. " in the corners! ");
- term.write("Is this block a stair, or should it be treated as one? (Y/n)");
- local input = read();
- if string.lower(input) == "y" or string.lower(input) == "yes" then
- CORNER_IS_STAIR = true;
- term.write("I'll treat the corner block as a stair, and turn it around!");
- else
- term.write("Less work for me!");
- goto skip_corner;
- end
- ::skip_corner::
- term.write("I have all the information i need to get started working on this wall, thanks!");
- end
- local function main()
- splashScreen();
- end
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement