autohelp.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:piqueserver 作者: piqueserver 项目源码 文件源码
def apply_script(protocol, connection, config):
    def send_help_nick(connection):
        connection.protocol.send_chat(
            "TO CHANGE YOUR NAME: Start Menu-> "
            "All Programs-> Ace of Spades-> Configuration")
        connection.protocol.irc_say("* Sent nick help to %s" % connection.name)

    def send_help_airstrike(connection):
        connection.protocol.send_chat(
            "TO USE AN AIRSTRIKE: Once you have 15 points, "
            "get a 6 killstreak ->                  "
            "Then type /airstrike G4 if you want the strike to hit G4")
        connection.protocol.irc_say(
            "* Sent airstrike help to %s" % connection.name)

    class AutoHelpConnection(connection):

        def on_chat(self, value, global_message):
            if deuce_howto_match(self, value):
                reactor.callLater(1.0, send_help_nick, self)
            if airstrike_howto_match(self, value):
                reactor.callLater(1.0, send_help_airstrike, self)
            return connection.on_chat(self, value, global_message)
    return protocol, AutoHelpConnection
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号