Skip to content

Instantly share code, notes, and snippets.

@saihtaM
Created March 6, 2014 23:50
Show Gist options
  • Save saihtaM/9402209 to your computer and use it in GitHub Desktop.
Save saihtaM/9402209 to your computer and use it in GitHub Desktop.
Irssi script: Epic repeat!!
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "1.0";
%IRSSI = (
authors => "Mathias F. Svendsen",
contact => "#Mathias @ irc.QuakeNet.org",
name => "Epic repeat!!",
description => "A quick command, to repeat commands!",
license => "GPL",
url => "http://okey.dk/"
# This script was made by request, for test of something. Since I havent found any noobs using irssi - I decided to make it public. I just hope no one will use this for bad things.
# If you decide to use this for abuse/spam/something-evil. You hereby agree that any IRC oper may kill you slowly and painful in real life to death - unless pain ofc. is your fetish.
);
sub epic_repeat {
my ($data, $server, $witem) = @_;
$times = int((split/\s+/,$data)[0]);
if ($times > Irssi::settings_get_int('epicrepeat_max_repeats')) {
$witem->print("Hold it right there! You just hit the max_repeats limit - Please don't use this script for spamming. If your last command is really needed - you can increase the epicrepeat_max_repeats setting and try again.");
return;
}
$data =~ s/^\S+\s*//;
$count = 1;
while ($count <= $times) {
$witem->command($data);
$count++;
}
}
Irssi::settings_add_int('epicrepeat', 'epicrepeat_max_repeats', 5);
Irssi::command_bind('repeat', 'epic_repeat');
Irssi::command_bind('epicrepeat', 'epic_repeat');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment