forked from hkc/cc-stuff
Tape fixes
This commit is contained in:
parent
9e44c53e42
commit
135b606686
11
tape-rip.lua
11
tape-rip.lua
|
@ -73,12 +73,19 @@ if seekToStart then
|
||||||
end
|
end
|
||||||
|
|
||||||
local _, y = term.getCursorPos()
|
local _, y = term.getCursorPos()
|
||||||
|
local i = 0
|
||||||
while not src.isEnd() do
|
while not src.isEnd() do
|
||||||
dst.write(src.read(6000 * 10))
|
dst.write(src.read(6000 * 10))
|
||||||
local pos, sz = src.getPosition(), src.getSize()
|
local pos, sz = src.getPosition(), src.getSize()
|
||||||
term.setCursorPos(1, y)
|
term.setCursorPos(1, y)
|
||||||
term.clearLine()
|
term.clearLine()
|
||||||
textProgress(pos / sz, colors.green, colors.gray, "%7.3f%% %8d / %8d", pos * 100 / sz, pos, sz)
|
if (i % 10) == 0 then
|
||||||
os.sleep(0.01)
|
textProgress(pos / sz, colors.green, colors.gray, "%7.3f%% %8d / %8d", pos * 100 / sz, pos, sz)
|
||||||
|
os.sleep(0.01)
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pos, sz = src.getPosition(), src.getSize()
|
||||||
|
textProgress(pos / sz, colors.green, colors.gray, "%7.3f%% %8d / %8d", pos * 100 / sz, pos, sz)
|
||||||
|
print()
|
||||||
|
|
|
@ -38,7 +38,7 @@ if #tape == 0 then
|
||||||
elseif #tape ~= 1 then
|
elseif #tape ~= 1 then
|
||||||
print("More than one drive found:")
|
print("More than one drive found:")
|
||||||
for i = 1, #tape do
|
for i = 1, #tape do
|
||||||
print(tape[i])
|
print(peripheral.getName(tape[i]))
|
||||||
end
|
end
|
||||||
print("Input drive name:")
|
print("Input drive name:")
|
||||||
io.write("> ")
|
io.write("> ")
|
||||||
|
|
Loading…
Reference in New Issue