mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Updated the linkage between the NanoTrasen IRC bot and the server.
- Server will now send adminhelps to the admin channel, with information if there is no admins online. - Server will inform the admin channel if the last admin online logs out. - When a round ends, the server will alert the main channel, supplying some statistics. Additionally, laid the groundwork for an external scripts system. This is fully configurable/togglable in the config.txt file. Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
14
code/modules/ext_scripts/irc.dm
Normal file
14
code/modules/ext_scripts/irc.dm
Normal file
@@ -0,0 +1,14 @@
|
||||
/proc/send2irc(var/channel, var/msg)
|
||||
if(config.use_irc_bot)
|
||||
ext_python("ircbot_message.py", "[channel] [msg]")
|
||||
return
|
||||
|
||||
/proc/send2mainirc(var/msg)
|
||||
if(config.use_irc_bot && config.main_irc)
|
||||
ext_python("ircbot_message.py", "[config.main_irc] [msg]")
|
||||
return
|
||||
|
||||
/proc/send2adminirc(var/msg)
|
||||
if(config.use_irc_bot && config.admin_irc)
|
||||
ext_python("ircbot_message.py", "[config.admin_irc] [msg]")
|
||||
return
|
||||
9
code/modules/ext_scripts/python.dm
Normal file
9
code/modules/ext_scripts/python.dm
Normal file
@@ -0,0 +1,9 @@
|
||||
/proc/ext_python(var/script, var/args, var/scriptsprefix = 1)
|
||||
if(scriptsprefix) script = "scripts/" + script
|
||||
|
||||
if(world.system_type == MS_WINDOWS)
|
||||
script = replacetext(script, "/", "\\")
|
||||
|
||||
var/command = config.python_path + " " + script + " " + args
|
||||
|
||||
return shell(command)
|
||||
Reference in New Issue
Block a user