X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Usermgm.pm;h=83c27ca0681bd19111f68c305a887b0921ce313f;hb=2f3dd8afdb3ea3661cd8f6ba127240fb8dbcd08a;hp=332a9e1fa6796d5be961662139edd273bc2fe817;hpb=7ca93b2c5901c56f383e645b5d1985ab7f65635d;p=NDIRC.git diff --git a/Usermgm.pm b/Usermgm.pm index 332a9e1..83c27ca 100644 --- a/Usermgm.pm +++ b/Usermgm.pm @@ -192,16 +192,21 @@ sub getShips { } sub addPoints { - my ($t,$nick,$p) = @_; - DB(); + my ($msg, $t) = @_; + + my ($nick, $points); + if(defined $msg && $msg =~ /^(\S+)(?: (-?\d+))?$/){ + $nick = $1; + $points = $2; + }else{ + $ND::server->command("notice $ND::nick syntax: .$t nick [points] | % can be used for wildcards \%arro\% will match barrow, if the number of points isn't specified, then 1 will be assumed."); + return; + } if ( ($t eq "d" && dc()) || ($t eq "a" && bc()) || ($t eq "h" && officer()) || ($t eq "s" && scanner())){ - my $points = 1; - if ($p){ - $points = $p; - } + $points = 1 unless (defined $points); if ($points*$points > 400){ $ND::server->command("msg $ND::target Values between -20 and 20 please"); return;