diff options
author | ubq323 <ubq323@ubq323.website> | 2022-08-04 03:16:25 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-08-04 03:16:25 +0100 |
commit | a502e58c63fb560c534c4557f9561ad091e2ece1 (patch) | |
tree | 935d99e0e55721b0653ac15141afe6a048d55f5a | |
parent | ce59711d67658bf550772158087923db5a716d51 (diff) |
chat
-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 |