send2irc Multi-Host upgrade

Allows for send2irc to send to multiple hosts.
This commit is contained in:
Tigercat2000
2016-02-11 11:24:30 -08:00
parent 0f6717530d
commit d6db130909
3 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -135,7 +135,7 @@
var/comms_password = ""
var/use_irc_bot = 0
var/irc_bot_host = ""
var/list/irc_bot_host = list()
var/main_irc = ""
var/admin_irc = ""
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
@@ -458,7 +458,7 @@
config.comms_password = value
if("irc_bot_host")
config.irc_bot_host = value
config.irc_bot_host = text2list(value, ";")
if("main_irc")
config.main_irc = value
+4 -3
View File
@@ -1,7 +1,8 @@
/proc/send2irc(var/channel, var/msg)
if(config.use_irc_bot && config.irc_bot_host)
spawn(0)
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
if(config.use_irc_bot && config.irc_bot_host.len)
for(var/IP in config.irc_bot_host)
spawn(0)
ext_python("ircbot_message.py", "[config.comms_password] [IP] [channel] [msg]")
return
/proc/send2mainirc(var/msg)
+2 -2
View File
@@ -245,8 +245,8 @@ GHOST_INTERACTION
## Uncomment to enable sending data to the IRC bot.
#USE_IRC_BOT
## Host where the IRC bot is hosted. Port 45678 needs to be open.
#IRC_BOT_HOST localhost
## Host(s) where the IRC bot is hosted. Seperate IP's by ;. Port 45678 needs to be open.
#IRC_BOT_HOST 127.0.0.1;localhost
## IRC channel to send information to. Leave blank to disable.
#MAIN_IRC #main