From 58e4631df82e713d806f4c1f0dcf19492456575b Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 17 Oct 2023 16:28:20 +0300 Subject: [PATCH] statusbar --- tape-playlist.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tape-playlist.lua b/tape-playlist.lua index 802e0d0..7f70929 100644 --- a/tape-playlist.lua +++ b/tape-playlist.lua @@ -29,7 +29,7 @@ local screen_w, screen_h = term.getSize() parallel.waitForAll( function() while running do - for i = 1, math.min(screen_h, 48) do + for i = 1, math.min(screen_h - 1, 48) do term.setCursorPos(1, i) term.clearLine() local song = table_of_contents[i] @@ -37,6 +37,8 @@ function() term.write(string.format("#%2d %9s %s", i, bytes2time(song.length), song.title)) end end + term.setCursorPos(1, screen_h) + term.write(string.format("%s - %d", drive.getState(), drive.getPosition())) os.sleep(0.1) end end,