Warn when someone leaves without paying.
This commit is contained in:
parent
71817a0783
commit
8f84891b0c
3 changed files with 66 additions and 9 deletions
28
plugins/idle
Executable file
28
plugins/idle
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!perl
|
||||
|
||||
my $timeout = 10;
|
||||
|
||||
sub command { NEXT }
|
||||
|
||||
sub hook_prompt_idle {
|
||||
my ($class, $cart, $plugin, $seconds, $readline) = @_;
|
||||
if ($seconds >= $timeout and $cart->size and not $plugin) {
|
||||
$readline->ding;
|
||||
|
||||
return if $seconds > $timeout; # text only once
|
||||
|
||||
my $text = $readline->copy_text;
|
||||
my $point = $readline->{point};
|
||||
|
||||
$readline->save_prompt;
|
||||
$readline->replace_line("");
|
||||
$readline->redisplay;
|
||||
|
||||
print "\e[33;2;1mTransaction incomplete.\e[0m Enter username to pay/finish or 'abort' to abort.\n";
|
||||
|
||||
$readline->restore_prompt;
|
||||
$readline->replace_line($text);
|
||||
$readline->{point} = $point;
|
||||
$readline->redisplay;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue