Skip to content

Commit c5e47c3

Browse files
committed
Added option to strip colour codes
1 parent a63ba3f commit c5e47c3

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

resources/irc/acl.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
<command name="!password" level="4" echoChannelOnly="true" />
4848
<command name="!gravity" level="3" echoChannelOnly="true" />
4949
<command name="!weather" level="3" echoChannelOnly="true" />
50-
<command name="!server" level="0" echoChannelOnly="false" />
51-
<command name="!zone" level="0" echoChannelOnly="false" />
52-
<command name="!refreshall" level="4" echoChannelOnly="false" />
53-
<command name="!refresh" level="4" echoChannelOnly="false" />
54-
<command name="!checkmap" level="2" echoChannelOnly="false" />
55-
<command name="!country" level="2" echoChannelOnly="false" />
50+
<command name="!server" level="0" echoChannelOnly="true" />
51+
<command name="!zone" level="0" echoChannelOnly="true" />
52+
<command name="!refreshall" level="4" echoChannelOnly="true" />
53+
<command name="!refresh" level="4" echoChannelOnly="true" />
54+
<command name="!checkmap" level="2" echoChannelOnly="true" />
55+
<command name="!country" level="2" echoChannelOnly="true" />
5656
</acl>

resources/irc/meta.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@
7272
desc="Should all irc messages be sent to the server?"
7373
/>
7474

75+
<!-- Should ingame messages be stripped from their colour codes for display on irc? -->
76+
<setting
77+
name="*irc-stripcolourcodes"
78+
value="false"
79+
friendlyname="Strip colour codes"
80+
examples="true,false"
81+
desc="Should ingame messages be stripped from their colour codes for display on irc?"
82+
/>
83+
7584
<!-- Event logging -->
7685
<setting name="*irc-onResourceStart" value="true" friendlyname="output onResourceStart event" examples="true,false" />
7786
<setting name="*irc-onResourceStop" value="true" friendlyname="output onResourceStop event" examples="true,false" />

resources/irc/scripts/servers.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ function func_outputIRC (message)
127127
end
128128
return true
129129
end
130+
if get("*irc-stripcolourcodes") == "true" then
131+
message = string.gsub(message,"#%x%x%x%x%x%x","")
132+
end
130133
for i,channel in pairs (ircGetChannels()) do
131134
if ircIsEchoChannel(channel) then
132135
local server = getElementParent(channel)

0 commit comments

Comments
 (0)