]> ruin.nu Git - NDIRC.git/commitdiff
Update report_incs
authorMichael Andreen <harv@ruin.nu>
Sun, 24 Mar 2019 08:49:09 +0000 (09:49 +0100)
committerMichael Andreen <harv@ruin.nu>
Sun, 24 Mar 2019 08:49:09 +0000 (09:49 +0100)
Commands/Def.pm
Delling.pm

index c50f864b1dda054eefed8293b97302fcef8dca5e..ba077f75ca7f7b971682d936d1ef27586aab8976 100644 (file)
@@ -281,25 +281,25 @@ INSERT INTO incomings (call,pid,eta,amount,fleet) VALUES(?,?,?,?,?) RETURNING in
                                                },undef,$call[0],$attacker[2],$9,$amount,$7);
                                                @attacker = map ($c->valuecolor(0),@attacker);
                                                if (! $threefleeter || $call[1] ne 'Ignored'){
-                                                       $c->reply("<b>New incoming: CallId: $call[0], IncId: $incid $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]) https://nd.ruin.nu/calls/edit/$call[0]</b>");
+                                                       $c->bot->toTarget(def => "<b>New incoming: CallId: $call[0], IncId: $incid $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]) https://nd.ruin.nu/calls/edit/$call[0]</b>");
                                                }else{
-                                                       $c->reply("<b>Do not cover</b>, NoDef member is under attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4])  https://nd.ruin.nu/calls/edit/$call[0]");
+                                                       $c->bot->toTarget(def => "<b>Do not cover</b>, NoDef member is under attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4])  https://nd.ruin.nu/calls/edit/$call[0]");
                                                }
                                                $dbh->do(q{UPDATE planets SET hit_us = hit_us + 1 WHERE pid = ?},undef,$attacker[2]);
                                                if ($call[1] eq 'Covered'){
                                                        $dbh->do(q{UPDATE calls SET status = 'Open' WHERE call = ?},undef,$call[0]);
-                                                       $c->reply("<b>Call is likely not covered anymore, please recalc! calc: $call[2]</b>");
+                                                       $c->bot->toTarget(def => "<b>Call is likely not covered anymore, please recalc! calc: $call[2]</b>");
                                                }
                                        }else{
                                                @attacker = map ($c->valuecolor(0),@attacker);
-                                               $c->reply("Duplicate call: Callid: $call[0], Status: $call[1] $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]), landing tick: $landing_tick");
+                                               $c->bot->toTarget(def => "Duplicate call: Callid: $call[0], Status: $call[1] $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]), landing tick: $landing_tick");
                                        }
 
                                        my ($fleetcatch) = $dbh->selectrow_array(q{
 SELECT count(*) FROM launch_confirmations WHERE uid = ? AND back = ?
                                        },undef,$user->{uid},$landing_tick);
                                        if ($fleetcatch > 0){
-                                               $c->reply("<c04>THIS IS A POSSIBLE FLEETCATCH!</c>");
+                                               $c->bot->toTarget(def => "<c04>THIS IS A POSSIBLE FLEETCATCH!</c>");
                                        }
                                        $dbh->commit;
                                } catch {
@@ -307,10 +307,10 @@ SELECT count(*) FROM launch_confirmations WHERE uid = ? AND back = ?
                                        die $_;
                                };
                        }else{
-                               $c->reply("<c04>Didn't find any planet with coordinates $4:$5:$6 at this tick</c>");
+                               $c->bot->toTarget(def => "<c04>Didn't find any planet with coordinates $4:$5:$6 at this tick</c>");
                        }
                }else{
-                       $c->reply("<c04>No member registered with coordinates $1:$2:$3</c>");
+                       $c->bot->toTarget(def => "<c04>No member registered with coordinates $1:$2:$3</c>");
                }
        }
 };
index e04619015f4fdb8e8a5fafc39dfb79c75a5f7580..ac25d0f400a326f41fd01e3b5328411a10407af6 100644 (file)
@@ -183,7 +183,7 @@ sub refresh {
        while (my $req = $ircreqs->fetchrow_hashref){
                if ($req->{channel} eq 'def'){
                        $self->toTarget(def => "<c04>## $req->{username} via webbie ## >></c> $req->{message}");
-                       #$self->parseCommand("~report_incs $req->{message}",$irc,$req->{username},' BATCH ',$disp->targets->{def},$dbh);
+                       $self->parseCommand("~report_incs $req->{message}",$irc,$req->{username},' BATCH ','#def-ndawn',$dbh);
                }else{
                        $self->toTarget($req->{channel} => "<$req->{username} via webbie> $req->{message}");
                }