3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 04:02:37 +01:00

Interpreter: reduce human-like delay durations

This commit is contained in:
Pragmatic Software 2019-05-15 10:59:20 -07:00
parent 57a4434289
commit 6f6090efc5

View File

@ -295,7 +295,7 @@ sub interpret {
my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick'); my $botnick = $self->{pbot}->{registry}->get_value('irc', 'botnick');
if (defined $arguments && ($arguments =~ m/^(your|him|her|its|it|them|their)(self|selves)$/i || $arguments =~ m/^$botnick$/i)) { if (defined $arguments && ($arguments =~ m/^(your|him|her|its|it|them|their)(self|selves)$/i || $arguments =~ m/^$botnick$/i)) {
my $delay = (rand 10) + 8; my $delay = (rand 10) + 5;
my $message = { my $message = {
nick => $stuff->{nick}, user => $stuff->{user}, host => $stuff->{host}, command => $stuff->{command}, checkflood => 1, nick => $stuff->{nick}, user => $stuff->{user}, host => $stuff->{host}, command => $stuff->{command}, checkflood => 1,
message => "$stuff->{nick}: Why would I want to do that to myself?" message => "$stuff->{nick}: Why would I want to do that to myself?"
@ -566,8 +566,7 @@ sub handle_result {
} }
if ($use_output_queue) { if ($use_output_queue) {
my $delay = (rand 5) + 5; # initial delay for reading/processing user's message my $delay = (rand 10) + 5;
$delay += (length $line) / 7; # additional delay of 7 characters per second typing speed
my $message = { my $message = {
nick => $stuff->{nick}, user => $stuff->{user}, host => $stuff->{host}, command => $stuff->{command}, nick => $stuff->{nick}, user => $stuff->{user}, host => $stuff->{host}, command => $stuff->{command},
message => $line, checkflood => 1 message => $line, checkflood => 1