Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Xchat::hook_command('kickban', sub {
- my $command = "kick";
- my $nick = $_[0][1];
- my $mode = $_[0][2];
- my $message = $_[1][3];
- if (not $nick) {
- Xchat::print("Usage: KICKBAN <nick>, bans then kicks the nick from the current channel (needs chanop)");
- return Xchat::EAT_ALL;
- }
- if ((not $mode) || (not isint($mode))) {
- $mode = "1";
- $message = $_[1][2];
- }
- else {
- if (($mode == 0) || ($mode == 1) || ($mode == 2) || ($mode == 3)) {
- $mode = $_[0][2];
- }
- else {
- $mode = "1";
- }
- }
- Xchat::command("ban $nick $mode");
- if (not $message) {
- $message = Xchat::command('GETSTR '.
- '"message" '.
- '"'.$command.' '.$nick.'" '.
- '"Enter message"'
- );
- }
- else {
- Xchat::command("kick $nick $message");
- }
- return Xchat::EAT_ALL;
- });
- sub isint {
- my $val = shift;
- return ($val =~ m/^\d+$/);
- }
Add Comment
Please, Sign In to add comment