2021-04-05 17:29:49 +02:00
.. _plugin-Utilities:
Documentation for the Utilities plugin for Supybot
==================================================
Purpose
-------
2021-12-04 02:50:28 +01:00
2021-04-05 17:29:49 +02:00
Various utility commands, mostly useful for manipulating nested commands.
Usage
-----
2021-12-04 02:50:28 +01:00
2021-04-05 17:29:49 +02:00
Provides useful commands for bot scripting / command nesting.
2021-04-05 22:56:40 +02:00
.. _commands-Utilities:
2021-04-05 17:29:49 +02:00
Commands
--------
2021-12-04 02:50:28 +01:00
2021-04-17 20:09:33 +02:00
.. _command-utilities-apply:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
apply <command> <text>
Tokenizes <text> and calls <command> with the resulting arguments.
2021-04-17 20:09:33 +02:00
.. _command-utilities-countargs:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
countargs <arg> [<arg> ...]
Counts the arguments given.
2021-04-17 20:09:33 +02:00
.. _command-utilities-echo:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
echo <text>
Returns the arguments given it. Uses our standard substitute on the string(s) given to it; $nick (or $who), $randomNick, $randomInt, $botnick, $channel, $user, $host, $today, $now, and $randomDate are all handled appropriately.
2021-04-17 20:09:33 +02:00
.. _command-utilities-ignore:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
ignore requires no arguments
Does nothing. Useful sometimes for sequencing commands when you don't care about their non-error return values.
2021-04-17 20:09:33 +02:00
.. _command-utilities-last:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
last <text> [<text> ...]
Returns the last argument given. Useful when you'd like multiple nested commands to run, but only the output of the last one to be returned.
2021-04-17 20:09:33 +02:00
.. _command-utilities-let:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
let <variable> = <value> in <command>
Defines <variable> to be equal to <value> in the <command> and runs the <command>. '=' and 'in' can be omitted.
2021-04-17 20:09:33 +02:00
.. _command-utilities-sample:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
sample <num> <arg> [<arg> ...]
Randomly chooses <num> items out of the arguments given.
2021-04-17 20:09:33 +02:00
.. _command-utilities-shuffle:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
shuffle <arg> [<arg> ...]
Shuffles the arguments given.
2021-04-17 20:09:33 +02:00
.. _command-utilities-sort:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
sort <arg> [<arg> ...]
Sorts the arguments given.
2021-04-17 20:09:33 +02:00
.. _command-utilities-success:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
success [<text> ]
Does nothing except to reply with a success message. This is useful when you want to run multiple commands as nested commands, and don't care about their output as long as they're successful. An error, of course, will break out of this command. <text>, if given, will be appended to the end of the success message.
2021-04-17 20:09:33 +02:00
.. _conf-Utilities:
2021-04-05 17:29:49 +02:00
Configuration
-------------
2021-04-17 20:09:33 +02:00
.. _conf-supybot.plugins.Utilities.public:
2021-04-22 00:29:15 +02:00
2021-04-05 17:29:49 +02:00
supybot.plugins.Utilities.public
This config variable defaults to "True", is not network-specific, and is not channel-specific.
Determines whether this plugin is publicly visible.