#! perl cf::register_command tell => 0, sub { my ($who, $args) = @_; my ($target, $msg) = split /\s+/, $args, 2; my $name = $who->name; if (my $other = cf::player::find $target) { if ($other->ob->{ext_ignore_tell}{$name} < time) { delete $other->ob->{ext_ignore_tell}{$name}; } if ($target ne $name and !$other->ob->{ext_ignore_tell}{$name}) { $who->message ("You tell $target: $msg"); $other->ob->message ("$name tells you: $msg"); $other->ob->{ext_last_tell} = $name; } elsif ($target eq $name) { $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); } else { $who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE); } } else { $who->message ("No such player or ambiguous name. Your message: ".$msg, cf::NDI_UNIQUE); } }; cf::register_command reply => 0, sub { my $name = $who->name; if (my $other = cf::player::find $who->{ext_last_tell}) { if ($other->ob->{ext_ignore_tell}{$name} < time) { delete $other->ob->{ext_ignore_tell}{$name}; } if (!$other->ob->{ext_ignore_tell}{$name}) { $who->message ("You tell $target: $_"); $other->ob->message ("$name tells you: $_"); $who->{ext_last_tell} = $other->ob->name; } else { $who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE); } } else { $who->message ("Can't reply, player left. Your message: ".$_, cf::NDI_UNIQUE); } };