forked from hkc/cc-stuff
Added drive selector
This commit is contained in:
parent
736d763b64
commit
9e44c53e42
18
tapeget.lua
18
tapeget.lua
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue