diff options
Diffstat (limited to 'chat.lua')
-rw-r--r-- | chat.lua | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -57,6 +57,10 @@ local function maybe_sci(x) if #tostring(x) >= scorewidth then return sci(x) else return x end end +local function isnan(x) + return x ~= x +end + -- drawing -- lb @@ -121,6 +125,7 @@ while true do local _,user,msg = os.pullEvent"chat_message" local s = score(msg) userscores[user] = userscores[user] + s + if isnan(userscores[user]) then userscores[user] = 0 end p(M,string.format("(%d) <%s> %s",s,user,msg)) end |