@@ -87,87 +87,102 @@ function PRSchat.initialize()
8787 PRSchat .triggers .chat_trigger_id = tempRegexTrigger (" ^< Chat \\ | (?<sender>.+) > (?<msg>.+)$" , function ()
8888 local chat_lines = {}
8989
90- PRSchat .triggers .chat_line_id = tempRegexTrigger (" .*" , function ()
91- if isPrompt () then
92- local concat_lines = table.concat (chat_lines )
93- local result = concat_lines :sub (1 , - 2 ).. " \n "
94-
95- PRSchat .EMCO :decho (" Chat" , result , false )
96- killTrigger (PRSchat .triggers .chat_line_id )
97- else
98- table.insert (chat_lines , copy2decho ().. " " )
99- end
100- end )
90+ if not PRSchat .triggers .chat_line_id then
91+ PRSchat .triggers .chat_line_id = tempRegexTrigger (" .*" , function ()
92+ if isPrompt () then
93+ local concat_lines = table.concat (chat_lines )
94+ local result = concat_lines :sub (1 , - 2 ).. " \n "
95+
96+ PRSchat .EMCO :decho (" Chat" , result , false )
97+ killTrigger (PRSchat .triggers .chat_line_id )
98+ PRSchat .triggers .chat_line_id = nil
99+ else
100+ table.insert (chat_lines , copy2decho ().. " " )
101+ end
102+ end )
103+ end
101104 end )
102105 end
103106
104107 if not PRSchat .triggers .newbie_trigger_id then
105108 PRSchat .triggers .newbie_trigger_id = tempRegexTrigger (" ^< Newbie \\ | (?<sender>.+) > (?<msg>.+)$" , function ()
106109 local chat_lines = {}
107-
108- PRSchat .triggers .newbie_line_id = tempRegexTrigger (" .*" , function ()
109- if isPrompt () then
110- local concat_lines = table.concat (chat_lines )
111- local result = concat_lines :sub (1 , - 2 ).. " \n "
112-
113- PRSchat .EMCO :decho (" Newbie" , result , false )
114- killTrigger (PRSchat .triggers .newbie_line_id )
115- else
116- table.insert (chat_lines , copy2decho ().. " " )
117- end
118- end )
110+
111+ if not PRSchat .triggers .newbie_line_id then
112+ PRSchat .triggers .newbie_line_id = tempRegexTrigger (" .*" , function ()
113+ if isPrompt () then
114+ local concat_lines = table.concat (chat_lines )
115+ local result = concat_lines :sub (1 , - 2 ).. " \n "
116+
117+ PRSchat .EMCO :decho (" Newbie" , result , false )
118+ killTrigger (PRSchat .triggers .newbie_line_id )
119+ PRSchat .triggers .newbie_line_id = nil
120+ else
121+ table.insert (chat_lines , copy2decho ().. " " )
122+ end
123+ end )
124+ end
119125 end )
120126 end
121127
122128 if not PRSchat .triggers .trade_trigger_id then
123129 PRSchat .triggers .trade_trigger_id = tempRegexTrigger (" ^< Trade \\ | (?<sender>.+) > (?<msg>.+)$" , function ()
124130 local chat_lines = {}
125131
126- PRSchat .triggers .trade_line_id = tempRegexTrigger (" .*" , function ()
127- if isPrompt () then
128- local concat_lines = table.concat (chat_lines )
129- local result = concat_lines :sub (1 , - 2 ).. " \n "
130-
131- PRSchat .EMCO :decho (" Trade" , result , false )
132- killTrigger (PRSchat .triggers .trade_line_id )
133- else
134- table.insert (chat_lines , copy2decho ().. " " )
135- end
136- end )
132+ if not PRSchat .triggers .trade_line_id then
133+ PRSchat .triggers .trade_line_id = tempRegexTrigger (" .*" , function ()
134+ if isPrompt () then
135+ local concat_lines = table.concat (chat_lines )
136+ local result = concat_lines :sub (1 , - 2 ).. " \n "
137+
138+ PRSchat .EMCO :decho (" Trade" , result , false )
139+ killTrigger (PRSchat .triggers .trade_line_id )
140+ PRSchat .triggers .trade_line_id = nil
141+ else
142+ table.insert (chat_lines , copy2decho ().. " " )
143+ end
144+ end )
145+ end
137146 end )
138147 end
139148
140149 if not PRSchat .triggers .local_trigger_id then
141150 PRSchat .triggers .local_trigger_id = tempRegexTrigger (" ^(?<sender>.+) say(?<s>s)?, '(?<msg>.+)$" , function ()
142151 local chat_lines = {}
143152
144- PRSchat .triggers .local_line_id = tempRegexTrigger (" .+" , function ()
145- table.insert (chat_lines , copy2decho ().. " " )
146- if string .ends (line , " '" ) then
147- local concat_lines = table.concat (chat_lines )
148- local result = concat_lines :sub (1 , - 2 ).. " \n "
149-
150- PRSchat .EMCO :decho (" Local" , result , false )
151- killTrigger (PRSchat .triggers .local_line_id )
152- end
153- end )
153+ if not PRSchat .triggers .local_line_id then
154+ PRSchat .triggers .local_line_id = tempRegexTrigger (" .+" , function ()
155+ table.insert (chat_lines , copy2decho ().. " " )
156+ if string .ends (line , " '" ) then
157+ local concat_lines = table.concat (chat_lines )
158+ local result = concat_lines :sub (1 , - 2 ).. " \n "
159+
160+ PRSchat .EMCO :decho (" Local" , result , false )
161+ killTrigger (PRSchat .triggers .local_line_id )
162+ PRSchat .triggers .local_line_id = nil
163+ end
164+ end )
165+ end
154166 end )
155167 end
156168
157169 if not PRSchat .triggers .tell_trigger_id then
158170 PRSchat .triggers .tell_trigger_id = tempRegexTrigger (" ^(?<from>.+) tell(?<s>s)? (?<to>\\ w+), '(?<msg>.+)$" , function ()
159171 local chat_lines = {}
160-
161- PRSchat .triggers .tell_line_id = tempRegexTrigger (" .+" , function ()
162- table.insert (chat_lines , copy2decho ().. " " )
163- if string .ends (line , " '" ) then
164- local concat_lines = table.concat (chat_lines )
165- local result = concat_lines :sub (1 , - 2 ).. " \n "
166-
167- PRSchat .EMCO :decho (" Tell" , result , false )
168- killTrigger (PRSchat .triggers .tell_line_id )
169- end
170- end )
172+
173+ if not PRSchat .triggers .tell_line_id then
174+ PRSchat .triggers .tell_line_id = tempRegexTrigger (" .+" , function ()
175+ table.insert (chat_lines , copy2decho ().. " " )
176+ if string .ends (line , " '" ) then
177+ local concat_lines = table.concat (chat_lines )
178+ local result = concat_lines :sub (1 , - 2 ).. " \n "
179+
180+ PRSchat .EMCO :decho (" Tell" , result , false )
181+ killTrigger (PRSchat .triggers .tell_line_id )
182+ PRSchat .triggers .tell_line_id = nil
183+ end
184+ end )
185+ end
171186 end )
172187 end
173188end
0 commit comments