}
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;