mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Adds support for bots which use world.Export() for server-to-bot communication
This commit is contained in:
@@ -153,6 +153,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
|
||||||
@@ -479,6 +480,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)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
/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.use_lib_nudge)
|
if(config.irc_bot_export)
|
||||||
var/nudge_lib
|
world.Export("http://[config.irc_bot_host]:45678?[list2params(list(pwd=config.comms_password, chan=channel, mesg=msg))]")
|
||||||
if(world.system_type == MS_WINDOWS)
|
|
||||||
nudge_lib = "lib\\nudge.dll"
|
|
||||||
else
|
|
||||||
nudge_lib = "lib/nudge.so"
|
|
||||||
|
|
||||||
spawn(0)
|
|
||||||
call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]")
|
|
||||||
else
|
else
|
||||||
spawn(0)
|
if(config.use_lib_nudge)
|
||||||
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
|
var/nudge_lib
|
||||||
|
if(world.system_type == MS_WINDOWS)
|
||||||
|
nudge_lib = "lib\\nudge.dll"
|
||||||
|
else
|
||||||
|
nudge_lib = "lib/nudge.so"
|
||||||
|
|
||||||
|
spawn(0)
|
||||||
|
call(nudge_lib, "nudge")("[config.comms_password]","[config.irc_bot_host]","[channel]","[msg]")
|
||||||
|
else
|
||||||
|
spawn(0)
|
||||||
|
ext_python("ircbot_message.py", "[config.comms_password] [config.irc_bot_host] [channel] [msg]")
|
||||||
return
|
return
|
||||||
|
|
||||||
/proc/send2mainirc(var/msg)
|
/proc/send2mainirc(var/msg)
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ LOG_PDA
|
|||||||
## disconnect players who did nothing during 10 minutes
|
## disconnect players who did nothing during 10 minutes
|
||||||
# KICK_INACTIVE
|
# KICK_INACTIVE
|
||||||
|
|
||||||
## Use Mentors instead of Moderators. Mentors are designed with the idea that
|
## Use Mentors instead of Moderators. Mentors are designed with the idea that
|
||||||
###they help in pushing new people to be better at roleplay. If you uncomment
|
###they help in pushing new people to be better at roleplay. If you uncomment
|
||||||
###this it will reduce the rights that your mods have.
|
###this it will reduce the rights that your mods have.
|
||||||
#MENTORS
|
#MENTORS
|
||||||
|
|
||||||
|
|
||||||
## probablities for game modes chosen in "secret" and "random" modes
|
## probablities for game modes chosen in "secret" and "random" modes
|
||||||
##
|
##
|
||||||
## default probablity is 1, increase to make that mode more likely to be picked
|
## default probablity is 1, increase to make that mode more likely to be picked
|
||||||
@@ -100,9 +100,9 @@ TRAITOR_SCALING
|
|||||||
## if objectives are disabled
|
## if objectives are disabled
|
||||||
#OBJECTIVES_DISABLED
|
#OBJECTIVES_DISABLED
|
||||||
|
|
||||||
## make ERT's be only called by admins
|
## make ERT's be only called by admins
|
||||||
#ERT_ADMIN_ONLY
|
#ERT_ADMIN_ONLY
|
||||||
|
|
||||||
## If security is prohibited from being most antagonists
|
## If security is prohibited from being most antagonists
|
||||||
#PROTECT_ROLES_FROM_ANTAGONIST
|
#PROTECT_ROLES_FROM_ANTAGONIST
|
||||||
|
|
||||||
@@ -238,6 +238,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
|
||||||
|
|
||||||
@@ -265,7 +268,7 @@ REQ_CULT_GHOSTWRITER 6
|
|||||||
CHARACTER_SLOTS 10
|
CHARACTER_SLOTS 10
|
||||||
|
|
||||||
## Uncomment to use overmap system for zlevel travel
|
## Uncomment to use overmap system for zlevel travel
|
||||||
#USE_OVERMAP
|
#USE_OVERMAP
|
||||||
|
|
||||||
## Defines which Z-levels the station exists on.
|
## Defines which Z-levels the station exists on.
|
||||||
STATION_LEVELS 1
|
STATION_LEVELS 1
|
||||||
|
|||||||
Reference in New Issue
Block a user