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:
Mloc-Argent
2013-07-02 23:41:40 +01:00
parent 12a79e4ade
commit cf4bd39f6e
11 changed files with 100 additions and 35 deletions

View 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

View 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)