]> ruin.nu Git - NDIRC.git/commitdiff
updated sendScan
authorMichael Andreen <harv@ruin.nu>
Mon, 10 Sep 2007 07:12:00 +0000 (09:12 +0200)
committerMichael Andreen <harv@ruin.nu>
Mon, 10 Sep 2007 07:12:00 +0000 (09:12 +0200)
Scans.pm

index 1315e22408b2875ef6357fe05f46660fe2501990..15766456351c8f459ba37fb01523106a8937bade 100644 (file)
--- a/Scans.pm
+++ b/Scans.pm
@@ -71,11 +71,18 @@ sub addScanGroup {
 }
 
 sub sendScan {
-       my ($target,$msg) = @_;
-       DB();
+       my ($msg, $command) = @_;
+       my ($target,$mess);
+       if (defined $msg && $msg =~ /^(\S+) (.*)$/){
+               $target = $1;
+               $mess = $2;
+       }else{
+               $ND::server->command("notice $ND::nick syntax: $command nick message");
+               return;
+       }
        if (scanner()){
-               $ND::server->command("msg $target ".chr(2).$msg.chr(3)."4 (reply with /msg $ND::scanchan)");
-               $ND::server->command("msg $ND::target ${ND::C}3$1 << $2");
+               $ND::server->command("msg $target ".chr(2).$mess.chr(3)."4 (reply with /msg $ND::scanchan)");
+               $ND::server->command("msg $ND::target ${ND::C}3$target << $mess");
        }
 }