X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fscript.rb;h=793064bd20faa97723cd1db92796b4f1baf58fbb;hb=7c57d4bfc7e178147f6790cb257366266e639ef5;hp=c994d4da91c95a0a663d72473b1ac896b4d921a5;hpb=fdf1bc954352f19818f5f9f1c86643a2f8ef40c6;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index c994d4da..793064bd 100644 --- a/data/rbot/plugins/script.rb +++ b/data/rbot/plugins/script.rb @@ -34,18 +34,32 @@ 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: ': greet'." - else - "Create mini plugins on IRC. 'script add ' => Create script named with the Ruby program . 'script list' => Show a list of all known scripts. 'script show ' => Show the source code for . 'script del ' => Delete the script ." + when "allow" + "script allow