-sub gs
- : Help(syntax: gs type X:Y:Z message | type is the first character in the scan name, like p for planet scan, message is a message to scanners, like plz or thanks like plz or thanks)
- : ACL(irc_gs)
- : Type(pm)
-{
- my ($self,$c,$args) = @_;
-
- my ($typeid, $x, $y, $z, $msg) = $args =~ /^([pdunja]) (\d+)\D+(\d+)\D+(\d+) (\S.*)/
- or die 'ARGS';
- $typeid = $scanid{$typeid};
- my $type = $scantypes[$typeid-1];
-
- my $planet = $c->model->selectrow_array(q{SELECT planetid($1,$2,$3,tick())}
- ,undef,$x,$y,$z);
- unless ($planet){
- $c->reply("There is no planet with coords $x:$y:$z, try again after the tick.");
- return;
- }
+command gs => {
+ help => q(syntax: gs type X:Y:Z message | type is the first character in the scan name, like p for planet scan, message is a message to scanners, like plz or thanks like plz or thanks),
+ acl => q(irc_gs),
+ type => q(pm),
+}, class extends NDIRC::Command {
+ method execute($c,$args) {
+ my ($typeid, $x, $y, $z, $msg) = $args =~ /^([pdunja]) (\d+)\D+(\d+)\D+(\d+) (\S.*)/
+ or die 'ARGS';
+ $typeid = $scanid{$typeid};
+ my $type = $scantypes[$typeid-1];
+
+ my ($planet,$dists,$tick) = $c->model->selectrow_array(q{
+SELECT pid,distorters,tick
+FROM current_planet_stats LEFT JOIN current_development_scans USING (pid)
+WHERE x = $1 AND y = $2 AND z = $3
+ },undef,$x,$y,$z);
+ unless ($planet){
+ $c->reply("There is no planet with coords $x:$y:$z, try again after the tick.");
+ return;
+ }