Exemplo n.º 1
0
conf.registerChannelValue(
    Trivia, 'numHints',
    registry.PositiveInteger(
        3, _("""The number of hints to be given for
        each question""")))

conf.registerChannelValue(
    Trivia, 'timeout',
    registry.PositiveInteger(
        90, _("""The number of seconds to allow for
        each question""")))

conf.registerChannelValue(
    Trivia, 'hintPercentage',
    registry.Probability(
        0.25,
        _("""The fraction of the answer that
        should be revealed with each hint""")))

conf.registerChannelValue(
    Trivia, 'flexibility',
    registry.PositiveInteger(
        8,
        _("""The flexibility of the trivia answer
        checker.  One typo will be allowed for every __ characters.""")))

conf.registerChannelValue(
    Trivia, 'color',
    registry.PositiveInteger(
        10, _("""The mIRC color to use for trivia
        questions""")))
    registry.PositiveInteger(
        1, """Determines the length of the smallest chain
    which the markov command will generate."""))
conf.registerChannelValue(
    ArtificialIntelligence, 'maxAttempts',
    registry.PositiveInteger(
        1, """Determines the maximum number of times the
    bot will attempt to generate a chain that meets or exceeds the size set in
    minChainLength."""))

conf.registerGroup(ArtificialIntelligence, 'randomSpeaking')
conf.registerChannelValue(
    ArtificialIntelligence.randomSpeaking, 'probability',
    registry.Probability(
        0, """Determines the probability that
    will be checked against to determine whether the bot should randomly say
    something.  If 0, the bot will never say anything on it's own.  If 1, the
    bot will speak every time we make a check."""))
conf.registerChannelValue(
    ArtificialIntelligence.randomSpeaking, 'maxDelay',
    registry.PositiveInteger(
        10, """Determines the upper bound for
    how long the bot will wait before randomly speaking.  The delay is a
    randomly generated number of seconds below the value of this config
    variable."""))
conf.registerChannelValue(
    ArtificialIntelligence.randomSpeaking, 'throttleTime',
    registry.PositiveInteger(
        300, """Determines the minimum
    number of seconds between the bot randomly speaking."""))
conf.registerChannelValue(
Exemplo n.º 3
0
    ))

# amsg
conf.registerGlobalValue(
    Sigyn, 'amsgMinium',
    registry.PositiveInteger(
        1, """length of text necessary to start amsg check"""))
conf.registerGlobalValue(
    Sigyn, 'amsgPermit',
    registry.Integer(-1, """number of channels allowed with same message"""))
conf.registerGlobalValue(
    Sigyn, 'amsgLife',
    registry.PositiveInteger(1, """life of channels in seconds"""))
conf.registerGlobalValue(
    Sigyn, 'amsgPercent',
    registry.Probability(1.00,
                         """percent of similarity between two messages"""))

# service notices

# user nick changes snote
conf.registerGlobalValue(
    Sigyn, 'nickChangePermit',
    registry.Integer(
        -1,
        """number of server notices (nick changes) allowed for a given period"""
    ))
conf.registerGlobalValue(
    Sigyn, 'nickChangeLife',
    registry.PositiveInteger(1, """life of notices in seconds"""))

# channel flood snote
Exemplo n.º 4
0
conf.registerChannelValue(ChanTracker, 'lowFloodLife',
registry.Integer(13,"""Duration of messages's life in lowFlood counter, in seconds"""))
conf.registerChannelValue(ChanTracker, 'lowFloodMode',
registry.String('q',"""mode used by the bot when low flood detection is triggered"""))
conf.registerChannelValue(ChanTracker, 'lowFloodDuration',
registry.PositiveInteger(180,"""punishment duration in seconds"""))
conf.registerChannelValue(ChanTracker, 'lowFloodComment',
registry.String('low flood detected',"""comment added on mode changes database, empty for no comment"""))

# repeat detection
conf.registerChannelValue(ChanTracker, 'repeatPermit',
registry.Integer(-1,"""Number of repeated text allowed, -1 to disable"""))
conf.registerChannelValue(ChanTracker, 'repeatLife',
registry.PositiveInteger(12,"""Duration of messages's life in repeatPermit counter in seconds"""))
conf.registerChannelValue(ChanTracker, 'repeatPercent',
registry.Probability(0.85,"""percent of similarity needed between previous and current message to trigger a repeat count"""))
conf.registerChannelValue(ChanTracker, 'repeatMode',
registry.String('q',"""mode used by the bot when repeat detection is triggered"""))
conf.registerChannelValue(ChanTracker, 'repeatDuration',
registry.PositiveInteger(180,"""punishment duration  in seconds"""))
conf.registerChannelValue(ChanTracker, 'repeatComment',
registry.String('repeat detected',"""comment added on mode changes database, empty for no comment"""))

