diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-11-03 23:05:01 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-11-03 23:05:01 +0100 |
commit | 7c57d4bfc7e178147f6790cb257366266e639ef5 (patch) | |
tree | e370d3b7017bf4680b08c56a4dc4d88364a7a568 /data/rbot/plugins/script.rb | |
parent | 98ddb802a521168fd4e4e5f46a048f993aaa1588 (diff) |
script plugin: improve help
Diffstat (limited to 'data/rbot/plugins/script.rb')
-rw-r--r-- | data/rbot/plugins/script.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index 16f39648..793064bd 100644 --- a/data/rbot/plugins/script.rb +++ b/data/rbot/plugins/script.rb @@ -34,10 +34,15 @@ class ScriptPlugin < Plugin def help( plugin, topic="" ) - if topic == "add" + case topic + when "add" "Scripts are little Ruby programs that run in the context of the script plugin. You can access @bot (class Irc::Bot), m (class Irc::PrivMessage), user (class String, either the first argument, or if missing the sourcenick), and args (class Array, an array of arguments). Example: 'script add greet m.reply( 'Hello ' + user )'. Invoke the script just like a plugin: '<botnick>: greet'." - else - "Create mini plugins on IRC. 'script add <name> <code>' => Create script named <name> with the Ruby program <code>. 'script list' => Show a list of all known scripts. 'script show <name>' => Show the source code for <name>. 'script del <name>' => Delete the script <name>. 'script eval <expr>' => evaluate expression <expr>. 'script echo <expr>' => evaluate and display expression <expr>." + when "allow" + "script allow <script> for <user> [where] => allow <user> to run script <script> [where]" + when "allow" + "script deny <script> for <user> [where] => prevent <user> from running script <script> [where]" + else + "Create mini plugins on IRC. 'script add <name> <code>' => Create script named <name> with the Ruby program <code>. 'script list' => Show a list of all known scripts. 'script show <name>' => Show the source code for <name>. 'script del <name>' => Delete the script <name>. 'script eval <expr>' => evaluate expression <expr>. 'script echo <expr>' => evaluate and display expression <expr>. See also: add, allow, deny." end end |