Created
December 6, 2011 15:49
-
-
Save lysol/1438653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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