diff --git a/tapeget.lua b/tapeget.lua index 5e8b79d..cb89976 100644 --- a/tapeget.lua +++ b/tapeget.lua @@ -1,10 +1,10 @@ local args = { ... } -local shouldSeek = true +local seekTo = 0 local driveName = nil if args[1] == "-S" then - shouldSeek = false table.remove(args, 1) + seekTo = tonumber(table.remove(args, 1)) end if args[1] == "-D" then table.remove(args, 1) @@ -93,10 +93,9 @@ if length > tape.getSize() then end tape.stop() -if shouldSeek then - tape.seek(-tape.getSize()) - tape.stop() -end +tape.seek(-tape.getSize()) +tape.seek(seekTo) +tape.stop() local _, y = term.getCursorPos() local written = 0 @@ -121,7 +120,5 @@ term.clearLine() print("Written "..n_to_kib(written)) tape.stop() -if shouldSeek then - tape.seek(-tape.getSize()) - tape.stop() -end +tape.seek(-tape.getSize()) +tape.stop()