From bf360700d3d6413b377bf5c6680fd04e12c059ed Mon Sep 17 00:00:00 2001 From: Ollo Date: Sat, 13 Feb 2021 15:39:43 +0100 Subject: [PATCH] Different way to access table --- telnet.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/telnet.lua b/telnet.lua index 8138adb..cd30e31 100644 --- a/telnet.lua +++ b/telnet.lua @@ -26,9 +26,13 @@ function startTelnetServer() end) c:on("sent", function() if (#lines > 0) then - local localstr = table.remove(lines, 1) - print( tostring(localstr) ) - telnetClient:send(localstr) + l1=nil + for k,v in pairs(lines) do if (k==1) then l1=v end end + if (l1 ~= nil) then + table.remove(lines, 1) + print( tostring(l1) ) + telnetClient:send(l1) + end end end) print("Welcome to the Wordclock.")