]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/script.rb
iplookup plugin: support IPv6 too
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / script.rb
index 2d730fe92c426cb8cd012a3d03ae0db9d0ba35e5..eae1493956192ab65e7f7cf25e12df23f5102143 100644 (file)
@@ -37,7 +37,7 @@ class ScriptPlugin < Plugin
     if topic == "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>."
+      "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>."
     end
   end
 
@@ -112,7 +112,7 @@ class ScriptPlugin < Plugin
     code    = params[:code].to_s
     nick    = m.sourcenick
     created = Time.new.strftime '%Y/%m/%d %H:%m'
-    channel = m.target
+    channel = m.target.to_s
 
     command = Command.new( code, nick, created, channel )
     @commands[name] = command