Added drive selector

This commit is contained in:
Casey 2023-10-18 00:44:24 +03:00
parent 736d763b64
commit 9e44c53e42
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 16 additions and 2 deletions

View File

@ -31,10 +31,24 @@ local function textProgress(p, c1, c2, fmt, ...)
term.setBackgroundColor(bg) term.setBackgroundColor(bg)
end end
local tape = peripheral.find("tape_drive") local tape = { peripheral.find("tape_drive") }
if not tape then if #tape == 0 then
print("tape where") print("tape where")
return return
elseif #tape ~= 1 then
print("More than one drive found:")
for i = 1, #tape do
print(tape[i])
end
print("Input drive name:")
io.write("> ")
tape = peripheral.wrap(read())
if not tape then
printError("wrong name")
return
end
else
tape = tape[1]
end end
if not http then if not http then