Limnoria/plugins/Conditional
Valentin Lorentz 833af36b08 all plugins: auto-generate READMEs
Starting with this commit, there should be no "original" text
in READMEs.
Instead, the entire text should be in docstrings, and READMEs
should be automatically generated from these docstrings.

Motivation:

* The same help is available both via IRC and in the README
  (although the README can be more detailed, as only the first
  paragraph will be shown on IRC)
* This will allow auto-generating plugin help on docs.limnoria.net
  using the same content as the README, as it's sourced from the
  docstrings

Additionally, this converts all READMEs from Markdown to ReST,
because the documentation already uses ReST, and other docstrings
in the codebase are in ReST for this reason.
2021-04-05 17:42:31 +02:00
..
local Import Conditional from gribble repo 2011-02-20 11:13:57 +01:00
locales Fix msgfmt warnings. 2020-03-26 22:10:28 +01:00
__init__.py all plugins: auto-generate READMEs 2021-04-05 17:42:31 +02:00
config.py Fix neutral pronouns. 2014-04-11 21:56:42 +00:00
messages.pot Squashed commit of the following: 2014-12-20 14:37:27 +01:00
plugin.py src/callbacks.py: use network-specific values. 2019-12-05 21:51:25 +01:00
README.rst all plugins: auto-generate READMEs 2021-04-05 17:42:31 +02:00
test.py Conditional: Rename @iferror to @cerror and simplify its logic to just return a boolean. 2015-11-14 19:28:05 +01:00

Documentation for the Conditional plugin for Supybot

Purpose

Contains numerous conditional commands (such as 'if', 'and', and 'or'), which can be used on their own or with another plugin. Also provides logic operators for writing conditions.

Useful for bot scripting / nested commands.

Usage

This plugin provides logic operators and other commands that enable you to run commands only if a condition is true. Useful for nested commands and scripting.

Commands

cand <cond1> [<cond2> ... <condN>]

Returns true if all conditions supplied evaluate to true.

ceq <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if they are equal.

cerror <testcommand>

Runs <testcommand> and returns true if it raises an error; false otherwise.

cif <condition> <ifcommand> <elsecommand>

Runs <ifcommand> if <condition> evaluates to true, runs <elsecommand> if it evaluates to false. Use other logical operators defined in this plugin and command nesting to your advantage here.

cor <cond1> [<cond2> ... <condN>]

Returns true if any one of conditions supplied evaluates to true.

cxor <cond1> [<cond2> ... <condN>]

Returns true if only one of conditions supplied evaluates to true.

ge <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if <item1> is greater than or equal to <item2>.

gt <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if <item1> is greater than <item2>.

le <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if <item1> is less than or equal to <item2>.

lt <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if <item1> is less than <item2>.

match [--case-insensitive] <item1> <item2>

Determines if <item1> is a substring of <item2>. Returns true if <item1> is contained in <item2>. Will only match case if --case-insensitive is not given.

nceq <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if they are equal.

ne <item1> <item2>

Does a string comparison on <item1> and <item2>. Returns true if they are not equal.

nge <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if <item1> is greater than or equal to <item2>.

ngt <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if <item1> is greater than <item2>.

nle <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if <item1> is less than or equal to <item2>.

nlt <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if <item1> is less than <item2>.

nne <item1> <item2>

Does a numeric comparison on <item1> and <item2>. Returns true if they are not equal.

Configuration

supybot.plugins.Conditional.public

This config variable defaults to "True", is not network-specific, and is not channel-specific.

Determines whether this plugin is publicly visible.