1
0
Fork 0

Tape fixes

This commit is contained in:
Casey 2023-10-18 00:54:19 +03:00
parent 9e44c53e42
commit 135b606686
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
2 changed files with 10 additions and 3 deletions

View File

@ -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()

View File

@ -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("> ")