# mass repeat detection
conf.registerChannelValue(ChanTracker, 'massRepeatChars',
registry.PositiveInteger(40,"""number of chars needed to enter massRepeat detection"""))
conf.registerChannelValue(ChanTracker, 'massRepeatPermit',
registry.Integer(-1,"""Number of repeated text allowed, -1 to disable, tracks message repetition from various sources on the given channel"""))
conf.registerChannelValue(ChanTracker, 'massRepeatLife',
registry.PositiveInteger(12,"""Duration of messages's life in massRepeat counter, in seconds"""))
conf.registerChannelValue(ChanTracker, 'massRepeatPercent',
Exemplo n.º 5
0
     registry.Boolean(False, """Does a new hunt automatically start when the previous one is over?"""))

conf.registerChannelValue(DuckHunt, 'ducks',
     registry.Integer(5, """Number of ducks during a hunt?"""))

conf.registerChannelValue(DuckHunt, 'minthrottle', 
     registry.Integer(30, """The minimum amount of time before a new duck may be launched (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'maxthrottle', 
     registry.Integer(300, """The maximum amount of time before a new duck may be launched (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'reloadTime', 
     registry.Integer(5, """The time it takes to reload your rifle once you have shot (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'missProbability', 
     registry.Probability(0.2, """The probability to miss the duck"""))

conf.registerChannelValue(DuckHunt, 'kickMode',
     registry.Boolean(False, """If someone shoots when there is no duck, should he be kicked from the channel? (this requires the bot to be op on the channel)"""))

conf.registerChannelValue(DuckHunt, 'autoFriday',
     registry.Boolean(True, """ Do we need to automatically launch more ducks on friday? """))

conf.registerChannelValue(DuckHunt, 'evilMode',
     registry.Boolean(False, """ Both good and evil ducks? """))

conf.registerChannelValue(DuckHunt, 'evilDuckProbability',
     registry.Probability(0.35, """The probability to get an evil duck"""))

conf.registerChannelValue(DuckHunt, 'goodDuckPointValue',
     registry.Integer(1, """Number of points of an good duck"""))
Exemplo n.º 6
0
conf.registerChannelValue(
    Jeopardy,
    "timeout",
    registry.Integer(
        90,
        _("""The number of seconds to allow for each question"""),
    ),
)

conf.registerChannelValue(
    Jeopardy,
    "hintPercentage",
    registry.Probability(
        0.25,
        _("""The fraction of the answer that should be revealed with each hint"""
          ),
    ),
)

conf.registerChannelValue(
    Jeopardy,
    "hintReduction",
    registry.Probability(
        0.5,
        _("""The percentage by which to reduce points with each hint reveal"""
          ),
    ),
)

conf.registerChannelValue(
Exemplo n.º 7
0
                        'c',
                        journalName=journalName,
                        maxmods=self.maximumModifications())


registerGroup(supybot.databases, 'types')
registerGlobalValue(
    supybot.databases.types, 'cdb',
    CDB(
        True, """Determines
    whether CDB databases will be allowed as a database implementation."""))
registerGlobalValue(
    supybot.databases.types.cdb, 'maximumModifications',
    registry.Probability(
        0.5, """Determines how often CDB databases will have
    their modifications flushed to disk.  When the number of modified records
    is greater than this fraction of the total number of records, the database
    will be entirely flushed to disk."""))

# XXX Configuration variables for dbi, sqlite, flat, mysql, etc.

###
# Protocol information.
###
originalIsNick = ircutils.isNick


def isNick(s, strictRfc=None, **kw):
    if strictRfc is None:
        strictRfc = supybot.protocols.irc.strictRfc()
    return originalIsNick(s, strictRfc=strictRfc, **kw)
Exemplo n.º 8
0
Markovgen = conf.registerPlugin('Markovgen')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Markovgen, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
    Markovgen, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether the plugin is enabled
    on a channel. This defaults to False to avoid useless resources
    consumption.""")))
conf.registerChannelValue(
    Markovgen, 'probability',
    registry.Probability(
        0,
        _("""Determine the probability the bot has to
    reply to a message.""")))
conf.registerChannelValue(
    Markovgen, 'stripRelayedNick',
    registry.Boolean(
        True,
        _("""Determines whether the bot will strip
    strings like <XXX> at the beginning of messages.""")))

conf.registerGroup(Markovgen, 'onNick')
conf.registerChannelValue(
    Markovgen.onNick, 'probability',
    registry.Probability(
        0,
        _("""Determine the probability the bot has to
    reply to a message containing its nick.""")))
Exemplo n.º 9
0
Markov = conf.registerPlugin('Markov')
conf.registerPlugin('Markov')
conf.registerChannelValue(Markov, 'ignoreBotCommands',
    registry.Boolean(False, """Determines whether messages addressed to the
    bot are ignored."""))
conf.registerChannelValue(Markov, 'minChainLength',
    registry.PositiveInteger(1, """Determines the length of the smallest chain
    which the markov command will generate."""))
conf.registerChannelValue(Markov, 'maxAttempts',
    registry.PositiveInteger(1, """Determines the maximum number of times the
    bot will attempt to generate a chain that meets or exceeds the size set in
    minChainLength."""))

conf.registerGroup(Markov, 'randomSpeaking')
conf.registerChannelValue(Markov.randomSpeaking,
    'probability', registry.Probability(0, """Determines the probability that
    will be checked against to determine whether the bot should randomly say
    something.  If 0, the bot will never say anything on it's own.  If 1, the
    bot will speak every time we make a check."""))
conf.registerChannelValue(Markov.randomSpeaking,
    'maxDelay', registry.PositiveInteger(10, """Determines the upper bound for
    how long the bot will wait before randomly speaking.  The delay is a
    randomly generated number of seconds below the value of this config
    variable."""))
conf.registerChannelValue(Markov.randomSpeaking,
    'throttleTime', registry.PositiveInteger(300, """Determines the minimum
    number of seconds between the bot randomly speaking."""))


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemplo n.º 10
0
    DuckHunt, 'maxthrottle',
    registry.Integer(
        300,
        """The maximum amount of time before a new duck may be launched (in seconds)"""
    ))

