Skip to content

Instantly share code, notes, and snippets.

@lysol
Created December 6, 2011 15:49
Show Gist options
  • Save lysol/1438653 to your computer and use it in GitHub Desktop.
Save lysol/1438653 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use vars qw($VERSION %IRSSI);
$VERSION = "0.0.1";
%IRSSI = (
authors => "lysol",
contact => "zzzzbest\@gmail.com",
name => "Derek Arnold",
description => "Randomly say bust a move",
url => "",
changed => "",
modules => "",
license => "GPLv2",
);
my $enabled = 0;
sub bustamove
{
$enabled = 1;
my ($data, $server, $witem) = @_;
if (!$server || !$server->{connected}) {
Irssi::print("Not connected to server");
return;
}
if (!$witem || $witem->{type} ne "CHANNEL") {
Irssi::print("Not a channel.");
return;
}
sub bustit {
if (!$enabled) { return; }
$witem->command("MSG ".$witem->{name} . " bust a move");
my $delay = int(rand(86400000)) + 1800000;
Irssi::timeout_add_once($delay, "bustit", []);
}
Irssi::timeout_add_once(5000, "bustit", []);
}
sub stopbust {
$enabled = 0;
}
Irssi::command_bind("bustamove", "bustamove");
Irssi::command_bind("stopbust", "stopbust");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment