From 7c57d4bfc7e178147f6790cb257366266e639ef5 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 3 Nov 2008 23:05:01 +0100 Subject: [PATCH] script plugin: improve help --- data/rbot/plugins/script.rb | 11 ++++++++--- 1 file 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: ': 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