X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fscript.rb;h=793064bd20faa97723cd1db92796b4f1baf58fbb;hb=7c57d4bfc7e178147f6790cb257366266e639ef5;hp=e3e718a70546350808ec410c4eb2abe1b17e09e8;hpb=13391804db9e84749580811089f4be8e52dd1e0b;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/script.rb b/data/rbot/plugins/script.rb index e3e718a7..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: ': 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 . 'script eval ' => evaluate expression . 'script echo ' => evaluate and display expression ." + when "allow" + "script allow