summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2017-03-31 21:51:44 -0500
committercheapie <no-email-for-you@example.com>2017-03-31 21:51:44 -0500
commitea492d89d08bc48a413f2c29f6a143c2f308070e (patch)
tree759bc2dccb7f3e7299d50077246dd8fc63ada93d
parent34e7ad0b1ef7886fd325a9acc5b8c3aa3f5fdbd0 (diff)
downloadchat6-ea492d89d08bc48a413f2c29f6a143c2f308070e.tar
chat6-ea492d89d08bc48a413f2c29f6a143c2f308070e.tar.gz
chat6-ea492d89d08bc48a413f2c29f6a143c2f308070e.tar.bz2
chat6-ea492d89d08bc48a413f2c29f6a143c2f308070e.tar.xz
chat6-ea492d89d08bc48a413f2c29f6a143c2f308070e.zip
Make compatible with plain Lua
-rw-r--r--init.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/init.lua b/init.lua
index 29d54db..a7abe63 100644
--- a/init.lua
+++ b/init.lua
@@ -43,7 +43,7 @@ minetest.register_on_receiving_chat_messages(function(message)
end
if string.sub(message,1,1) == "<" then
msgtype = "channel"
- user,text = string.match(message,"^<(%g*)> (.*)$")
+ user,text = string.match(message,"^<([^%c ]*)> (.*)$")
if not user then
msgtype = "special"
text = message
@@ -53,18 +53,17 @@ minetest.register_on_receiving_chat_messages(function(message)
msgtype = "highlight_channel"
end
elseif string.sub(message,1,3) == "***" then
- user,msgtype,text = string.match(message,"^*** (%g*) (%g*) the game. ?(.*)$")
+ user,msgtype,text = string.match(message,"^*** ([^%c ]*) ([^%c ]*) the game. ?(.*)$")
if not text or text == "" then
text = "(Client Quit)"
end
elseif string.sub(message,1,1) == "*" then
msgtype = "action"
- user,text = string.match(message,"^* (%g*) (.*)$")
+ user,text = string.match(message,"^* ([^%c ]*) (.*)$")
if not user then
msgtype = "special"
text = message
- end
- if (user == player_name) or (string.match(user,"^(.*)@") == player_name) then
+ elseif (user == player_name) or (string.match(user,"^(.*)@") == player_name) then
msgtype = "sent_action"
elseif string.find(text,player_name) then
msgtype = "highlight_action"