From 4bc25c0b112ce91439017357fd0c8c2f85a7fa5f Mon Sep 17 00:00:00 2001 From: Robin H. Johnson Date: Wed, 17 Jun 2009 22:15:59 +0000 Subject: [PATCH] Implement penalty for WHO and PART based on eggdrop code. --- lib/rbot/ircsocket.rb | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index d045ba6..a866a66 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -50,8 +50,14 @@ def irc_send_penalty dests = pars.split($;,2).first penalty += dests.split(',').size when :WHO - # I'm too lazy to implement this one correctly - penalty += 5 + args = parts.split + if args.length > 0 + penalty += args.inject(0){ |sum,x| sum += ((x.length > 4) ? 3 : 5) } + else + penalty += 10 + end + when :PART + penalty += 4 when :AWAY, :JOIN, :VERSION, :TIME, :TRACE, :WHOIS, :DNS penalty += 2 when :INVITE, :NICK -- 1.6.6.1