Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. # Name: multilinecatch-002.pl
  2. # Version: 002
  3. # Author: LifeIsPain < idontlikespam (at) orvp [dot] net >
  4. # Date: 2010-04-29
  5. # Description: Restrict multi line pastes. If more than 3 lines, don't allow text to go through on first enter
  6.  
  7. # Version History
  8. # 001 2009-06-02 Initial Code
  9. # 002 2010-04-29 Allow sequential line feeds
  10.  
  11. use strict;
  12. use warnings;
  13. use Xchat qw(:all);
  14.  
  15. register('Multi-line catch', '002', 'Restrict multi line pastes');
  16. hook_print('Key Press', \&check_multiline);
  17.  
  18. my $lastcheck = '';
  19.  
  20. sub check_multiline {
  21. if ($_[0][0] == 65293 || $_[0][0] == 65421) {
  22. my $checkstring = get_info('inputbox');
  23. if ($checkstring ne $lastcheck && 2 < ($checkstring =~ tr/\n//s)) {
  24. $lastcheck = get_info('inputbox');
  25. prnt("The input box has too many line returns. If you really want to send this line, press Enter again.");
  26. return EAT_XCHAT;
  27. }
  28. }
  29. return EAT_NONE;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement