From 1877604754293ddfd7b66311ae7628bac8ca8229 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 4 Aug 2022 02:38:34 +0100 Subject: chat --- chat.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chat.lua b/chat.lua index d91e45d..9e02b1e 100644 --- a/chat.lua +++ b/chat.lua @@ -50,13 +50,15 @@ local function draw_lb(W,scores) end table.sort(thescores,function(a,b) return a.score < b.score end) for i=1,10 do + if not thescores[i] then break end + local name,score = thescores[i].name, thescores[i].score -- name W.setTextColor(colors.white) W.setCursorPos(5,i+1) W.write(name) -- score - W.setTextColor(colors.blue) + W.setTextColor(colors.red) W.setCursorPos(w-scorewidth,i+1) W.write(pad_r(score,scorewidth)) end -- cgit v1.2.3