Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed WubWubWub to have a modifiable wub string for maximum awesomness.

  • Loading branch information...
commit c9b6ee5440ee286db6653b4b51ae7d8d0fc7f37c 1 parent 54a8d9e
Gary authored June 01, 2012
4  lib/RoboDuck.pm
@@ -31,11 +31,13 @@ username 'duckduckgo';
31 31
 owner '*!*@dukgo.com';
32 32
 
33 33
 plugins
  34
+  WubWubWub => RoboDuck::Plugin::WubWubWub->new({
  35
+		wub_str => 'quack'
  36
+  }),
34 37
   Goodies => "RoboDuck::Plugin::Goodies",
35 38
   DuckDuckGo => "RoboDuck::Plugin::DuckDuckGo",
36 39
   WolframAlpha => "RoboDuck::Plugin::WolframAlpha",
37 40
   Links => "RoboDuck::Plugin::Links",
38  
-  WubWubWub => "RoboDuck::Plugin::WubWubWub",
39 41
   YouTube => "RoboDuck::Plugin::YouTube",
40 42
   MetaCPAN => "RoboDuck::Plugin::MetaCPAN",
41 43
   CommitHook => "RoboDuck::Plugin::CommitHook",
5  lib/RoboDuck/Plugin/WubWubWub.pm
... ...
@@ -1,6 +1,5 @@
1 1
 package RoboDuck::Plugin::WubWubWUb;
2 2
 use Moses::Plugin;
3  
-use WebService::GData::YouTube;
4 3
 
5 4
 sub new {
6 5
 	my $package = shift; 
@@ -11,6 +10,7 @@ sub new {
11 10
 		last_wub  => 0,
12 11
 		max_wubs =>  20,  #maximum amount of wubs in one message
13 12
 		min_wubs =>  5,   #minimum amount of wubs in one message.
  13
+		wub_str  => "WUB", #wubstr
14 14
 	};
15 15
 	$self->{threshold} ||= $args->{threshold};
16 16
 	$self->{threshold} = 0.5 if $self->{threshold} >= 1 or $self->{threshold} <= 0; #sanity check lol.
@@ -22,6 +22,7 @@ sub new {
22 22
 	$self->{min_wubs}  = 5 if $self->{min_wubs} <= 0;					#no sense in having 0 as minimum amirite
23 23
 	$self->{min_wubs}  = $self->{max_wubs} - 1 if $self->{min_wubs} > $self->{max_wubs};	#don't want minimum > maximum
24 24
 	$self->{max_wubs}  = $self->{min_wubs} + 5 if $self->{min_wubs} > $self->{max_wubs};	#same except different.
  25
+	$self->{wub_str}   ||= $args->{wub_str};
25 26
 	return bless $self, $package;
26 27
 }
27 28
 
@@ -35,7 +36,7 @@ sub S_public {
35 36
 	if($cur_time - $old_time > $self->{period} &&
36 37
 	   $chance > $self->{threshold}) {
37 38
 			my $repetitions = (int rand($self->{max_wubs}-$self->{min_wubs})+$self->{min_wubs});
38  
-			my $wubstr = "WUB"x$repetitions;
  39
+			my $wubstr = $self->{wub_str}x$repetitions;
39 40
 			$irc->yield(privmsg => $channel => $wubstr);
40 41
 			$self->{last_wub} = time;
41 42
 			$retval = PCI_EAT_PLUGIN;

0 notes on commit c9b6ee5

Please sign in to comment.
Something went wrong with that request. Please try again.