conf.registerChannelValue(
    DuckHunt, 'reloadTime',
    registry.Integer(
        5,
        """The time it takes to reload your rifle once you have shot (in seconds)"""
    ))

conf.registerChannelValue(
    DuckHunt, 'missProbability',
    registry.Probability(0.2, """The probability to miss the duck"""))

conf.registerChannelValue(
    DuckHunt, 'kickMode',
    registry.Boolean(
        True,
        """If someone shoots when there is no duck, should he be kicked from the channel? (this requires the bot to be op on the channel)"""
    ))

conf.registerChannelValue(
    DuckHunt, 'autoFriday',
    registry.Boolean(
        True,
        """ Do we need to automatically launch more ducks on friday? """))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemplo n.º 11
0
conf.registerChannelValue(
    Hailo, 'hailoBrain',
    registry.String("~/hailo.sqlite",
                    """where brain is located, full path is better"""))

conf.registerChannelValue(
    Hailo, 'learn',
    registry.Boolean(False, """learn from sentences sent to channel"""))

conf.registerChannelValue(Hailo, 'replyWhenAddressed',
                          registry.Boolean(False, """reply when addressed"""))

conf.registerChannelValue(
    Hailo, 'replyPercent',
    registry.Probability(
        0.00,
        """percent of chance that bot reply to a sentence, 0.00 means disabled"""
    ))

conf.registerChannelValue(
    Hailo, 'checkSimilarity',
    registry.Boolean(
        True, """enable check about answer similar to given sentence"""))

conf.registerChannelValue(
    Hailo, 'similarity',
    registry.Probability(
        0.85,
        """prevent bot to reply with a message similar to the one given"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemplo n.º 12
0
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = lambda x:x

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Markovgen', True)


Markovgen = conf.registerPlugin('Markovgen')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Markovgen, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(Markovgen, 'enable',
    registry.Boolean(False, _("""Determines whether the plugin is enabled
    on a channel. This defaults to False to avoid useless resources
    consumption.""")))
conf.registerChannelValue(Markovgen, 'probability',
    registry.Probability(0, _("""Determine the probability the bot has to
    reply to a message.""")))
conf.registerChannelValue(Markovgen, 'stripRelayedNick',
    registry.Boolean(True, _("""Determines whether the bot will strip
    strings like <XXX> at the beginning of messages.""")))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: