Merge pull request #9857 from GinjaNinja32/bot

Adds support for bots which use world.Export() for server-to-bot communication
This commit is contained in:
Ccomp5950
2015-06-18 13:46:50 -04:00
3 changed files with 21 additions and 11 deletions

View File

@@ -154,6 +154,7 @@
var/use_irc_bot = 0 var/use_irc_bot = 0
var/irc_bot_host = "" var/irc_bot_host = ""
var/irc_bot_export = 0 // whether the IRC bot in use is a Bot32 (or similar) instance; Bot32 uses world.Export() instead of nudge.py/libnudge
var/main_irc = "" var/main_irc = ""
var/admin_irc = "" var/admin_irc = ""
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
@@ -483,6 +484,9 @@
if("use_irc_bot") if("use_irc_bot")
use_irc_bot = 1 use_irc_bot = 1
if("irc_bot_export")
irc_bot_export = 1
if("ticklag") if("ticklag")
Ticklag = text2num(value) Ticklag = text2num(value)

View File

@@ -1,5 +1,8 @@
/proc/send2irc(var/channel, var/msg) /proc/send2irc(var/channel, var/msg)
if(config.use_irc_bot && config.irc_bot_host) if(config.use_irc_bot && config.irc_bot_host)
if(config.irc_bot_export)
world.Export("http://[config.irc_bot_host]:45678?[list2params(list(pwd=config.comms_password, chan=channel, mesg=msg))]")
else
if(config.use_lib_nudge) if(config.use_lib_nudge)
var/nudge_lib var/nudge_lib
if(world.system_type == MS_WINDOWS) if(world.system_type == MS_WINDOWS)

View File

@@ -242,6 +242,9 @@ USEALIENWHITELIST
## Uncomment to enable sending data to the IRC bot. ## Uncomment to enable sending data to the IRC bot.
#USE_IRC_BOT #USE_IRC_BOT
## Uncomment if the IRC bot requires using world.Export() instead of nudge.py/libnudge
#IRC_BOT_EXPORT
## Host where the IRC bot is hosted. Port 45678 needs to be open. ## Host where the IRC bot is hosted. Port 45678 needs to be open.
#IRC_BOT_HOST localhost #IRC_BOT_HOST localhost