From 672ed192e32bbc52ef265126ac45aef9bcf4681b Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Thu, 29 Dec 2022 11:12:12 +0100 Subject: [PATCH] Added better text formatting. --- quantum-beacon.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/quantum-beacon.lua b/quantum-beacon.lua index 0598e20..bcceb88 100644 --- a/quantum-beacon.lua +++ b/quantum-beacon.lua @@ -54,27 +54,29 @@ end local function clearMessageLine() local _, h = term.getSize() - term.setCursorPos(1, h - 1) term.setBackgroundColor(colors.gray) - term.clearLine() + for i = 0, 3 do + term.setCursorPos(1, h - i) + term.clearLine() + end end local function showError(msg) clearMessageLine() local _, h = term.getSize() - term.setCursorPos(2, h - 1) + term.setCursorPos(1, h - 2) term.setBackgroundColor(colors.gray) term.setTextColor(colors.red) - term.write(msg) + write(msg) end local function showMessage(msg) clearMessageLine() local _, h = term.getSize() - term.setCursorPos(2, h - 1) + term.setCursorPos(1, h - 2) term.setBackgroundColor(colors.gray) term.setTextColor(colors.lightBlue) - term.write(msg) + write(msg) end local function getPeripheralOrWait(name)